0% found this document useful (0 votes)
208 views8 pages

Ripple Carry and Carry Lookahead Adders: 1 Objectives

Ripple Carry and Carry Lookahead Adders are digital circuits that produce the arithmetic sum of two binary numbers. Ripple carry adders are constructed with full adders connected in cascaded (see section 2.1) the output is known after the carry generated by the previous stage is produced.

Uploaded by

Yasser Raouf
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
208 views8 pages

Ripple Carry and Carry Lookahead Adders: 1 Objectives

Ripple Carry and Carry Lookahead Adders are digital circuits that produce the arithmetic sum of two binary numbers. Ripple carry adders are constructed with full adders connected in cascaded (see section 2.1) the output is known after the carry generated by the previous stage is produced.

Uploaded by

Yasser Raouf
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Ripple Carry and Carry Lookahead Adders

1 Objectives
Design ripple carry and carry lookahead (CLA) adders.

Use VHDL CAD tools. Use hierarchical design techniques. Model and simulate combinational logic using VHDL.

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.

2.1 One-bit full adder


a b

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. The gate implementation of 1-bit full adder is shown in Figure 2.
       

a b

s cout

cin
Figure 2: Gate implementation of full adder.

Table 1: Full adder truth table. 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 1 0 0 1


    

2.2 Ripple carry adder


A ripple carry adder is a digital circuit that produces the arithmetic sum of two binary numbers. It can be constructed with full adders connected in cascaded (see section 2.1), with the carry output from each full adder connected to the carry input of the next full adder in the chain. Figure 3 shows the interconnection of four full adder (FA) circuits to provide a 4-bit ripple carry adder. Notice from Figure 3 that the input is from the right side because the rst cell traditionally represents the least signicant bit (LSB). Bits and in the gure represent the least signicant bits of the numbers to be added. The sum output is represented by the bits .

2.3 Ripple carry adder delays


In the ripple carry adder, the output is known after the carry generated by the previous stage is produced. Thus, the sum of the most signicant bit is only available after the carry signal has rippled through the adder from the least signicant stage to the most signicant stage. As a result, the nal sum and carry bits will be valid after a considerable delay. Table 2 shows the delays for several CMOS gates assuming all gates are equally loaded for simplicity. All delays are normalized relative to the delay of a simple inverter. The table also shows the corresponding gate areas normalized to a simple minimum-area inverter. Note from the table

a3

b3

a2

b2

a1

b1

a0

b0

c4

Full Adder

c3

Full Adder

c2

Full Adder

c1

Full Adder

c0

s3

s2

s1

s0

Figure 3: 4-bit full adder.

that multiple-input gates have to use a different circuit technique compared to simple 2-input gates. Table 2: CMOS gate delays and areas normalized relative to an inverter. Gate Inverter 2-input NOR 2-input NAND 2-input AND 2-input OR 2-input XOR -input OR -input AND Delay 1 1 1 2 2 3 2 3 Area 1 3 3 4 4 11 Comment Minimum delay More area to produce delay equal to that of an inverter More area to produce delay equal to that of an inverter Composed of NAND followed by inverter Composed of NOR followed by inverter Built using inverters and NAND gates Uses saturated load ( ). Uses -input OR preceded by inverters ( ).

Using Table 2 and the schematic of Figures 2 and 3, we can estimate the delays associated with the outputs of the ripple carry adder stages as indicated in Table 3. The delays are normalized relative to an inverter delay. For an -bit ripple carry adder the sum and carry bits of the most signicant bit (MSB) are obtained after a normalized delay of

For a 32-bit processor, the carry chain normalized delay would be 131. The ripple carry adder can get very slow when many bits need to be added. In fact, the carry chain propagation delay is the determining factor in most microprocessor speeds. 3

  

Sum Carry

delay delay



   




(1) (2)

Table 3: Delays for the outputs of a 4-bit ripple carry adder normalized to an inverter delay. Signal Delay , 6, 7 , 10, 11 , 14, 15 , 18, 19
  

2.4 Carry lookahead adder (CLA)


The carry lookahead adder (CLA) solves the carry delay problem by calculating the carry signals in advance, based on the input signals. It is based on the fact that a carry signal will be generated in two cases: (1) when both bits and are 1, or (2) when one of the two bits is and the carry-in is . Thus, one can write,

  

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


 

Figure 4: Full adder at stage with




and

shown.

The above two equations can be written in terms of two new signals in Figure 4:







 






(3) (4) and , which are shown

(5) (6)

(7) (8) (9)

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

Notice that the carry-out bit, , of the last stage will be available after four delays: two gate delays to calculate the propagate signals and two delays as a result of the gates required to implement Equation 13.


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

Figure 5: 4-Bit carry lookahead adder implementation detail.

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.

Figure 5 shows that a 4-bit CLA is built using gates to generate the and block to generate the carry out signals according to Equations 1013.


   

   

   

   

  

 

  


 

 




   

in Equation 5, we get (10) (11) (12) (13)

signals and a logic

3 Pre-Lab Report
For your prelab report, you are required to do the following. 1. Estimate the gate delays associated with the output signals for the 1-bit full adder. 2. Estimate the gate delays associated with the output signals for the 4-bit CLA. 3. Using a 4-bit CLA adder as a building block, draw a block diagram to show how to construct a 16-bit CLA adder.

4 Project Requirements
In this project you are required to design, model, and simulate a carry ripple adder and a carry lookahead adder.

4.1 Ripple carry adder requirements


1. Write VHDL behavioral models for OR, AND, and XOR gates. 2. The delays of the OR, AND, and XOR gates should be assigned with the help of Table 2 and assuming the delay of an inverter is 1 ns. 3. Model a 1-bit full adder using structural description using the OR, AND, and XOR gates as compoenents. 4. Model a 4-bit adder in a separate le using VHDL structural description. The 4-bit adder will use 1-bit full adders as components. 5. Model a 16-bit adder in a separate le using the VHDL structural description. The 16-bit adder will use 4-bit ripple carry adders as components. 6. The 16-bit adder has two inputs and of type bit vector representing the addend and augend; and 1-bit input signal of type bit representing the carry in. The adder produces one output signal of type bit vector representing the sum word and a 1-bit output signal of type bit representing the carry out. 7. Write a testbench to verify the operation of the 16-bit adder. The testbench should try different number values. Simulate the behavior of the adders using the testbench you developed.

4.2 Carry lookahead adder requirements


1. Write a VHDL code for a 4-bit CLA should be dened using structural description with components dened in Figure 5. 2. The delays of the 4-bit CLA should be assigned with the help of Table 2 and assuming the delay of an inverter is 1 ns. 3. Model a 16-bit adder in a separate le using VHDL structural description. The 16-bit adder will use 4-bit CLAs as components. 4. The 16-bit adder has two inputs and representing the addend and augend; and 1-bit input signal representing the carry in. The adder produces one output signal representing the sum word and a 1-bit output signal representing the carry out. 5. Write a testbench to verify the operation of the 16-bit CLA. The testbench should try different number values. Simulate the behavior of the adder using the testbench you developed.


5 Lab Report
Your lab report should include the following.

5.1 Ripple carry adder


1. Refer to the lab report grading scheme for items that must be present in your lab report. 2. Find the delay of the ripple carry adder using the waveform you got from the simulation. 3. Using the data of Table 2 estimate the area required for the 4-bit ripple carry adder in Figure 3. 4. Estimate the area of a 16-bit carry ripple adder.

5.2 Carry lookahead adder


1. Refer to the lab report grading scheme for items that must be present in your lab report. 2. Using the data of Table 2 estimate the area required the 4-bit CLA in Figure 5 and for a 16-bit CLA. 3. Find the delay of the adder using the waveform you got from the simulation. 4. Compare the delay of the ripple carry adder with the delay of the CLA based on the waveforms you obtained and comment on the result.

5. Compare the area of the ripple carry adder with the area of the CLA based on the waveforms you obtained and comment on the result. 6. Provide a plot showing the theoretical area and delay complexity of -bit carry ripple adders and an -bitCLA for values of

You might also like