Book 6 · Chapter 10
Boolean logic
B6·10This chapter is in the ebook.
Read it in full on cswithzak.com. Every question has its mark scheme and every program is ready to run. The free practice for each section is below, with the short code the book prints beside it.
For the whole chapter
- Topic pageBoolean Logic
B6·10·T - QuizBoolean Logic
B6·10·Q1 - LabLogic Gates Lab
B6·10·X1 - LabCircuit → truth table practice
B6·10·X2
§10
Short code B6·10·1
- FlashcardsFlashcards §10: Logic gates
B6·10·F1 - FlashcardsFlashcards §10: Circuits, truth tables & expressions
B6·10·F2 - Past-paper questionsPast-paper questions §10
Two states: 1 and 0
Short code B6·10·10
Practice for this page of the book: the quiz, flashcards and past-paper questions for its section are listed above.
NOT, AND and OR
Short code B6·10·11
Output
Expression: X = A AND B (Cambridge notation: X = A.B) 2 inputs → 4 rows, counting up in binary from 00. A | B | X --+---+-- 0 | 0 | 0 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1 X = 1 on row 11. Sum-of-products from the 1 rows: X = A.B
Output
Expression: X = A OR B (Cambridge notation: X = A + B) 2 inputs → 4 rows, counting up in binary from 00. A | B | X --+---+-- 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1 X = 1 on rows 01, 10, 11. Sum-of-products from the 1 rows: X = A̅.B + A.B̅ + A.B
Output
Expression: X = NOT A (Cambridge notation: X = A̅) 1 input → 2 rows, counting up in binary from 0. A | X --+-- 0 | 1 1 | 0 X = 1 on row 0. Sum-of-products from the 1 rows: X = A̅
NAND, NOR and XOR
Short code B6·10·12
Output
Expression: X = A NAND B (Cambridge notation: X = A NAND B) 2 inputs → 4 rows, counting up in binary from 00. A | B | X --+---+-- 0 | 0 | 1 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0 X = 1 on rows 00, 01, 10. Sum-of-products from the 1 rows: X = A̅.B̅ + A̅.B + A.B̅
Output
Expression: X = A NOR B (Cambridge notation: X = A NOR B) 2 inputs → 4 rows, counting up in binary from 00. A | B | X --+---+-- 0 | 0 | 1 0 | 1 | 0 1 | 0 | 0 1 | 1 | 0 X = 1 on row 00. Sum-of-products from the 1 rows: X = A̅.B̅
Output
Expression: X = A XOR B (Cambridge notation: X = A ⊕ B) 2 inputs → 4 rows, counting up in binary from 00. A | B | X --+---+-- 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0 X = 1 on rows 01, 10. Sum-of-products from the 1 rows: X = A̅.B + A.B̅
The six gates side by side
Short code B6·10·13
Output
Expression: X = (A XOR B) NOR C (Cambridge notation: X = A ⊕ B NOR C) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | A XOR B | X --+---+---+---------+-- 0 | 0 | 0 | 0 | 1 0 | 0 | 1 | 0 | 0 0 | 1 | 0 | 1 | 0 0 | 1 | 1 | 1 | 0 1 | 0 | 0 | 1 | 0 1 | 0 | 1 | 1 | 0 1 | 1 | 0 | 0 | 1 1 | 1 | 1 | 0 | 0 X = 1 on rows 000, 110. Sum-of-products from the 1 rows: X = A̅.B̅.C̅ + A.B.C̅
Logic expressions
Short code B6·10·14
Output
Expression: X = B OR NOT C (Cambridge notation: X = B + C̅) 2 inputs → 4 rows, counting up in binary from 00. B | C | NOT C | X --+---+-------+-- 0 | 0 | 1 | 1 0 | 1 | 0 | 0 1 | 0 | 1 | 1 1 | 1 | 0 | 1 X = 1 on rows 00, 10, 11. Sum-of-products from the 1 rows: X = B̅.C̅ + B.C̅ + B.C
Output
Expression: X = NOT (B OR C) (Cambridge notation: X = B̅ ̅+̅ ̅C̅) 2 inputs → 4 rows, counting up in binary from 00. B | C | B OR C | X --+---+--------+-- 0 | 0 | 0 | 1 0 | 1 | 1 | 0 1 | 0 | 1 | 0 1 | 1 | 1 | 0 X = 1 on row 00. Sum-of-products from the 1 rows: X = B̅.C̅
From an expression to a circuit
Short code B6·10·15
Output
Expression: X = (A NOR B) AND (B XOR C) (Cambridge notation: X = (A NOR B).(B ⊕ C)) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | A NOR B | B XOR C | X --+---+---+---------+---------+-- 0 | 0 | 0 | 1 | 0 | 0 0 | 0 | 1 | 1 | 1 | 1 0 | 1 | 0 | 0 | 1 | 0 0 | 1 | 1 | 0 | 0 | 0 1 | 0 | 0 | 0 | 0 | 0 1 | 0 | 1 | 0 | 1 | 0 1 | 1 | 0 | 0 | 1 | 0 1 | 1 | 1 | 0 | 0 | 0 X = 1 on row 001. Sum-of-products from the 1 rows: X = A̅.B̅.C
Output
Expression: X = (A OR NOT C) NAND B (Cambridge notation: X = (A + C̅) NAND B) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | NOT C | A OR NOT C | X --+---+---+-------+------------+-- 0 | 0 | 0 | 1 | 1 | 1 0 | 0 | 1 | 0 | 0 | 1 0 | 1 | 0 | 1 | 1 | 0 0 | 1 | 1 | 0 | 0 | 1 1 | 0 | 0 | 1 | 1 | 1 1 | 0 | 1 | 0 | 1 | 1 1 | 1 | 0 | 1 | 1 | 0 1 | 1 | 1 | 0 | 1 | 0 X = 1 on rows 000, 001, 011, 100, 101. Sum-of-products from the 1 rows: X = A̅.B̅.C̅ + A̅.B̅.C + A̅.B.C + A.B̅.C̅ + A.B̅.C
Completing a truth table
Short code B6·10·16
Output
Expression: X = (A AND B) OR NOT C (Cambridge notation: X = A.B + C̅) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | A AND B | NOT C | X --+---+---+---------+-------+-- 0 | 0 | 0 | 0 | 1 | 1 0 | 0 | 1 | 0 | 0 | 0 0 | 1 | 0 | 0 | 1 | 1 0 | 1 | 1 | 0 | 0 | 0 1 | 0 | 0 | 0 | 1 | 1 1 | 0 | 1 | 0 | 0 | 0 1 | 1 | 0 | 1 | 1 | 1 1 | 1 | 1 | 1 | 0 | 1 X = 1 on rows 000, 010, 100, 110, 111. Sum-of-products from the 1 rows: X = A̅.B̅.C̅ + A̅.B.C̅ + A.B̅.C̅ + A.B.C̅ + A.B.C
Output
Expression: X = (A XOR B) AND NOT C (Cambridge notation: X = (A ⊕ B).C̅) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | A XOR B | NOT C | X --+---+---+---------+-------+-- 0 | 0 | 0 | 0 | 1 | 0 0 | 0 | 1 | 0 | 0 | 0 0 | 1 | 0 | 1 | 1 | 1 0 | 1 | 1 | 1 | 0 | 0 1 | 0 | 0 | 1 | 1 | 1 1 | 0 | 1 | 1 | 0 | 0 1 | 1 | 0 | 0 | 1 | 0 1 | 1 | 1 | 0 | 0 | 0 X = 1 on rows 010, 100. Sum-of-products from the 1 rows: X = A̅.B.C̅ + A.B̅.C̅
Output
Expression: X = (A OR B) NAND C (Cambridge notation: X = (A + B) NAND C) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | A OR B | X --+---+---+--------+-- 0 | 0 | 0 | 0 | 1 0 | 0 | 1 | 0 | 1 0 | 1 | 0 | 1 | 1 0 | 1 | 1 | 1 | 0 1 | 0 | 0 | 1 | 1 1 | 0 | 1 | 1 | 0 1 | 1 | 0 | 1 | 1 1 | 1 | 1 | 1 | 0 X = 1 on rows 000, 001, 010, 100, 110. Sum-of-products from the 1 rows: X = A̅.B̅.C̅ + A̅.B̅.C + A̅.B.C̅ + A.B̅.C̅ + A.B.C̅
From a circuit to an expression and a truth table
Short code B6·10·17
Output
Expression: X = (NOT A OR B) XOR (B NAND C) (Cambridge notation: X = (A̅ + B) ⊕ B NAND C) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | NOT A | NOT A OR B | B NAND C | X --+---+---+-------+------------+----------+-- 0 | 0 | 0 | 1 | 1 | 1 | 0 0 | 0 | 1 | 1 | 1 | 1 | 0 0 | 1 | 0 | 1 | 1 | 1 | 0 0 | 1 | 1 | 1 | 1 | 0 | 1 1 | 0 | 0 | 0 | 0 | 1 | 1 1 | 0 | 1 | 0 | 0 | 1 | 1 1 | 1 | 0 | 0 | 1 | 1 | 0 1 | 1 | 1 | 0 | 1 | 0 | 1 X = 1 on rows 011, 100, 101, 111. Sum-of-products from the 1 rows: X = A̅.B.C + A.B̅.C̅ + A.B̅.C + A.B.C
From a problem statement
Short code B6·10·18
Output
Expression: X = (D AND NOT E) OR M (Cambridge notation: X = D.E̅ + M) 3 inputs → 8 rows, counting up in binary from 000. D | E | M | NOT E | D AND NOT E | X --+---+---+-------+-------------+-- 0 | 0 | 0 | 1 | 0 | 0 0 | 0 | 1 | 1 | 0 | 1 0 | 1 | 0 | 0 | 0 | 0 0 | 1 | 1 | 0 | 0 | 1 1 | 0 | 0 | 1 | 1 | 1 1 | 0 | 1 | 1 | 1 | 1 1 | 1 | 0 | 0 | 0 | 0 1 | 1 | 1 | 0 | 0 | 1 X = 1 on rows 001, 011, 100, 101, 111. Sum-of-products from the 1 rows: X = D̅.E̅.M + D̅.E.M + D.E̅.M̅ + D.E̅.M + D.E.M
Output
Expression: X = D AND (M XOR S) (Cambridge notation: X = D.(M ⊕ S)) 3 inputs → 8 rows, counting up in binary from 000. D | M | S | M XOR S | X --+---+---+---------+-- 0 | 0 | 0 | 0 | 0 0 | 0 | 1 | 1 | 0 0 | 1 | 0 | 1 | 0 0 | 1 | 1 | 0 | 0 1 | 0 | 0 | 0 | 0 1 | 0 | 1 | 1 | 1 1 | 1 | 0 | 1 | 1 1 | 1 | 1 | 0 | 0 X = 1 on rows 101, 110. Sum-of-products from the 1 rows: X = D.M̅.S + D.M.S̅
From a truth table to an expression or a circuit
Short code B6·10·19
Output
Expression: X = (NOT A AND B) OR (A AND NOT B) (Cambridge notation: X = A̅.B + A.B̅) 2 inputs → 4 rows, counting up in binary from 00. A | B | NOT A | NOT A AND B | NOT B | A AND NOT B | X --+---+-------+-------------+-------+-------------+-- 0 | 0 | 1 | 0 | 1 | 0 | 0 0 | 1 | 1 | 1 | 0 | 0 | 1 1 | 0 | 0 | 0 | 1 | 1 | 1 1 | 1 | 0 | 0 | 0 | 0 | 0 X = 1 on rows 01, 10. Sum-of-products from the 1 rows: X = A̅.B + A.B̅
Output
Expression: X = (NOT A AND NOT B AND C) OR (NOT A AND B AND C) (Cambridge notation: X = A̅.B̅.C + A̅.B.C) 3 inputs → 8 rows, counting up in binary from 000. A | B | C | NOT A | NOT B | NOT A AND NOT B AND C | NOT A AND B AND C | X --+---+---+-------+-------+-----------------------+-------------------+-- 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 X = 1 on rows 001, 011. Sum-of-products from the 1 rows: X = A̅.B̅.C + A̅.B.C
Output
Expression: X = NOT A AND C (Cambridge notation: X = A̅.C) 2 inputs → 4 rows, counting up in binary from 00. A | C | NOT A | X --+---+-------+-- 0 | 0 | 1 | 0 0 | 1 | 1 | 1 1 | 0 | 0 | 0 1 | 1 | 0 | 0 X = 1 on row 01. Sum-of-products from the 1 rows: X = A̅.C
Logic in your programs
Short code B6·10·20
DECLARE Row : INTEGER
DECLARE A : INTEGER
DECLARE B : INTEGER
DECLARE C : INTEGER
DECLARE X : INTEGER
OUTPUT "A B C X"
FOR Row ← 0 TO 7
A ← DIV(Row, 4)
B ← MOD(DIV(Row, 2), 2)
C ← MOD(Row, 2)
IF (A = 1 AND B = 1) OR NOT (C = 1)
THEN
X ← 1
ELSE
X ← 0
ENDIF
OUTPUT A, " ", B, " ", C, " ", X
NEXT RowOutput
A B C X 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 1
Command-word coach
Short code B6·10·21
Practice for this page of the book: the quiz, flashcards and past-paper questions for its section are listed above.
Workbook: Boolean logic
Short code W6·10 · Algorithms, Programming and Logic Workbook
The write-in workbook for this chapter has drills, exam-style practice, trace tables, fix-the-mistake and mark-it-yourself pages. Its full mark schemes and an interactive version arrive here with the chapter.


