Full Marks

A-level Computer Science Year 12 · Topic 10

Boolean algebra and logic circuits

Boolean algebra and logic circuits is about the logic that every digital device is built from.

We will use logic gates and truth tables, Boolean laws and De Morgan's laws, and Karnaugh maps to simplify expressions.

Then we build half and full adders, use D type flip-flops, and design logic circuits from a problem.

In this topic

  1. 10.1Logic gates and truth tablesFree below · 61 questions
  2. 10.2Boolean algebra laws, De Morgan's laws and expression simplificationOpen in Full Marks · 52 questions
  3. 10.3Karnaugh mapsOpen in Full Marks · 62 questions
  4. 10.4Half adders and full addersOpen in Full Marks · 59 questions
  5. 10.5D-type flip-flops and designing logic circuitsOpen in Full Marks · 56 questions

10.1 · Free notes

Logic gates and truth tables

Diagram: Logic gates and truth tables

Key points

In more detail

Practice

Logic gates and truth tables: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. What is the output of an XOR gate when both inputs are 1?

  1. 0
  2. 1
  3. Undefined
  4. Equal to the clock signal
Show answer

A: 0. XOR outputs 1 only when the inputs are different. With both inputs 1 they are the same, so the output is 0.

2. A truth table is needed for a circuit with 4 independent inputs. How many rows does it need?

  1. 32
  2. 8
  3. 16
  4. 4
Show answer

C: 16. A truth table needs 2^n rows. With n = 4 that is 2^4 = 16 rows, one for each possible input combination.

3. For which inputs does a two-input NOR gate output 1?

  1. A = 0 and B = 0
  2. A = 0 and B = 1
  3. A = 1 and B = 0
  4. A = 1 and B = 1
Show answer

A: A = 0 and B = 0. NOR is NOT OR. OR is 0 only when both inputs are 0, so NOR is 1 only for A = 0 and B = 0.

4. Which gate produces the Carry output of a half adder?

  1. XOR
  2. OR
  3. AND
  4. NAND
Show answer

C: AND. A half adder has Sum = A XOR B and Carry = A AND B. A carry is generated only when both bits are 1.

5. A half adder adds A = 1 and B = 1. What are the Sum and Carry outputs?

  1. Sum 0, Carry 1
  2. Sum 1, Carry 0
  3. Sum 1, Carry 1
  4. Sum 0, Carry 0
Show answer

A: Sum 0, Carry 1. 1 + 1 = 10 in binary. Sum = 1 XOR 1 = 0 and Carry = 1 AND 1 = 1.

6. Both inputs of a NAND gate are connected to the same signal A. What does the circuit act as?

  1. An OR gate
  2. A NOT gate
  3. An AND gate
  4. An XOR gate
Show answer

B: A NOT gate. NAND(A, A) = NOT(A AND A) = NOT A. This is why NAND is a universal gate.

7. For Q = (A XOR B) AND C, in how many of the 8 rows of the truth table is Q = 1?

  1. 3
  2. 2
  3. 1
  4. 4
Show answer

B: 2. Q = 1 needs C = 1 and A ≠ B. There are 2 such combinations of A and B, so 2 rows give Q = 1.

8. Which single gate is equivalent to a NOR gate whose inputs are NOT A and NOT B?

  1. OR
  2. NAND
  3. AND
  4. XOR
Show answer

C: AND. NOR(¬A, ¬B) = NOT(¬A OR ¬B) = A AND B by De Morgan's law, so the circuit behaves as an AND gate.

9. Which statement about gates is correct?

  1. XOR outputs 1 if both inputs are 1
  2. NAND outputs 1 unless both inputs are 1
  3. NOR outputs 1 if either input is 1
  4. OR outputs 0 if either input is 0
Show answer

B: NAND outputs 1 unless both inputs are 1. NAND is NOT AND, so it is 0 only when both inputs are 1. The other statements describe AND/OR/NOR behaviour incorrectly.

10. A circuit has 3 inputs. How many different input combinations must a complete truth table show?

  1. 6
  2. 8
  3. 3
  4. 9
Show answer

B: 8. Each input can be 0 or 1, so there are 2 × 2 × 2 = 2^3 = 8 combinations.

Keep going in Full Marks

Full Marks has 61 questions on Logic gates and truth tables (51 more than here), set out in practice levels. You also get notes and 3D models for all 5 subtopics of Boolean algebra and logic circuits, plus games, timed exams and past papers.

On your exam board

All A-level Computer Science Year 12 topics