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.

21
For a NOT gate with input A=1 what is the output?
Easy 1 Mark
NOT means opposite — flip the input value.
A 1
B 0
C Undefined
D 2
22
For a NOT gate with input A=0 what is the output?
Easy 1 Mark
NOT gate always gives the opposite of its input.
A 0
B 1
C Undefined
D Depends on circuit
23
A light turns ON when darkness is detected (sensor = 0). Which gate models this behaviour?
Medium 2 Marks
Which gate flips 0 to 1 and 1 to 0?
A AND gate
B OR gate
C NOT gate
D NOR gate
24
What are universal gates?
Medium 2 Marks
These special gates can replace every other gate.
A Gates that only work with decimal numbers
B Gates that can implement any Boolean function and recreate all other logic gates
C Gates used only in memory circuits
D The three fundamental gates AND OR NOT
25
What are the two universal logic gates?
Easy 1 Mark
These two gates each have NAN- or NOR- in their names.
A AND and OR
B AND and NOT
C NAND and NOR
D OR and NOT
26
Why are NAND and NOR gates called universal gates?
Medium 2 Marks
What makes a gate universal in digital circuit design?
A Because they are the most commonly used gates in computers
B Because any digital circuit can be built using only NAND gates or only NOR gates
C Because they process both binary and decimal data
D Because they have the highest output voltage
27
What combination of gates makes a NAND gate?
Easy 1 Mark
NAND = NOT + AND — the name tells you the combination.
A OR gate followed by NOT gate
B AND gate followed by NOT gate
C NOT gate followed by AND gate
D Two NOT gates combined
28
What is the Boolean expression for a NAND gate?
Medium 2 Marks
Start with AND then apply NOT to the result.
A A + B
B (A + B) prime
C (A · B) prime
D A prime + B prime
29
For a NAND gate with A=1 and B=1 what is the output?
Medium 2 Marks
NAND is the inverse of AND — when AND gives 1 NAND gives 0.
A 1
B 0
C Undefined
D 2
30
For a NAND gate with A=0 and B=1 what is the output?
Medium 2 Marks
NAND gives 0 only when every input is 1 — otherwise output is 1.
A 0
B 1
C Undefined
D Depends on voltage
31
For a NAND gate with A=0 and B=0 what is the output?
Easy 1 Mark
Apply AND first then invert the result.
A 0
B 1
C Undefined
D Both 0 and 1
32
How many rows in the NAND gate truth table produce output 0?
Hard 3 Marks
NAND is the complement of AND — AND has one row with output 1 so NAND has one row with output 0.
A 0
B 1
C 2
D 3
33
What combination of gates makes a NOR gate?
Easy 1 Mark
NOR = NOT + OR — the name reveals the combination.
A AND gate followed by NOT gate
B NOT gate followed by OR gate
C OR gate followed by NOT gate
D Two AND gates combined
34
What is the Boolean expression for a NOR gate?
Medium 2 Marks
Start with OR then apply NOT to the result.
A (A · B) prime
B A + B
C (A + B) prime
D A prime · B prime
35
For a NOR gate with A=0 and B=0 what is the output?
Easy 1 Mark
NOR gives 1 only when every input is 0.
A 0
B 1
C Undefined
D 2
36
For a NOR gate with A=1 and B=0 what is the output?
Medium 2 Marks
Apply OR first then invert — if OR gives 1 then NOR gives 0.
A 1
B 0
C Undefined
D Depends on voltage
37
For a NOR gate with A=1 and B=1 what is the output?
Medium 2 Marks
Apply OR then invert — OR of 1 and 1 is 1 which inverts to 0.
A 1
B 0
C Undefined
D Both 0 and 1
38
How many rows in a 2-input NOR gate truth table produce output 1?
Hard 3 Marks
NOR is the complement of OR — OR has one row with output 0 so NOR has one row with output 1.
A 0
B 1
C 2
D 3
39
What is a truth table?
Easy 1 Mark
Think about a table that maps every possible input to its output.
A A table showing marks scored in an exam
B A table showing all possible input combinations and their corresponding outputs for a logic circuit
C A list of Boolean variables
D A diagram showing logic gate symbols
40
How many rows does a truth table have for a circuit with 3 inputs?
Medium 2 Marks
Use the formula 2 to the power of n where n is the number of inputs.
A 4 rows
B 6 rows
C 8 rows
D 16 rows
Question Palette
0/61 Answered
Showing 21 - 40 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 8
Medium 10
Hard 2