Combinational logic

AQA 7408 3.13.5.1 Combinational logic: Boolean algebra, truth tables, NOT, AND, OR, NAND, NOR and EOR gates, and constructing logic circuits from truth tables

Key idea

A logic gate takes one or more digital inputs (0 or 1) and produces a digital output. In combinational logic the output depends only on the present inputs: there is no memory. The six gates in the specification are NOT (output is the opposite of the input), AND (output 1 only if all inputs are 1), OR (1 if at least one input is 1), NAND (NOT AND), NOR (NOT OR) and EOR (exclusive OR: 1 if the inputs are different). A truth table lists the output for every combination of inputs.

Boolean algebra writes the operations as Q = A · B (AND), Q = A + B (OR) and Q = Ā (NOT), and gives rules such as A · Ā = 0, A + Ā = 1 and De Morgan's laws, which show that NAND is an OR of inverses and NOR an AND of inverses. To construct a circuit from a truth table, write the expression for the rows where the output is 1, simplify it, and then draw the gates. NAND alone (or NOR alone) can build every other gate.

The six gates in the specification.

Figure 82. The six gates in the specification.

Read it: NOT has one input and a circle on the output. AND and OR have two inputs; the circle after NAND and NOR means ‘not’. EOR has an extra curved line on the input side. Each gate is labelled with its Boolean expression.

Truth tables for all six gates.

Figure 83. Truth tables for all six gates.

Read it: Read across a row: the inputs A and B on the left and the output of each gate on the right. For A = 1, B = 0: NAND, OR, NAND and EOR give 1, and AND and NOR give 0.

Rules of Boolean algebra.

Figure 84. Rules of Boolean algebra.

Read it: Use these rules to simplify an expression before drawing the circuit. The two De Morgan laws turn a NAND or NOR gate into an OR or AND of inverted inputs.

Building and simplifying circuits

NOT, AND and OR built only from NAND gates.

Figure 85. NOT, AND and OR built only from NAND gates.

Read it: A NAND gate with its inputs joined is a NOT gate. AND is a NAND followed by a NOT. OR is two NOT gates (made from NAND) feeding a NAND, which follows from De Morgan's law.

A truth table for design.

Figure 86. A truth table for design.

Read it: Z = 1 when C = 1, or when A and B are both 1: five of the eight rows. The rows for which C = 0 give a 1 only for A = B = 1.

The circuit for Z = A · B + C.

Figure 87. The circuit for Z = A · B + C.

Read it: An AND gate combines A and B, and an OR gate adds C. Two gates are enough once the expression has been simplified.

From truth table to circuit.

Figure 88. From truth table to circuit.

Read it: Pick out the 1 rows, group them, simplify, then draw one gate for each operation in the expression.

Boolean expressions for the gates

Equation or diagram: Boolean expressions for the gates

Symbol Meaning Unit
A, B digital inputs (0 or 1) —
Q digital output (0 or 1) —
· AND (both inputs 1) —
+ OR (at least one input 1) —
overbar NOT (inverts what is under the bar) —

Worked example: a truth table to an expression

A circuit with inputs A, B and C has output Z = 1 only for the input combinations (A, B, C) = (0, 1, 1) and (1, 1, 1). Write a simplified expression for Z and name the gates needed.

  • Expression: Z = Ā · B · C + A · B · C = (Ā + A) · B · C

  • Simplify: Ā + A = 1, so Z = B · C

  • Circuit: One AND gate with inputs B and C; A is not needed.

Worked example: a NOR gate with De Morgan

Show that a NOR gate gives the same output as an AND gate whose inputs have each been inverted.

  • NOR: Q = (A + B)‾. For A = 0, B = 0 the output is 1; for every other row it is 0.

  • AND of inverses: Q = Ā · B̄. This is 1 only when Ā = 1 and B̄ = 1, that is A = 0 and B = 0.

  • Compare: The two truth tables are identical, so (A + B)‾ = Ā · B̄ (De Morgan).

Summary: combinational logic.

Figure 89. Summary: combinational logic.

Read it: The six gates, truth tables, Boolean rules, De Morgan and building from NAND.

Practice question Spec 3.13.5.1 · A logic circuit 7 marks

The diagram shows a logic circuit with inputs A, B and C and output Z. A NAND gate has inputs A and B and gives output P. A NOT gate has input C and gives output Q. An AND gate has inputs P and Q and gives output Z.

Diagram for the practice question: Spec 3.13.5.1 · A logic circuit

(a) Complete the truth table for the circuit, giving the value of Z for each of the eight combinations of A, B and C (listed in binary order from 000 to 111). [3 marks]

(b) Write a Boolean expression for Z in terms of A, B and C. [2 marks]

(c) Explain why Z = 1 when A = 0, B = 1 and C = 0. [2 marks]

Show Mark SchemeHide Mark Scheme
Part Answer Extra information (allow / ignore) Marks
(a) Z = 1, 0, 1, 0, 1, 0, 0, 0 for ABC = 000, 001, 010, 011, 100, 101, 110, 111 all eight correct 3 marks; six or seven correct 2 marks; four or five correct 1 mark 3
(b) P = (A · B)‾ (or NOT (A AND B)) 1
Z = (A · B)‾ · C̄ (or NOT(A AND B) AND NOT C) allow ecf if P is correct and the AND is used 1
(c) the NAND gate gives P = 1 because A and B are not both 1 (A = 0), and the NOT gate gives Q = 1 because C = 0 1
the AND gate has both inputs 1, so Z = 1 1

Examiner’s note

Why the marks: In (a) fill the internal columns P and Q first and then Z. In (b) give the expression in terms of the inputs A, B and C. In (c) state the output of each gate in turn.

Key words: NAND, NOT, AND, truth table, internal point P, Boolean expression.

Where marks go: (a) 3 marks as the scheme. (b) P 1, Z 1. (c) P and Q 1, Z 1.

Practice question Spec 3.13.5.1 · Designing a circuit 7 marks

A security alarm has three inputs A, B and C and an output Z that sounds the alarm. The truth table shows the required output.

Diagram for the practice question: Spec 3.13.5.1 · Designing a circuit

(a) Write a Boolean expression for Z. [2 marks]

(b) Describe a logic circuit, using only NOT, AND and OR gates, that produces this output. [3 marks]

(c) State how a NOT gate can be made from a NAND gate. [1 mark]

(d) State the output when A, B and C are all 1. [1 mark]

Show Mark SchemeHide Mark Scheme
Part Answer Extra information (allow / ignore) Marks
(a) Z = 1 when A is 1 and B is 0, or when C is 1 allow the row-by-row expression only for 1 mark 1
Z = A · B̄ + C allow A AND (NOT B) OR C 1
(b) a NOT gate on input B 1
an AND gate with inputs A and B̄ 1
an OR gate with inputs from the AND gate and C 1
(c) connect (join) the two inputs of the NAND gate together 1
(d) 1 1

Examiner’s note

Why the marks: In (a) read the 1 rows of the table and find what they have in common (A = 1 and B = 0, or C = 1). In (b) name each gate and what it is connected to.

Key words: Boolean expression, A · B̄ + C, NOT, AND, OR, NAND with joined inputs.

Where marks go: (a) rows 1, expression 1. (b) NOT 1, AND 1, OR 1. (c) 1. (d) 1.

Quick-fire

Topic Question Model answer
AND When is the output of AND 1? Only when both inputs are 1.
OR When is the output of OR 1? When at least one input is 1.
NOT What does NOT do? Inverts the input.
NAND What is NAND? NOT AND: 0 only when both inputs are 1.
NOR What is NOR? NOT OR: 1 only when both inputs are 0.
EOR When is EOR 1? When the two inputs are different.
De Morgan State De Morgan's laws. (A·B)‾ = Ā + B̄ and (A+B)‾ = Ā · B̄.
Universal Which gate can build all the others? NAND (or NOR) alone.