Playing as a guest? to earn XP and track your progress.
Boolean Logic Quiz
Boolean Logic
Who developed Boolean logic (Boolean algebra)?
George Boole
John von Neumann
Charles Babbage
Alan Turing
Boolean logic was developed by the mathematician George Boole.
In which book did George Boole publish his system of logic in 1854?
The Analytical Engine
Principles of Computing
An Investigation of the Laws of Thought
On Computable Numbers
Boole published it in 1854 in 'An Investigation of the Laws of Thought'.
What are the two values used in Boolean algebra?
YES, NO and MAYBE
Positive and negative numbers
0 and 10
TRUE (1) and FALSE (0)
Boolean algebra uses only two values: TRUE (1) and FALSE (0).
A binary valued quantity is a variable that:
Holds a binary number of 8 bits
Can hold only one of two possible values
Always holds the value 1
Can hold any whole number
A binary valued quantity can take only one of two values, such as TRUE/FALSE or 1/0.
Which real-world example is a binary valued quantity?
Whether a light switch is ON or OFF
The temperature of a room
The number of students in a class
The marks scored in an exam
A light switch is either ON or OFF — only two possible states.
What is a logical function (compound statement)?
A type of logic gate
A list of all binary numbers
An expression that combines Boolean variables with logical operators to give TRUE or FALSE
A Python function that returns a number
A logical function combines one or more Boolean variables using logical operators and produces a TRUE or FALSE result, e.g. Y = A AND B.
What are the three fundamental logical operators?
+, -, ×
IF, THEN, ELSE
NAND, NOR, XOR
AND, OR, NOT
The three basic logical operators are AND, OR and NOT.
The AND operation gives TRUE when:
The inputs are different
Both inputs are TRUE
At least one input is TRUE
Both inputs are FALSE
AND is TRUE only when BOTH inputs are TRUE.
The OR operation gives FALSE only when:
Both inputs are FALSE
Exactly one input is TRUE
The inputs are the same
Both inputs are TRUE
OR is TRUE if at least one input is TRUE, so it is FALSE only when both inputs are FALSE.
Which symbol is commonly used for OR in Boolean expressions?
·
⊕
+
'
OR is written as + (or ∨); AND as · (or ∧, or just AB); NOT as ' or a bar.
In Boolean notation, what does A' represent?
A AND 1
A squared
A OR A
NOT A (complement of A)
An apostrophe (or a bar over the variable) denotes NOT, the complement of A.
How many rows does the truth table of an expression with 3 variables have?
6
8
3
9
A truth table has 2ⁿ rows for n variables; 2³ = 8.
For Y = A·B + C, what is Y when A=1, B=0, C=0?
0
Cannot be found
1
2
A·B = 1·0 = 0, and 0 + C = 0 + 0 = 0.
For Y = A·B + C, what is Y when A=1, B=1, C=0?
0
2
1
Undefined
A·B = 1·1 = 1, and 1 + 0 = 1.
For Y = A + B', what is Y when A=0 and B=1?
2
1
Undefined
0
B' = 0, so Y = 0 + 0 = 0.
What is a logic gate?
A software program that checks passwords
An electronic circuit that implements a Boolean operation, taking inputs and giving one output
A port on the computer
A type of memory
A logic gate is a physical electronic circuit that implements a logical operation, producing one output from its inputs.
How many inputs does a NOT gate (inverter) have?
One
Two
Any number
Three
The NOT gate has only one input and simply inverts it.
What is the output of an AND gate when its inputs are A=1 and B=0?
Undefined
1
0
10
AND gives 1 only when both inputs are 1; here one input is 0, so the output is 0.
What is the output of an OR gate when its inputs are A=0 and B=1?
01
Undefined
0
1
OR gives 1 when at least one input is 1.
What are postulates in Boolean algebra?
Types of logic gates
Fundamental, self-evident rules accepted as true without proof
Programs written in Boolean
Theorems that must be proved with truth tables
Postulates are the basic rules of Boolean algebra, accepted as true without needing proof.
Which postulate states that 0 is the identity for OR and 1 is the identity for AND?
Identity elements
Commutativity
Closure
Complement
Identity elements: A + 0 = A and A · 1 = A.
The closure postulate says that:
The order of variables does not matter
Every value has a complement
Combining two Boolean values with AND/OR always gives another Boolean value
Every expression can be simplified to 1
Closure means AND/OR of two Boolean values is always a valid Boolean value, e.g. 1 AND 0 = 0.
According to the complement postulate, A + A' equals:
0
A
A'
1
A variable ORed with its complement is always 1 (and A · A' = 0).
The principle of duality says a valid Boolean expression stays valid if you swap:
A and B
AND ↔ OR and 0 ↔ 1
NOT ↔ AND
Rows and columns of the truth table
Duality: interchange AND with OR and 0 with 1 to get the dual expression.
What is the dual of A + 0 = A?
A · 1 = A
A + 1 = 1
A · 0 = 0
A' + 0 = A'
Swap + with · and 0 with 1: A · 1 = A.
What is the dual of A · (B + C)?
A · (B · C)
A + (B + C)
A + (B · C)
A' · (B' + C')
Swap · with + and + with ·: A + (B · C).
What is the dual of A + 1 = 1?
A + 0 = A
A · 1 = A
A · A = A
A · 0 = 0
Swap + with · and 1 with 0: A · 0 = 0.
What is the value of A + 1?
A
1
0
A'
OR with 1 is always 1 (null/dominant law).
What is the value of A · 0?
0
A'
A
1
AND with 0 is always 0.
The idempotence law states that:
(A')' = A
A + B = B + A
A + A = A and A · A = A
A + A' = 1
Combining a variable with itself changes nothing: A + A = A and A · A = A.
Which law states that (A')' = A?
Associative
Absorption
Complementarity
Involution (double negation)
Involution: complementing twice returns the original value.
What is A · A' equal to?
A'
0
1
A
By the complementarity law, a variable ANDed with its complement is always 0.
(A + B) + C = A + (B + C) is an example of which law?
Associative
Absorption
Distributive
Commutative
The associative law says the grouping of terms does not change the result.
A · B = B · A is an example of which law?
Idempotent
Involution
Commutative
Associative
The commutative law: order does not matter for AND/OR.
Which distributive law is valid in Boolean algebra but NOT in ordinary arithmetic?
A · (B + C) = A·B + A·C
A + B = B + A
A · 1 = A
A + (B · C) = (A + B) · (A + C)
In Boolean algebra OR also distributes over AND: A + BC = (A + B)(A + C). This does not hold for + and × in ordinary maths.
Simplify Y = A + A·B.
A·B
A
B
A + B
By the absorption law, A + (A·B) = A.
Simplify Y = A + A'B.
A + B
A
B
A'B
By the redundancy law, A + A'B = A + B.
Using the consensus theorem, AB + A'C + BC simplifies to:
AB + BC
A + B + C
AB + A'C
A'C + BC
Consensus theorem: AB + A'C + BC = AB + A'C (the BC term is redundant).
Using the distributive law, A·B + A·C can be written as:
(A + B)·C
A·B·C
A + (B·C)
A · (B + C)
Factor out A: A·B + A·C = A·(B + C).
Which is DeMorgan's First Theorem?
(A · B)' = A' · B'
(A · B)' = A' + B'
(A + B)' = A' + B'
A + A' = 1
DeMorgan's First Theorem: the complement of an AND equals the OR of the complements, (A·B)' = A' + B'.
Which is DeMorgan's Second Theorem?
(A + B)' = A' · B'
(A')' = A
(A + B)' = A' + B'
(A · B)' = A' · B'
DeMorgan's Second Theorem: (A + B)' = A' · B'.
The memory trick for DeMorgan's theorems is:
Remove the bar, keep the operator
Add a bar to each gate
Break the bar, change the operator
Double the bar, keep the operator
When the NOT bar is pushed inside the brackets it breaks onto each variable, and AND and OR swap.
Simplify (A' + B')' using DeMorgan's theorem.
A' + B'
A' · B'
A + B
A · B
(A' + B')' = (A')' · (B')' = A · B, using DeMorgan's theorem and then involution.
A common mistake when applying DeMorgan's theorem is to:
Apply it to two variables
Break the bar but forget to swap AND and OR
Use a truth table
Write the complement with an apostrophe
You must both break the bar AND swap the operator; forgetting the swap gives a wrong result.
A NAND gate is equivalent to:
An AND gate followed by a NOT gate
A NOT gate followed by an OR gate
An OR gate followed by a NOT gate
Two AND gates
NAND = NOT(AND): its output is the exact opposite of an AND gate.
What is the output of a NAND gate when both inputs are 1?
11
Undefined
0
1
AND of 1 and 1 is 1, and NOT of that is 0. NAND is 0 only when both inputs are 1.
What is the output of a NOR gate when both inputs are 0?
0
00
Undefined
1
OR of 0 and 0 is 0, and NOT of that is 1. NOR is 1 only when both inputs are 0.
Why are NAND and NOR called universal gates?
They are used in every country
Any other logic gate can be built using only NAND gates or only NOR gates
They have the most inputs
They work without electricity
Either NAND alone or NOR alone can be used to build any other gate — AND, OR, NOT and so on.
An XOR gate gives output 1 when:
The inputs are different
The inputs are the same
Both inputs are 1
Both inputs are 0
XOR (exclusive OR) is TRUE only when the inputs differ.
What is the output of an XOR gate when both inputs are 1?
1
Undefined
0
2
XOR excludes the 'both true' case, so 1 ⊕ 1 = 0 — unlike OR, which gives 1.
An XNOR gate gives output 1 when:
The inputs are different
Both inputs are 1 only
Exactly one input is 1
The inputs are the same
XNOR is TRUE when the inputs are the same (both 0 or both 1) — the complement of XOR.
The expression Y = AB' + A'B produces the truth table of which gate?
XNOR
XOR
AND
NOR
Y is 1 only when A and B differ (0,1 or 1,0), which is exactly the XOR truth table.
When drawing a logic circuit from a Boolean expression, in what order are the operators applied?
NOT first, then AND, then OR
Left to right only
OR, then AND, then NOT
AND, then OR, then NOT
Operator precedence is NOT first, then AND, then OR (like BODMAS in maths).
Which gates are needed to draw the circuit for Y = (A + B)·C'?
An XOR gate and a NOT gate
Two AND gates only
An OR gate, a NOT gate and an AND gate
A NAND gate only
Use an OR gate for A + B, a NOT gate for C', and an AND gate to combine the two.
For Y = (A + B)·C', what is Y when A=0, B=1, C=0?
0
Undefined
2
1
A + B = 1 and C' = 1, so Y = 1 · 1 = 1.
In the circuit for Y = A·B + C, the output of the AND gate goes into:
A NOT gate
An OR gate together with C
Another AND gate with C
The Y output directly
A and B feed an AND gate; its output and C then feed an OR gate, whose output is Y.