Logic Gates & Boolean Algebra

30 minutes Intermediate 61 Questions
Topic Overview

5. Logic Gates & Boolean Algebra Basic Logic Gates (AND, OR, NOT), Universal Gates (NAND, NOR), Truth Tables, Boolean Expressions, Logic Circuits,

Complete Topic Overview

5. Logic Gates & Boolean Algebra


Introduction to Logic Gates and Boolean Algebra


Digital computers operate using electronic circuits that process information in the form of binary signals (0 and 1). These signals represent the two states of a digital system such as ON/OFF, TRUE/FALSE, or HIGH/LOW.

To perform logical operations on binary data, computers use logic gates. Logic gates are the fundamental building blocks of digital circuits and are used in processors, memory units, and other electronic systems.

The mathematical system used to analyze and design these logic circuits is called Boolean Algebra. Boolean algebra was developed by the mathematician George Boole and deals with variables that have only two possible values: 0 or 1.

By combining logic gates according to Boolean expressions, complex digital systems such as adders, multiplexers, processors, and memory circuits can be built.


Basic Logic Gates


Basic logic gates are the simplest digital circuits that perform logical operations on one or more binary inputs to produce a single binary output.

The three fundamental logic gates are:

  • AND Gate
  • OR Gate
  • NOT Gate

These gates form the basis for all digital circuit design.


AND Gate


The AND gate performs a logical multiplication operation. It produces an output of 1 only when all its inputs are 1. If any input is 0, the output becomes 0.

This means that all conditions must be true for the output to be true.

Boolean Expression

The Boolean expression for an AND gate is:

A · B

Truth Table

A B Output (A · B)
0 0 0
0 1 0
1 0 0
1 1 1

Practical Example

A security system may allow access only when two conditions are true, such as:

  • Password is correct
  • Fingerprint is verified

Only when both inputs are true does the system grant access.


OR Gate


The OR gate performs a logical addition operation. It produces an output of 1 if at least one input is 1.

The output becomes 0 only when all inputs are 0.

Boolean Expression

The Boolean expression for an OR gate is:

A + B

Truth Table

A B Output (A + B)
0 0 0
0 1 1
1 0 1
1 1 1

Practical Example

An alarm system may activate if any one of multiple sensors detects movement.

For example:

  • Door sensor
  • Window sensor

If either sensor detects intrusion, the alarm is triggered.


NOT Gate


The NOT gate performs a logical inversion operation. It has only one input and one output.

The output is always the opposite of the input.

If input is 1, output becomes 0.
If input is 0, output becomes 1.

Boolean Expression

The Boolean expression for a NOT gate is:

A'

or

¬A

Truth Table

A Output (A')
0 1
1 0

Practical Example

A NOT gate can be used in systems where an action occurs when a condition is not satisfied.

For example, a light may turn on when darkness is detected, meaning when the light sensor input is 0.


Universal Gates


Universal gates are special types of logic gates that can be used to implement any Boolean function and can also recreate all other logic gates.

The two universal gates are:

  • NAND Gate
  • NOR Gate

Because of their flexibility, these gates are widely used in digital circuit design and integrated circuits.


NAND Gate


The NAND gate is the combination of an AND gate followed by a NOT gate.

It produces an output of 0 only when all inputs are 1. In every other case, the output is 1.

Boolean Expression

The Boolean expression for a NAND gate is:

(A · B)'

Truth Table

A B Output
0 0 1
0 1 1
1 0 1
1 1 0

Importance

The NAND gate is widely used in digital electronics because any digital circuit can be constructed using only NAND gates.


NOR Gate


The NOR gate is the combination of an OR gate followed by a NOT gate.

It produces an output of 1 only when all inputs are 0.

Boolean Expression

The Boolean expression for a NOR gate is:

(A + B)'

Truth Table

A B Output
0 0 1
0 1 0
1 0 0
1 1 0

Importance

Like the NAND gate, the NOR gate is also a universal gate, meaning all other logic gates can be constructed using only NOR gates.


Truth Tables


A truth table is a table that shows the relationship between all possible input combinations and their corresponding outputs for a logic gate or logical expression.

Truth tables are used to analyze and verify the behavior of digital circuits.

For a system with n inputs, the truth table will contain 2ⁿ possible combinations.

For example:

  • 1 input → 2 combinations
  • 2 inputs → 4 combinations
  • 3 inputs → 8 combinations

Truth tables help engineers understand how a logic circuit will behave before physically building it.


Boolean Expressions


Boolean expressions are mathematical representations of logical operations using Boolean variables and operators.

These expressions describe how the output of a logic circuit depends on its inputs.

Boolean variables can only have two values:

  • 0 (False)
  • 1 (True)

Common Boolean Operators

AND Operator (·)

Represents logical multiplication.

Example:

A · B

Output is true only when both A and B are true.

OR Operator (+)

Represents logical addition.

Example:

A + B

Output is true if at least one input is true.

NOT Operator (')

Represents logical negation or inversion.

Example:

A'

Output is the opposite of A.


Example Boolean Expression

Example:

Y = (A · B) + C

This means the output Y will be true if A and B are both true OR if C is true.

Boolean expressions are used in the design and simplification of digital circuits.


Logic Circuits


Definition

A logic circuit is a combination of multiple logic gates connected together to perform a specific logical operation.

Logic circuits form the foundation of digital electronics and computer systems.

They process binary data and generate outputs according to the logical relationships between inputs.


Types of Logic Circuits

Combinational Circuits

In combinational circuits, the output depends only on the current inputs.

There is no memory element involved.

Examples include:

  • Adders
  • Subtractors
  • Multiplexers
  • Encoders
  • Decoders

These circuits are commonly used in arithmetic operations and data processing.

Sequential Circuits

Sequential circuits depend on both the current inputs and previous outputs.

These circuits include memory elements such as flip-flops and registers.

Examples include:

  • Counters
  • Shift registers
  • Memory units

Sequential circuits are used in systems that require storing information.


Importance of Logic Circuits

Logic circuits are essential in modern digital systems because they are used in:

  • Computer processors (CPUs)
  • Memory devices
  • Control systems
  • Communication systems
  • Embedded systems

Every modern digital device—from smartphones to supercomputers—relies on logic circuits to perform operations.


Logic gates and Boolean algebra form the foundation of digital electronics and computer architecture. By using Boolean expressions and truth tables, engineers can design logic circuits that process binary data efficiently. These circuits are the fundamental building blocks used to create complex digital systems such as microprocessors, memory units, and computer hardware.

41
How many input combinations exist in a truth table with 2 inputs?
Easy 1 Mark
Use 2 raised to the power of the number of inputs.
A 2
B 4
C 8
D 16
42
Truth tables are used to:
Easy 1 Mark
What do engineers use truth tables for before building actual circuits?
A Program computers in assembly language
B Analyse and verify the behaviour of digital circuits
C Store data in computer memory
D Design graphical user interfaces
43
A truth table with 1 input has how many rows?
Easy 1 Mark
Apply the formula 2^n with n=1.
A 1
B 2
C 4
D 8
44
What are Boolean expressions?
Medium 2 Marks
Think about how algebra represents arithmetic — Boolean expressions represent logic.
A Programs written in binary language
B Mathematical representations of logical operations using Boolean variables and operators
C Formulas used in spreadsheet calculations
D Methods to convert decimal to binary
45
In the Boolean expression A · B what does the dot operator represent?
Easy 1 Mark
The dot is the multiplication symbol in Boolean algebra.
A OR operation
B NOT operation
C AND operation
D XOR operation
46
In the Boolean expression A + B what does the + operator represent?
Easy 1 Mark
In Boolean algebra the plus sign means OR not arithmetic addition.
A Arithmetic addition
B AND operation
C NOT operation
D OR operation
47
What does the expression Y = (A · B) + C mean?
Hard 3 Marks
Evaluate the brackets first then apply the OR operation.
A Y is true only when A B and C are all true
B Y is true if both A and B are true OR if C is true
C Y is true only when C is true
D Y is always false when A is false
48
Which Boolean operator represents logical negation or inversion?
Easy 1 Mark
NOT is the complement operator — it flips the value.
A · (dot)
B + (plus)
C #NAME?
D (prime/apostrophe)
49
What is a logic circuit?
Easy 1 Mark
Multiple gates connected together form a logic circuit.
A A single logic gate operating alone
B A combination of multiple logic gates connected to perform a specific logical operation
C A circuit that stores binary data permanently
D A software simulation of hardware
50
In a combinational circuit the output depends on:
Medium 2 Marks
No memory means only present inputs matter — no past states.
A Previous outputs stored in memory
B Only the current inputs with no memory element
C Both current inputs and previous stored outputs
D The speed of the processor
51
Which of the following is an example of a combinational circuit?
Medium 2 Marks
Which option performs a calculation based only on current input values?
A Counter
B Shift register
C Adder
D Flip-flop
52
In a sequential circuit the output depends on:
Medium 2 Marks
Sequential circuits remember past states — they have memory.
A Only the current inputs
B The speed of the clock signal
C Both current inputs AND previous outputs (memory)
D The type of logic gates used
53
Which of the following is an example of a sequential circuit?
Medium 2 Marks
Which option needs to remember its previous state to function?
A Adder
B Decoder
C Multiplexer
D Counter
54
Logic circuits are used in which of the following?
Easy 1 Mark
Think about all the digital components inside a modern computer.
A Only in keyboards
B Only in monitors
C Computer processors memory devices and control systems
D Only in network cables
55
What is the key difference between combinational and sequential circuits?
Hard 3 Marks
What do sequential circuits have that combinational circuits do not?
A Combinational circuits are faster than sequential circuits
B Sequential circuits use only AND and OR gates while combinational use NOT
C Combinational circuits have no memory; sequential circuits include memory elements
D Sequential circuits can only count; combinational circuits only add
56
What are the three fundamental logic gates?
Easy 1 Mark
These three form the foundation of all digital circuit design.
A NAND NOR and XOR
B AND OR and NOT
C AND OR and NAND
D NOT NAND and NOR
57
Which gate produces output 0 only when all inputs are 1?
Medium 2 Marks
AND gives 1 when all inputs are 1 — NAND gives the opposite.
A AND gate
B OR gate
C NOT gate
D NAND gate
58
Which gate produces output 1 only when all inputs are 0?
Medium 2 Marks
OR gives 0 when all inputs are 0 — NOR gives the opposite.
A AND gate
B OR gate
C NAND gate
D NOR gate
59
What is the output of the expression (A · B) when A=0 and B=1?
Easy 1 Mark
AND needs all inputs to be 1 — if any is 0 the result is 0.
A 1
B 0
C Undefined
D 2
60
What is the output of the expression (A + B) when A=0 and B=1?
Easy 1 Mark
OR needs only one input to be 1 — B satisfies this.
A 0
B 1
C Undefined
D Both 0 and 1
Question Palette
0/61 Answered
Showing 41 - 60 of 61
Instructions:
  • Click on an option to select your answer
  • Use the hint button if you need help
  • Track your progress with the question palette
  • Submit your answers to see results
Difficulty Distribution
Easy 11
Medium 7
Hard 2