Question bank › A-level Computer Science › Fundamentals of computer systems

Logic gates and Boolean algebra

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core3 marks

A student is comparing three two-input logic gates.

AB$\overline{A \cdot B}$ (NAND)$\overline{A + B}$ (NOR)$A \oplus B$ (XOR)
00
01
10
11

Complete the truth table by giving the output of each gate for every combination of inputs A and B. [3]

2Standard4 marks

The diagram shows a logic circuit with inputs A, B and C and output Q.

(a) Write a Boolean expression for the output Q in terms of A, B and C. [2]

(b) State the value of Q for each of these input combinations. [2]

ABCQ
000
101
011
ABCQ
3Standard3 marks

Using the laws of Boolean algebra, simplify the expression

$$(A + B) \cdot (A + \overline{B})$$

You must show your working. [3]

Stuck on Logic gates and Boolean algebra?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Hard3 marks

Use De Morgan's laws and other Boolean identities to simplify

$$\overline{\overline{A} + B} + \overline{A + \overline{B}}$$

Name the single logic gate that is equivalent to the simplified expression. [3]

5Standard5 marks

The diagram shows a circuit with inputs A and B and outputs S and C. Gates X and Y are different types of gate.

(a) Identify gate X and gate Y. [2]

(b) Complete a truth table showing S and C for all four combinations of A and B. [2]

(c) This circuit is a half-adder. Explain why a half-adder alone is not suitable for adding the second bit of two binary numbers. [1]

ABXYSC
6Hard5 marks

The diagram shows a full-adder built from two half-adders and an OR gate. P, R and T are internal connections.

The inputs are A = 1, B = 0 and Cin = 1.

(a) State the values of P and T. [2]

(b) State the values of the outputs S and Cout. [2]

(c) Describe how full-adders can be combined to add two 4-bit binary numbers. [1]

ABCinPSRTCout
7Core3 marks

An edge-triggered D-type flip-flop has a data input D, a clock input and an output Q.

(a) State the purpose of a D-type flip-flop in a computer system. [1]

(b) Describe how the output Q of the flip-flop is affected by the D input and the clock signal. [2]

8Hard4 marks

A positive-edge-triggered D-type flip-flop starts with Q = 0. The table lists, in time order, the changes made to its inputs.

EventChangeQ after event
0Initial state: D = 0, clock = 0, Q = 0
1D changes to 1
2Clock changes from 0 to 1(a)
3D changes to 0
4Clock changes from 1 to 0
5D changes to 1
6D changes to 0
7Clock changes from 0 to 1(b)
8D changes to 1
9Clock changes from 1 to 0
10Clock changes from 0 to 1(c)

State the value of Q after: (a) event 2, (b) event 7, (c) event 10. [3]

(d) Explain why events 5 and 6 do not change Q. [1]

9Stretch5 marks

A house alarm has three inputs: A = 1 when the system is armed, D = 1 when the door is open and W = 1 when the window is open. The truth table shows when the alarm output X is 1.

ADWX
0000
0010
0100
0110
1000
1011
1101
1111

(a) Write a Boolean expression for X as a sum of products, with one product term for each row where X = 1. [2]

(b) Using Boolean identities, simplify your expression from part (a) as far as possible. You must show your working. [3]

10Hard4 marks

NAND gates are described as universal gates because any other gate can be built from them.

(a) Explain how a single NAND gate can be used as a NOT gate. [1]

(b) Use De Morgan's laws to show that $A + B = \overline{\overline{A} \cdot \overline{B}}$. [2]

(c) Hence state the minimum number of NAND gates needed to make an OR gate. [1]

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session