Building a Faster Adder

Slides:



Advertisements
Similar presentations
L23 – Adder Architectures. Adders  Carry Lookahead adder  Carry select adder (staged)  Carry Multiplexed Adder  Ref: text Unit 15 9/2/2012 – ECE 3561.
Advertisements

1 ECE 4436ECE 5367 Computer Arithmetic I-II. 2 ECE 4436ECE 5367 Addition concepts 1 bit adder –2 inputs for the operands. –Third input – carry in from.
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
1 Lecture 12: Hardware for Arithmetic Today’s topics:  Designing an ALU  Carry-lookahead adder Reminder: Assignment 5 will be posted in a couple of days.
Comparator.
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
Lecture 20: Hardware for Arithmetic Today’s topic –Carry Look-Ahead Adder 1.
Fast Adders See: P&H Chapter 3.1-3, C Goals: serial to parallel conversion time vs. space tradeoffs design choices.
Fast Adders See: P&H Chapter 3.1-3, C Goals: serial to parallel conversion time vs. space tradeoffs design choices.
EECS Components and Design Techniques for Digital Systems Lec 17 – Addition, Subtraction, and Negative Numbers David Culler Electrical Engineering.
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Lecture 8 Arithmetic Logic Circuits
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
1 Carry-Ripple Adder Using full-adder instead of half-adder for first bit, we can include a “carry in” bit in the addition –Will be useful later when we.
Fall 2008EE VLSI Design I - © Kia Bazargan 1 EE 5323 – VLSI Design I Kia Bazargan University of Minnesota Adders.
1 ECE369 Chapter 3. 2 ECE369 Multiplication More complicated than addition –Accomplished via shifting and addition More time and more area.
ECE 301 – Digital Electronics
Spring 2002EECS150 - Lec10-cl1 Page 1 EECS150 - Digital Design Lecture 10 - Combinational Logic Circuits Part 1 Feburary 26, 2002 John Wawrzynek.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Introduction to CMOS VLSI Design Lecture 11: Adders David Harris Harvey Mudd College Spring 2004.
EECS Components and Design Techniques for Digital Systems Lec 15 – Addition, Subtraction, and Negative Numbers David Culler Electrical Engineering.
ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin.
IKI a-Combinatorial Components Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Chapter 6-1 ALU, Adder and Subtractor
5-1 Programmable and Steering Logic Chapter # 5: Arithmetic Circuits.
Csci 136 Computer Architecture II – Constructing An Arithmetic Logic Unit Xiuzhen Cheng
1 CPSC3850 Adders and Simple ALUs Simple Adders Figures 10.1/10.2 Binary half-adder (HA) and full-adder (FA). Digit-set interpretation: {0, 1}
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
Computing Systems Designing a basic ALU.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
COE 202: Digital Logic Design Combinational Circuits Part 2 KFUPM Courtesy of Dr. Ahmad Almulhem.
Spring C:160/55:132 Page 1 Lecture 19 - Computer Arithmetic March 30, 2004 Sukumar Ghosh.
1 Lecture 12 Time/space trade offs Adders. 2 Time vs. speed: Linear chain 8-input OR function with 2-input gates Gates: 7 Max delay: 7.
1 Lecture 12: Adders, Sequential Circuits Today’s topics:  Carry-lookahead adder  Clocks, latches, sequential circuits.
1 Carry Lookahead Logic Carry Generate Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate Pi = Ai xor Bi carry in will equal carry out here.
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Computer Arthmetic Chapter Four P&H.
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
Lecture Adders Half adder.
Addition and multiplication
Space vs. Speed: Binary Adders
ECE/CS 552: Carry Lookahead
Combinational Circuits
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 12: Adders, Sequential Circuits
Lecture 12: Adders, Sequential Circuits
Lecture 14 Logistics Last lecture Today
Instructor: Alexander Stoytchev
Lecture 15 Logistics Last lecture Today HW4 is due today
Instructor: Alexander Stoytchev
CS 140 Lecture 14 Standard Combinational Modules
Digital System Design Combinational Logic
CSE 140 Lecture 14 Standard Combinational Modules
Instructor: Alexander Stoytchev
Addition and multiplication
Instructor: Mozafar Bag-Mohammadi University of Ilam
Instructor: Alexander Stoytchev
Lecture 14 Logistics Last lecture Today
Addition and multiplication
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
ECE 352 Digital System Fundamentals
Arithmetic Circuits.
Number Representation
Presentation transcript:

Building a Faster Adder Similar to adding by hand, column by column Con: Slow Output is not correct until the carries have rippled to the left – critical path 4-bit carry-ripple adder has 4*2 = 8 gate delays Pro: Small 4-bit carry-ripple adder has just 4*5 = 20 gates a3 b3 a2 b2 a1 b1 a0 b0 cin s3 s2 s1 s0 c out 4-bit adder ca rr ies: c3 c2 c1 cin B: b3 b2 b1 b0 a A: + a3 a2 a1 a0 cout s3 s2 s1 s0 a3 b3 a2 b2 a1 b1 a0 b0 ci a F A F A F A F A c o s3 s2 s1 s0

Efficient Lookahead c1 = a0b0 + (a0 xor b0)c0 cin 1 + c0 b0 a0 if a0 xor b0 = 1 then c1 = 1 if c0 = 1 (call this P : Propagate) 1 + c1 if a0b0 = 1 then c1 = 1 (call this G : Gene r ate) a car r ies : c4 c3 c2 c1 c0 B : b3 b2 b1 b0 A : + a3 a2 a1 a0 cout s3 s2 s1 s0 c1 = a0b0 + (a0 xor b0)c0 c2 = a1b1 + (a1 xor b1)c1 c3 = a2b2 + (a2 xor b2)c2 c4 = a3b3 + (a3 xor b3)c3 Why those names? When a0b0=1, we should generate a 1 for c1. When a0 XOR b0 = 1, we should propagate the c0 value as the value of c1, meaning c1 should equal c0. c1 = G0 + P0c0 c2 = G1 + P1c1 c3 = G2 + P2c2 c4 = G3 + P3c3 Gi = aibi (generate) Pi = ai XOR bi (propagate)

Efficient Lookahead Gi = aibi (generate) Pi = ai XOR bi (propagate) c1 = G0 + P0c0 c2 = G1 + P1c1 c2 = G1 + P1(G0 + P0c0) c2 = G1 + P1G0 + P1P0c0 c3 = G2 + P2c2 c3 = G2 + P2(G1 + P1G0 + P1P0c0) c3 = G2 + P2G1 + P2P1G0 + P2P1P0c0 c4 = G3 + P3G2 + P3P2G1 + P3P2P1G0 + P3P2P1P0c0 Gi/Pi function of inputs only

CLA Each stage: Create carry-lookahead logic from equations b3 a2 b2 a1 b1 a0 b0 cin SPG b lo c k Half-adder Half-adder Half-adder Half-adder Each stage: HA for G and P Another XOR for s Call SPG block Create carry-lookahead logic from equations More efficient than naïve scheme, at expense of one extra gate delay G3 P3 G2 P2 G1 P1 G0 P0 c0 G3 P3 G2 P2 G1 G0 c0 P1 P0 Car r y-lookahead logic Stage 4 Stage 3 Stage 2 Stage 1 Car r y-lookahead logic c3 c2 c1 cout s3 s2 ( b ) s1 s0 a c1 = G0 + P0c0 c2 = G1 + P1G0 + P1P0c0 c3 = G2 + P2G1 + P2P1G0 + P2P1P0c0 cout = G3 + P3G2 + P3P2G1 + P3P2P1G0 + P3P2P1P0c0

Carry-Lookahead Adder – High-Level View b3 a b P G cout G3 P3 cin a2 b2 G2 P2 c3 SPG block a1 b1 G1 P1 c2 c1 a0 b0 c0 G0 P0 4 - bit carry lookahead logic s3 s2 s1 s0 Fast – only 4 gate delays Each stage has SPG block with 2 gate levels Carry-lookahead logic quickly computes the carry from the propagate and generate bits using 2 gate levels inside Reasonable number of gates – 4-bit adder has only 26 gates 4-bit adder comparison (gate delays, gates) Carry-ripple: (8, 20) Two-level: (2, 500) CLA: (4, 26) Nice compromise

Carry-Lookahead Adder – 32-bit? Problem: Gates get bigger in each stage 4th stage has 5-input gates 32nd stage would have 33-input gates Too many inputs for one gate Would require building from smaller gates, meaning more levels (slower), more gates (bigger) One solution: Connect 4-bit CLA adders in carry-ripple manner Ex: 16-bit adder: 4 + 4 + 4 + 4 = 16 gate delays. Can we do better? Stage 4 Gates get bigger in each stage a3 a2 a1 a0 b3 s3 s2 s1 s0 c out cin b2 b1 b0 4-bit adder s11-s8 s15-s12 a15-a12 b15-b12 a11-a8 b11-b8 s7 s6 s5 s4 a7 a6 a5 a4 b7 b6 b5 b4 a

Hierarchical Carry-Lookahead Adders Better solution – Rather than rippling the carries, just repeat the carry-lookahead concept Requires minor modification of 4-bit CLA adder to output P and G These use carry-lookahead internally a15-a12 b15-b12 a11-a8 b11-b8 a7 a6 a5 a4 b7 b6 b5 b4 a3 a2 a1 a0 b3 b2 b1 b0 a3 a2 a1 a0 b3 b2 b1 b0 a3 a2 a1 a0 b3 b2 b1 b0 a3 a2 a1 a0 b3 b2 b1 b0 a3 a2 a1 a0 b3 b2 b1 b0 4-bit adder cin 4-bit adder cin 4-bit adder cin 4-bit adder cin cout 4-bit carry-lookahead logic P G P3 G3 P2 c3 G2 P1 c2 G1 P0 c1 G0 s15-s12 s11-s18 s7-s4 s3-s0 P G cout s3 s2 s1 s0 cout s3 s2 s1 s0 cout s3 s2 s1 s0 cout s3 s2 s1 s0 Second level of carry-lookahead

Hierarchial Carry-Lookahead Adders Hierarchical CLA concept can be applied for larger adders 32-bit hierarchical CLA: Only about 8 gate delays (2 for SPG block, then 2 per CLA level) Only about 14 gates in each 4-bit CLA logic block 4-bit CLA logic 2-bit P G c SPG block ai bi a Q: How many gate delays for 64-bit hierarchical CLA, using 4-bit CLA logic? A: 16 CLA-logic blocks in 1st level, 4 in 2nd, 1 in 3rd -- so still just 8 gate delays (2 for SPG, and 2+2+2 for CLA logic). CLA is a very efficient method.