Ripple Carry and Carry Lookahead Adders: 1 Objectives
Ripple Carry and Carry Lookahead Adders: 1 Objectives
Ripple Carry and Carry Lookahead Adders: 1 Objectives
1 Objectives
Understand the operation of ripple carry and carry lookahead (CLA) adders/subtractors.
Write hierarchical VHDL code for each type of adder/subtractor. Use hierarchical design techniques to implement the adders/subtractors. Synthesize the code in FPGA using the ISE tools. Study the synthesis performance parameters (delay, FPGA resources, power consumption, equivalent gate count).
2 Introduction
We will start by explaining the operation of one-bit full adder which will be the basis for constructing ripple carry and carry lookahead adders/subtractors.
cin
Full Adder
cout
s
Figure 1: One-bit full adder.
A one-bit full adder is a combinational circuit that forms the arithmetic sum of three bits. It consists of three inputs and and two outputs and as illustrated in Figure 1. The truth table of the full adder is listed in Table 1.
c4
Full Adder
c3
s3
It is a simple matter to develop a more versatile 2s complement adder/subtractor based on the adder in Fig. 2. References [1, 2] illustrate how an adder/subtractor can be obtained from the simple adder circuit.
a0
b0
Full Adder
c2
Full Adder
c1
Full Adder
c0
s2
s1
s0
ai bi
Pi si Gi ci+1
ci
where
and are called the carry generate and carry propagate terms, respectively. Notice that the generate and propagate terms only depend on the input bits and thus will be valid after one and two gate delay, respectively. If one uses the above expression to calculate the carry signals, one does not need to wait for the carry to ripple through all the previous stages to nd its proper value. Lets apply this to a -bit adder to make it clear.
% &$
Putting
1 6F60A8
1 6258EA8
!
1 8580A
and
shown.
The above two equations can be written in terms of two new signals in Figure 3:
460A8 1
1 62580A7B460A 1
"
8257
7$96 1
625
4
1 @9
32 1
D( C
) (
' (
(3) (4)
a3
b3
a2
b2
a1
b1
a0
b0
G3 c4
P3
G2
P2
G1
P1
G0
P0 c0
c3 P3 P2
c2 P1
c1 P0
c0
s3
s2
s1
s0
The disadvantage of CLA is that the carry logic block gets very complicated for more than -bits. For that reason, CLAs are usually implemented as 4-bit modules and are used in a hierarchical structure to realize adders that have multiples of -bits. It is a simple matter to develop a more versatile 2s complement adder/subtractor based on the adder in Fig. 4.
# #
3 Lab Preparation
You must read and follow the instructions in the ISE tutorial provided in the Appendix of the lab manual. The tutorial is also available in the lab webpage for this course. This tutorial must be attempted before start of regular labs.
4 Pre-Lab Report
For your prelab report, you are required to do the following.
Figure 4 shows that a 4-bit CLA is built using gates to generate the block to generate the carry out signals according to Equations 811.
and
full adder whose truth table is described in Table 1. 2. Draw icons for the 1-bit full adder and the 4-bit ripple carry adder. Provide also the signal denition tables for both components. 3. Use Figure 2 to illustrate how a carry-ripple adder can be converted into a 2s complement, 4-bit adder/subtractor. 4. Using a 4-bit CLA adder as a building block, draw a block diagram to show how to construct a 16-bit CLA adder. 5. Explain why it is not recommended to design an 8- or 16-bit CLA using equations similar to (8) to (11). 6. Use Figure 4 to illustrate how a carry lookahead adder can be converted into a 2s complement, 4-bit adder/subtractor.
5 Project Requirements
In this project you are required to model, simulate, and implement a ripple carry adder/subtractor and a carry lookahead adder/subtractor.
6 Lab Report
Your lab report should include the following.
3. Compare the delay you obtain from the synthesis results with the delay of the simulations and comment on your results. 4. Compare the area of the ripple carry adder with the area of the CLA based on the synthesis results you obtained and comment on the results. 5. Compare the actual delay of the ripple carry adder with the actual delay of the CLA.
7 References
1. R. H. Katz and G. Borriello, Contemporary Logic Design, Prentice Hall, 2005. 2. M. M. Mano and C. R. Kime, Logic and Computer Design Fundamentals, Pearson/Prentice Hall, Upper Saddle River, NJ, 2004.