Skip to content

9618 · Unit 17 · Paper 3: Advanced theory

Boolean algebra and sequential logic.

9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Half adders

§15.2 · Logic circuits and Boolean algebra

Add 1 and 1 in binary and the answer already needs two digits, 10. An event counter starts there: two event channels each supply one bit, A and B, and a half adder adds them. Its outputs are S (sum) and K (carry).

Follow each input row through both gates: the XOR gate gives S and the AND gate gives K. In the table, the coloured 1s are the rows where each output is on.

ABSK
ABSK
0000
0110
1010
1101
S = A XOR B    K = A AND B

Read the outputs as a two-bit total

1 + 1 needs two binary digits. For A = B = 1, the total is 2 = 10₂: K = 1 and S = 0. Read the two outputs as KS, not SK.

1
From the circuit: evaluate the XOR and the AND separately for each input row.
2
From the table: S is 1 only when the inputs differ (XOR, blue). K is 1 only when both inputs are 1 (AND, violet).
A half adder has no carry-in. It cannot by itself add a carry from the previous binary column.
Your turn

1 A = 1 and B = 0. Give S and K.

2 Which input row gives K = 1? Why is S 0 in that row?

3 Why can a half adder not add a carry from the column before?

  1. 1
    S = 1, K = 0: 1 + 0 = 1
  2. 2
    A = 1, B = 1: 1 + 1 = 2 = 10₂, so the 1 goes to K and S = 0
  3. 3
    it has only two inputs, A and B: there is no carry-in input
Tick what you can do now
Practise with s22/32 Q6(a), (b)(i), (b)(ii) (older paper)
1 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Full adders

§15.2 · Logic circuits and Boolean algebra

Longer numbers need carrying, as in column addition. A full adder accepts A, B and a carry-in C from the lower binary column. Two half adders and an OR gate produce its sum and carry-out.

Follow A and B into the first half adder, then its P on into the second with C; both carries meet at the OR gate. The table records P, K1 and K2 on the way to S and K.

Half adderA + BHalf adderP + CABPCSK1K2KS = P XOR C; K = K1 OR K2
ABCPK1K2SK
00000000
00100010
01010010
01110101
10010010
10110101
11001001
11101011

Use the intermediate outputs to check each row

  1. 1
    First half adder: P = A XOR B and K1 = A AND B.
  2. 2
    Second half adder: S = P XOR C and K2 = P AND C.
  3. 3
    Carry-out: K = K1 OR K2. On every row, A + B + C = 2K + S.

With A = B = C = 1: P = 0, K1 = 1, K2 = 0, so KS = 11₂ = 3. In a multi-bit adder, each carry-out feeds the next higher column’s carry-in.

Write S as a sum-of-products

One AND term for each row where S = 1, written in that row’s colour. Then join the terms with OR.

A sum-of-products uses one AND term for each output-1 row. For the sum, rows 001, 010, 100 and 111 give:

S =row 001(NOT A)(NOT B)C+row 010(NOT A)B(NOT C)+row 100A(NOT B)(NOT C)+row 111ABC
Simplified carry: K = AB + AC + BC. It is 1 whenever at least two inputs are 1.
Your turn

1 A = 1, B = 0, C = 1. Find P, K1, K2, S and K.

2 Write the sum-of-products term for the row A = 0, B = 1, C = 0.

3 In row 011, which carry, K1 or K2, makes K = 1?

  1. 1
    P = 1, K1 = 0, K2 = 1, S = 0, K = 1: 1 + 0 + 1 = 2 = 10₂
  2. 2
    (NOT A)B(NOT C)
  3. 3
    K2: P = 1 and C = 1, so K2 = 1 (K1 = 0)
Tick what you can do now
Practise with s21/31 Q7(a), (b), (c) (older paper)
2 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Combinational and sequential logic

§15.2 · Logic circuits and Boolean algebra

An adder forgets an event the moment its input pulse ends, but a counter must remember it. A combinational circuit calculates from its current inputs. A sequential circuit also depends on its previous state. The event counter needs both.

Two parts of the counter, one question for each: does the same input always give the same result?

Part of the counterWhat determines its result?Same input, same result?
AdderCurrent A, B and carry-in.Yes, after signals settle.
Stored count bit QCurrent controls and the bit already stored.No: a hold control preserves either 0 or 1.

What happens when the pulse ends

Read each line in time order: before, event on, event off. The adder output follows the pulse; the stored Q keeps it.

beforeevent onevent offSet control010Adder output010Stored Q011
TimeSet controlQ beforeQ after
Before event000
Event asserted101
Event removed011

The adder’s output changes back when its input pulse disappears. Storage keeps a bit showing that the event occurred. Later controls can reset or change it.

How feedback keeps a stored bit

  1. 1
    Part of the output feeds back into the storage circuit’s input.
  2. 2
    When the controls request hold, the feedback keeps the existing stable state.
  3. 3
    A flip-flop stores one binary digit.
A clocked sequential circuit updates at a specified clock event. An unclocked SR latch responds while its set/reset controls are asserted; it does not need a clock edge.
Your turn

1 Is a half adder combinational or sequential? Give the reason.

2 After the events in the diagram, the reset control is set to 1 for one step. What is Q now?

3 What part of a storage circuit lets it keep a bit after the input pulse has gone?

  1. 1
    combinational: its outputs depend only on the current A and B
  2. 2
    0: reset makes the stored bit 0
  3. 3
    feedback: part of the output is fed back to the input
Tick what you can do now
Practise with w22/32 Q8(b) (older paper: storing one bit)
3 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

SR latches

§15.2 · Logic circuits and Boolean algebra

The simplest memory is two gates that feed each other. This SR latch uses two cross-coupled NOR gates. Its controls are active high: S = 1 sets Q, and R = 1 resets Q.

Each NOR output feeds back into the other gate: that loop holds Q. The table gives what each pair of S and R does to it.

RSQQ̅Feedback retains Q after S returns to 0.
SRNext QOperation
00Previous QHold
101Set
010Reset
11InvalidBoth outputs forced to 0

Set, then hold: follow the feedback

1
Set: S = 1 forces the lower NOR output Q̅ to 0. With R = 0, the upper gate makes Q = 1.
2
Hold: return S to 0. Q feeds the lower gate, so Q̅ stays 0 and Q stays 1.

Follow the latch through time

One row for each moment. Read S and R, then use the table above to find Q after.

SRQ beforeQ afterWhat happens
t11001S = 1: set, Q becomes 1
S = 1: set, Q becomes 1
t20011S = R = 0: hold; feedback keeps Q = 1
S = R = 0: hold; feedback keeps Q = 1
t30110R = 1: reset, Q becomes 0
R = 1: reset, Q becomes 0
t40000S = R = 0: hold; feedback keeps Q = 0
S = R = 0: hold; feedback keeps Q = 0
t51001S = 1: set, Q becomes 1
S = 1: set, Q becomes 1
  • With S = R = 1, Q and Q̅ are both 0: they are no longer complements.
  • Releasing both controls together can leave the stored state unpredictable. Avoid this combination.
NAND convention differs. A NAND SR latch has active-low S̅ and R̅: 11 holds, 01 sets, 10 resets, 00 is invalid (both outputs 1). Never apply the NOR table to it.
Your turn

1 Q = 1. Then S = 0 and R = 1. What is Q after?

2 Q = 0 and S = R = 0. What happens to Q?

3 Why is S = R = 1 not used on a NOR SR latch?

  1. 1
    0: reset
  2. 2
    it holds: Q stays 0
  3. 3
    Q and Q̅ are both 0, so they are not complements, and releasing both together can leave an unpredictable state
Tick what you can do now
Practise with w22/32 Q8(a), (b) (older paper)
4 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

JK flip-flops

§15.2 · Logic circuits and Boolean algebra

A counter needs a bit that changes only when the clock ticks, and can flip on its own. This JK flip-flop updates on the rising clock edge (0 → 1); between rising edges, Q holds its state. J and K are read together with previous Q.

JKNext Q at rising edge
00Previous Q: hold
010: reset
101: set
11NOT previous Q: toggle
JKJKCLKQQ̅Triangle: rising-edge clock

Toggle means a change at each active edge

With J = K = 1, Q changes at every rising edge (↑) and holds in between.

↑↑↑↑CLK01010101Q01100110

The same rules, one clock event at a time. Read J and K only at a rising edge; every other event leaves Q alone.

JKQ beforeQ afterWhat decided it
0 → 11101rising edge, J = 1, K = 1: toggle
rising edge, J = 1, K = 1: toggle
stays 11111no edge: Q holds
no edge: Q holds
1 → 01111falling edge is not active: Q holds
falling edge is not active: Q holds
0 → 11110rising edge, J = 1, K = 1: toggle
rising edge, J = 1, K = 1: toggle
0 → 11001rising edge, J = 1, K = 0: set
rising edge, J = 1, K = 0: set
0 → 10011rising edge, J = 0, K = 0: hold
rising edge, J = 0, K = 0: hold
0 → 10110rising edge, J = 0, K = 1: reset
rising edge, J = 0, K = 1: reset
Clock eventJKQ beforeQ after
0 → 11101
Stays 11111
1 → 01111
0 → 11110
0 → 11001
0 → 10011
0 → 10110

Use a JK flip-flop as a counter bit

When each event makes one rising edge, setting J = K = 1 makes Q alternate 0, 1, 0, 1. JK replaces SR’s problem with both controls asserted by a defined toggle operation.

Read the stated active edge. A falling-edge device updates on 1 → 0 instead. Without the old Q and the clock event, J = K = 1 does not determine a single output value.
Your turn

1 Q = 0 and J = K = 1. Give Q after each of three rising edges.

2 Q = 1, J = 0 and K = 1. What is Q after the next rising edge?

3 Q = 0, J = 1 and K = 0, but the clock only falls from 1 to 0. What is Q after?

  1. 1
    1, 0, 1: it toggles each time
  2. 2
    0: reset
  3. 3
    0: a falling edge is not the active edge, so Q holds
Tick what you can do now
5 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Boolean laws and De Morgan

§15.2 · Logic circuits and Boolean algebra

A circuit with fewer gates is cheaper and faster, and Boolean algebra finds it on paper. Boolean algebra uses + for OR, · for AND, and NOT for complement. These are logic operations on 0 and 1, not ordinary addition.

Each identity is true for every value of A, B and C. Name the law you use at each step of a simplification.

LawIdentity
Identity / annulmentA + 0 = A; A · 1 = A; A + 1 = 1; A · 0 = 0
Idempotence / complementA + A = A; A · A = A; A + NOT A = 1; A · NOT A = 0
Double negationNOT(NOT A) = A
Commutative / associativeA + B = B + A; (A + B) + C = A + (B + C), also for AND
DistributiveA(B + C) = AB + AC; A + BC = (A + B)(A + C)
AbsorptionA + AB = A; A(A + B) = A

Apply De Morgan’s laws

A NOT around a whole bracket is hard to simplify until De Morgan’s laws move it inside.

NOT(A · B) = NOT A + NOT B
NOT(A + B) = NOT A · NOT B

The gates draw the first law: a NAND gives the same output as two NOTs feeding an OR.

ABNOT(A · B)=ABNOT A + NOT B
NOT(NOT(A · B) + NOT C)Start with a NOT around the whole OR.= NOT(NOT(A · B)) · NOT(NOT C)De Morgan: OR becomes AND.= A · B · CDouble negation removes each pair of NOTs.

Reverse the same laws to build an equivalent circuit: A · B · C = NOT(NOT(A · B) + NOT C). Brackets show how far each NOT extends.

Factoring works the same way: take out the shared A, and two laws finish the job.

AB + A(NOT B) = A(B + NOT B)Distribute in reverse: factor A.= A · 1 = AComplement, then identity.

A truth table proves a law on every row: the two output columns for De Morgan match.

ABNOT(A · B)NOT A + NOT B
0011
0111
1011
1100
Your turn

1 Simplify A + A · B. Name the law.

2 Use De Morgan to write NOT(A + B) with no NOT around a bracket.

3 Simplify NOT(NOT A · NOT B).

  1. 1
    A: absorption
  2. 2
    NOT A · NOT B
  3. 3
    A + B: De Morgan gives NOT(NOT A) + NOT(NOT B), then double negation
Tick what you can do now
Practise with s26/32 Q7(b); s26/33 Q6(b)
6 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Truth table, expression and circuit

§15.2 · Logic circuits and Boolean algebra

The same logic can be given as a circuit, an expression or a truth table, and you need to move between all three. Watch the brackets: a NOT outside brackets inverts the complete bracket result. This circuit uses a three-input AND.

ABCXPNR
X = NOT((A · B · C) + NOT A)

Circuit to expression, and back

  1. 1
    Circuit → expression: start at X. Its NOT follows R = P OR N. Substitute P = A AND B AND C and N = NOT A, keeping the brackets.
  2. 2
    Expression → circuit: build the inner AND and NOT, join them with OR, then invert its output.

Table → expression: one term for each row where X = 1

ABCPNRX
0000110
0010110
0100110
0110110
1000001
1010001
1100001
1111010
  1. 1
    Find the rows where X = 1.
  2. 2
    AND that row’s inputs. Write NOT for an input that is 0.
  3. 3
    Join the terms with OR.
X =row 100A(NOT B)(NOT C)+row 101A(NOT B)C+row 110AB(NOT C)

Preserve the operators of a given expression unless asked to simplify.

Your turn

1 A = 0, B = 1, C = 1. Find P, N, R and X.

2 Write the term for the row A = 1, B = 0, C = 1.

3 Why is X = 0 in row 111?

  1. 1
    P = 0, N = 1, R = 1, X = 0
  2. 2
    A(NOT B)C
  3. 3
    P = A AND B AND C = 1, so R = 1 and the final NOT gives X = 0
Tick what you can do now
Practise with s26/31 Q6(a); s21/31 Q7(c) (older paper: sum-of-products)
7 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Karnaugh-map layout

§15.2 · Logic circuits and Boolean algebra

With four inputs, A to D, the counter’s enable decision X has a 16-row truth table, and a pattern is hard to spot in a list that long. A Karnaugh map lays the same 16 outputs out as a grid in which neighbouring cells differ in one input only, so a pattern becomes a shape you can see.

AB ↓CD →000001011111101010010000001110111234Read the labels, not the cell’s visual order.

Gray order is 00, 01, 11, 10

AB labels the rows; CD labels the columns. Write every output, including 0. The labels change one bit at a time: ordinary binary order 00, 01, 10, 11 would break that rule.

Each numbered row below is the numbered cell on the map.

Truth-table inputs ABCDMap addressX
10010AB = 00, CD = 10: top right1
21111AB = 11, CD = 11: third row, third column1
30110AB = 01, CD = 10: second row, last column0
41000AB = 10, CD = 00: bottom left1

For the reverse direction, read a cell’s row and column labels together to recover ABCD, then put its X in the matching binary-order truth-table row.

The left/right edges are adjacent, as are the top/bottom edges. 00 and 10 differ by one bit. Diagonally touching cells are not adjacent.
Your turn

1 Where on the map does the input 1001 go? What is its X?

2 Which input ABCD is in the second row, second column? What is its X?

3 Name the two cells that are next to the top-left cell across the edges of the map.

  1. 1
    AB = 10, CD = 01: bottom row, second column; X = 0
  2. 2
    0101; X = 0
  3. 3
    top right (AB = 00, CD = 10) and bottom left (AB = 10, CD = 00)
Tick what you can do now
Practise with s26/32 Q7(a)(i)
8 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Grouping and simplification

§15.2 · Logic circuits and Boolean algebra

Loop neighbouring 1s: any input that changes inside a loop drops out. Group adjacent 1s into rectangles of 1, 2, 4, 8 or 16 cells; choose the largest useful groups, cover every 1, and never include a 0.

Group the 1s into two loops: the blue one wraps round both edges of the map to join the four corners; the violet one is a square of four.

AB ↓CD →00000101111110101001000000111011Blue: B = 0, D = 0Violet: A = 1, C = 1

Write the term for each group

In each loop, find the inputs that are the same in every cell: they make the term.

GroupKeep fixed inputs; drop changing inputs
Blue: four corners, joined across both edgesB = 0 and D = 0 → (NOT B)(NOT D). Drop A and C, which vary.
Violet: lower-right square of fourA = 1 and C = 1 → AC. Drop B and D, which vary.
X =blue loop(NOT B)(NOT D)+violet loopAC
  • The bottom-right cell is in both groups: overlap is allowed.
  • Each four-cell group removes two changing inputs.
  • The two groups cover all seven 1s. The shared cell still gives one output 1.

Join the terms into a sum-of-products

  • Write each loop’s product term, then join the terms with +.
  • A three-cell group, a diagonal group or a rectangle containing a 0 changes the function.
  • A smaller valid loop can leave unnecessary inputs in a term.
A K-map reveals adjacent combinations that can share a term without a long algebraic derivation. If a task asks for the loop-derived sum-of-products, give that form before any further factoring.
Your turn

1 In the violet group, which two inputs change?

2 A different map has 1s in only two cells: AB = 11 with CD = 01, and AB = 11 with CD = 11. Write the term for that pair.

3 Why must a group never contain a 0?

  1. 1
    B and D
  2. 2
    ABD: A = 1, B = 1 and D = 1 stay fixed; C changes
  3. 3
    the term would then give 1 for an input whose output is 0, so the function would change
Tick what you can do now
Practise with s26/31 Q6(b), (c)(i), (c)(ii); s26/33 Q6(a)(i), (a)(ii), (a)(iii)
9 / 10
9618 · Unit 17 · Boolean algebra and sequential logic
Revisionbyexamplicity

Checking a simplified design

§15.2 · Logic circuits and Boolean algebra

A smaller circuit is useful only if it keeps every truth-table output. Build P = (NOT B)(NOT D) and T = AC, joined by X = P OR T. Then compare all 16 input combinations with the original X.

ABCDXPT

Blue 1s come from the blue loop’s term P; violet 1s from the violet loop’s term T.

ABCDOriginal XPTNew X
00001101
00010000
00101101
00110000
01000000
01010000
01100000
01110000
ABCDOriginal XPTNew X
10001101
10010000
10101111
10111011
11000000
11010000
11101011
11111011
  1. 1
    Each row agrees: new X = original X on all 16 rows.
  2. 2
    Row 1010 makes both terms 1, but X is still a single 1.
  3. 3
    Row 0111 makes neither term 1, so X = 0.

Connect X to the counter

The checked X now decides whether the counter counts.

  • X is a combinational decision: it can be worked out again from the current A to D.
  • Connect X to both J and K. At each rising edge, X = 0 holds Q and X = 1 toggles Q.
  • The counter bit is sequential: its next Q also needs the old Q and the active clock edge.
A single matching test is not enough. Four inputs have 2⁴ = 16 combinations; compare the complete output columns.
Your turn

1 For the input 1110, give P, T and the new X.

2 Which input makes both P and T equal to 1?

3 Why compare all 16 rows instead of testing one input?

  1. 1
    P = 0, T = 1, X = 1
  2. 2
    1010 only
  3. 3
    one matching row does not show that every other row matches; the two circuits are equal only if all 2⁴ outputs agree
Tick what you can do now
Practise with s26/31 Q6(a), (c)(ii)
10 / 10