Ripple Carry and Carry Lookahead Adders

Similar documents
exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Lab 1: Full Adder 0.0

CMOS Binary Full Adder

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

Counters and Decoders

Binary Adders: Half Adders and Full Adders

6.004 Computation Structures Spring 2009

Gates, Circuits, and Boolean Algebra

CSE140 Homework #7 - Solution

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

DEPARTMENT OF INFORMATION TECHNLOGY

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2)

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

Asynchronous counters, except for the first block, work independently from a system clock.

ASYNCHRONOUS COUNTERS

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

COMBINATIONAL CIRCUITS

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

VHDL Test Bench Tutorial

Let s put together a Manual Processor

Contents COUNTER. Unit III- Counters

3.Basic Gate Combinations

e.g. τ = 12 ps in 180nm, 40 ps in 0.6 µm Delay has two components where, f = Effort Delay (stage effort)= gh p =Parasitic Delay

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Module 3: Floyd, Digital Fundamental

Lecture 5: Gate Logic Logic Optimization

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

Figure 8-1 Four Possible Results of Adding Two Bits

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

Digital Electronics Detailed Outline

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Basic Logic Gates Richard E. Haskell

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

6-BIT UNIVERSAL UP/DOWN COUNTER

Modeling Registers and Counters

Sequential 4-bit Adder Design Report

Systems I: Computer Organization and Architecture

CHAPTER 11: Flip Flops

EE 209 Lab 1 Sound the Alarm

Sistemas Digitais I LESI - 2º ano

Flip-Flops, Registers, Counters, and a Simple Processor

Two's Complement Adder/Subtractor Lab L03

HIGH SPEED AREA EFFICIENT 1-BIT HYBRID FULL ADDER

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

Modeling Latches and Flip-flops

BINARY CODED DECIMAL: B.C.D.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Module 4 : Propagation Delays in MOS Lecture 22 : Logical Effort Calculation of few Basic Logic Circuits

The components. E3: Digital electronics. Goals:

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Lecture 8: Synchronous Digital Systems

Counters are sequential circuits which "count" through a specific state sequence.

Lab 1: Study of Gates & Flip-flops

A New Reversible TSG Gate and Its Application For Designing Efficient Adder Circuits

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

LFSR BASED COUNTERS AVINASH AJANE, B.E. A technical report submitted to the Graduate School. in partial fulfillment of the requirements

Design and Development of Virtual Instrument (VI) Modules for an Introductory Digital Logic Course

Multiplexers Two Types + Verilog

Gate Delay Model. Estimating Delays. Effort Delay. Gate Delay. Computing Logical Effort. Logical Effort

Combinational Logic Design

An Effective Deterministic BIST Scheme for Shifter/Accumulator Pairs in Datapaths

Step Response of RC Circuits

AN IMPROVED DESIGN OF REVERSIBLE BINARY TO BINARY CODED DECIMAL CONVERTER FOR BINARY CODED DECIMAL MULTIPLICATION

CHAPTER 3 Boolean Algebra and Digital Logic

EXPERIMENT 8. Flip-Flops and Sequential Circuits

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

PLL frequency synthesizer

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

Decimal Number (base 10) Binary Number (base 2)

Optimization and Comparison of 4-Stage Inverter, 2-i/p NAND Gate, 2-i/p NOR Gate Driving Standard Load By Using Logical Effort

Fundamentals of Digital Electronics

Understanding Logic Design

High Speed and Efficient 4-Tap FIR Filter Design Using Modified ETA and Multipliers

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

International Journal of Electronics and Computer Science Engineering 1482

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Programming Logic controllers

Design of Low Power One-Bit Hybrid-CMOS Full Adder Cells

High Speed Gate Level Synchronous Full Adder Designs

ENGI 241 Experiment 5 Basic Logic Gates

Circuits and Boolean Expressions

Transcription:

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 c in c out 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. 1

a b s c out c in Figure 2: Gate implementation of full adder. Table 1: Full adder truth table. 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 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 first cell traditionally represents the least significant bit (LSB). Bits and in the figure represent the least significant 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 significant bit is only available after the carry signal has rippled through the adder from the least significant stage to the most significant stage. As a result, the final 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 2

a 3 b 3 a 2 b 2 a 1 b 1 a 0 b 0 c 4 c 3 c 2 c 1 c 0 s 3 s 2 s 1 s 0 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 Delay Area Comment Inverter 1 1 Minimum delay 2-input NOR 1 3 More area to produce delay equal to that of an inverter 2-input NAND 1 3 More area to produce delay equal to that of an inverter 2-input AND 2 4 Composed of NAND followed by inverter 2-input OR 2 4 Composed of NOR followed by inverter 2-input XOR 3 11 Built using inverters and NAND gates -input OR 2 -input AND 3 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 significant bit (MSB) are obtained after a normalized delay of Sum delay Carry delay 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. (1) (2) 3

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, (3) (4) The above two equations can be written in terms of two new signals and, which are shown in Figure 4: a i b i P i s i G i c i c i+1 Figure 4: Full adder at stage with and shown. (5) (6) where (7) (8) (9) 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 4

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 find its proper value. Let s apply this to a -bit adder to make it clear. Putting in Equation 5, we get (10) (11) (12) (13) 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. Figure 5 shows that a 4-bit CLA is built using gates to generate the and signals and a logic block to generate the carry out signals according to Equations 10 13. a 3 b 3 a 2 b 2 a 1 b 1 a 0 b 0 G 3 P 3 G 2 P 2 G 1 P 1 G 0 P 0 c 4 c 0 c 3 c 2 c 1 c 0 P 3 P 2 P 1 P 0 s 3 s 2 s 1 s 0 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. 5

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 file 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 file 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. 6

4.2 Carry lookahead adder requirements 1. Write a VHDL code for a 4-bit CLA should be defined using structural description with components defined 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 file using VHDL structural description. The 16-bit adder will use 4-bit CLA s 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. 7

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 8