Professional Documents
Culture Documents
Appendix B Adders and D-Type Flip Flops
Appendix B Adders and D-Type Flip Flops
D-type flip-flops
A Level
Computer Science Appendix B
Paper 2
B
Objectives
• Recognise and trace the logic of the circuits of a half-
adder and a full-adder
• Construct the circuit for a half-adder
• Be familiar with the use of the edge-triggered D-type
flip-flop as a memory unit
Adders and D-type flip-flops
AQA A Level Appendix B
Half-adder
• A half-adder is a circuit that performs the addition
of two bits
• It takes an input of two bits A and B and outputs the result S
and the carry C
• Fill in the output columns:
A B S C
0 + 0 =
0 + 1 =
1 + 0 =
1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
Half-adder Answers
• A half-adder is a circuit that performs the addition
of two bits
• It takes an input of two bits A and B and outputs the result S
and the carry C
• Fill in the output columns:
A B S C
0 + 0 = 0 0
0 + 1 = 1 0
1 + 0 = 1 0
1 + 1 = 0 1
Adders and D-type flip-flops
AQA A Level Appendix B
Limitation of a half-adder
Full adders
• A full adder combines two half-adders
• It has three inputs, A, B and the carry bit Cin, and two
outputs S and Cout
Adders and D-type flip-flops
AQA A Level Appendix B
Full adders
• The second part of the circuit, shown in pale blue,
inputs the carry bit Cin, from the previous operation
• The circuit outputs S and the new carry Cout
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 =
0 + 1 + 0 =
0 + 1 + 1 =
1 + 0 + 0 =
1 + 0 + 1 =
1 + 1 + 0 =
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 =
0 + 1 + 1 =
1 + 0 + 0 =
1 + 0 + 1 =
1 + 1 + 0 =
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 = 1 0
0 + 1 + 1 =
1 + 0 + 0 =
1 + 0 + 1 =
1 + 1 + 0 =
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 = 1 0
0 + 1 + 1 = 0 1
1 + 0 + 0 =
1 + 0 + 1 =
1 + 1 + 0 =
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 = 1 0
0 + 1 + 1 = 0 1
1 + 0 + 0 = 1 0
1 + 0 + 1 =
1 + 1 + 0 =
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 = 1 0
0 + 1 + 1 = 0 1
1 + 0 + 0 = 1 0
1 + 0 + 1 = 0 1
1 + 1 + 0 =
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 = 1 0
0 + 1 + 1 = 0 1
1 + 0 + 0 = 1 0
1 + 0 + 1 = 0 1
1 + 1 + 0 = 0 1
1 + 1 + 1 =
Adders and D-type flip-flops
AQA A Level Appendix B
A B Cin S Cout
0 + 0 + 0 = 0 0
0 + 0 + 1 = 1 0
0 + 1 + 0 = 1 0
0 + 1 + 1 = 0 1
1 + 0 + 0 = 1 0
1 + 0 + 1 = 0 1
1 + 1 + 0 = 0 1
1 + 1 + 1 = 1 1
Adders and D-type flip-flops
AQA A Level Appendix B
0 A3 1 A2 1 A1 1 A0 7
+ 1 B3 1 B2 0 B1 1 B0 13
= 1S4 0 S3 1 S2 0 S1 0 S0 20
Adders and D-type flip-flops
AQA A Level Appendix B
Worksheet 4
• Try Task 1 on Worksheet 4
Adders and D-type flip-flops
AQA A Level Appendix B
The clock
• The clock is another type of sequential circuit that
changes state at regular time intervals
• A clock is needed to synchronise the change of state
of flip flop circuits
• An edge-triggered D-type flip-flop only changes on the rising
edge of the clock signal
Adders and D-type flip-flops
AQA A Level Appendix B
J K L M
Adders and D-type flip-flops
AQA A Level Appendix B
Exercise
• Draw the flip flop’s output Q on the graph
Adders and D-type flip-flops
AQA A Level Appendix B
Exercise Answer
• Draw the flip flop’s output Q on the graph
Adders and D-type flip-flops
AQA A Level Appendix B
Summary
• The D type flip flop captures the value of the input D
on the rising edge of the clock pulse
• The captured value becomes the output
• At other times, the output Q does not change
Truth table:
Clock D Q next
Rising edge 0 0
Rising edge 1 1
Non-rising
X (“Don’t care”) Q
edge
Adders and D-type flip-flops
AQA A Level Appendix B
Worksheet 4
• Now try Task 2 on the worksheet
Adders and D-type flip-flops
AQA A Level Appendix B
Copyright
This unit and all the worksheets, PowerPoint presentations, teaching guides and other associated files
distributed with it are supplied to you by PG Online Limited under licence and may be used and copied by you
only in accordance with the terms of the licence. Except as expressly permitted by the licence, no part of the
materials distributed with this unit may be used, reproduced, stored in a retrieval system, or transmitted, in any
form or by any means, electronic or otherwise, without the prior written permission of PG Online Limited.
Licence agreement
This is a legal agreement between you, the end user, and PG Online Limited. This unit and all the worksheets,
PowerPoint presentations, teaching guides and other associated files distributed with it is licensed, not sold, to
you by PG Online Limited for use under the terms of the licence.
The materials distributed with this unit may be freely copied and used by members of a single institution on a
single site only. You are not permitted to share in any way any of the materials or part of the materials with any
third party, including users on another site or individuals who are members of a separate institution. You
acknowledge that the materials must remain with you, the licencing institution, and no part of the materials may
be transferred to another institution. You also agree not to procure, authorise, encourage, facilitate or enable any
third party to reproduce these materials in whole or in part without the prior permission of PG Online Limited.