A-level Computer Science revision · Boolean algebra and logic

Adders and D-type flip-flops

The idea

A half adder adds two bits, giving a sum (A XOR B) and a carry (A AND B). A full adder also adds a carry-in, so full adders can be chained to add multi-bit numbers. A D-type flip-flop stores one bit: on the rising edge of the clock it copies D to its output Q, which holds until the next clock edge.

  1. Half adder: Sum = A ⊻ B, Carry = A ∧ B.
  2. Full adder: three inputs, chain carries.
  3. D-type: output changes only on the clock edge.

Watch out A half adder cannot take a carry-in, so it cannot be chained alone.

See it worked

Worked example

What are the sum and carry of a half adder when A = 1 and B = 1?

  1. Sum = 1 XOR 1 = 0.
  2. Carry = 1 AND 1 = 1.

Answer Sum 0, carry 1

Your turn

Question 11 mark

A full adder has inputs A = 1, B = 0, Carry-in = 1. What is the output?

Choose one
Question 21 mark

When does a D-type flip-flop update its output?

Choose one
Question 32 marks

Explain why D-type flip-flops are used in registers.

Write your answer, then see a model answer
  1. Name the storage property.
  2. Link to registers.

Answer Each flip-flop stores one bit until the next clock edge, so a group of them can hold a binary value such as a register's contents.

A-level Computer Science Pro, OCR H446

A-level Computer Science Pro

£119 once

Price rises to £199 on 1 January. Save £80 by joining before then.

At least 12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right.

No VAT is charged.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms