Carry Look Ahead (CLA).

Slides:



Advertisements
Similar presentations
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.
Advertisements

Chapter 4 -- Modular Combinational Logic. Decoders.
Chapter 4 -- Modular Combinational Logic
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.
Lecture 20: Hardware for Arithmetic Today’s topic –Carry Look-Ahead Adder 1.
Lecture Adders Half adder.
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.
IMPLEMENTATION OF µ - PROCESSOR DATA PATH
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Tutorial #6 Controller + DataPath part II – © Yohai Devir 2007 © Dima Elenbogen 2009 Technion - IIT.
Lecture 8 Arithmetic Logic Circuits
© Yohai Devir 2007 Fast Arithmetics. © Yohai Devir 2007 Full Adder Cout AiAi BiBi SiSi Cin.
Fall 2008EE VLSI Design I - © Kia Bazargan 1 EE 5323 – VLSI Design I Kia Bazargan University of Minnesota Adders.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Chapter 6-1 ALU, Adder and Subtractor
Basic Addition Review Basic Adders and the Carry Problem
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
Computing Systems Designing a basic ALU.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
COE 202: Digital Logic Design Combinational Circuits Part 2 KFUPM Courtesy of Dr. Ahmad Almulhem.
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.
Building a Faster Adder
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.
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.
Basic Addition Review Basic Adders and the Carry Problem Carry Propagation Speedup Speed/Cost Tradeoffs Two-operand Versus Multi-operand Adders.
1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.
CDA3101 Recitation Section 5
Carry-Lookahead & Carry-Select Adders
Combinational Circuits
Somet things you should know about digital arithmetic:
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
Subtitle: How to design the data path of a processor.
Chapter 4 -- Modular Combinational Logic
Lecture Adders Half adder.
Single Bit ALU 3 R e s u l t O p r a i o n 1 C y I B v b 2 L S f w d O
Swamynathan.S.M AP/ECE/SNSCT
Space vs. Speed: Binary Adders
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
ECE/CS 552: Carry Lookahead
Combinational Circuits
תרגול 6 בקר ומסלול נתונים חלק שני
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 12: Adders, Sequential Circuits
VLSI Arithmetic Lecture 4
Lecture 14 Logistics Last lecture Today
Instructor: Alexander Stoytchev
Instructor: Prof. Chung-Kuan Cheng
לוגיקה צרופית Combinatorial Logic מעגל צירופי לוגי n m
Unit 5 COMBINATIONAL CIRCUITS-1
CS 140 Lecture 14 Standard Combinational Modules
CSE 140 Lecture 14 Standard Combinational Modules
Instructor: Mozafar Bag-Mohammadi University of Ilam
Instructor: Alexander Stoytchev
Lecture 14 Logistics Last lecture Today
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
74LS283 4-Bit Binary Adder with Fast Carry
Carry-Lookahead, Carry-Select, & Hybrid Adders
Carry-Lookahead, Carry-Select, & Hybrid Adders
Arithmetic Circuits.
Carry-Lookahead & Carry-Select Adders
Lecture 2 Adders Half adder.
Presentation transcript:

Carry Look Ahead (CLA)

Full Adder Bi Ai Cin Cout Si © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Full Adder Bi Ai Cin Cout Si

Carry Ripple Adder A0 B0 S0 A1 B1 S1 A2 B2 S2 A3 B3 S3 C0=0 C1 C2 C3 © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Carry Ripple Adder A0 B0 S0 A1 B1 S1 A2 B2 S2 A3 B3 S3 C0=0 C1 C2 C3 C4

© Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

Reduction Changing the goal to: Calculate the Carry vector © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Reduction Changing the goal to: Calculate the Carry vector We can calculate S out of A,B,C in O(1) We’d like to improve the complexity of calculating C (less than linear)

Three Cases 1 Generate: Gi ? 1 Propagate: Pi ? Kill  Gi  Pi ? © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Three Cases 1 ? Generate: Gi 1 ? Propagate: Pi ? Kill  Gi  Pi

חישובCout בהינתן Cin ותכונה © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology חישובCout בהינתן Cin ותכונה תכונה G P Cout Generate 1 Propogate Cin Kill Gi Pi Ci+1= Gi V (Pi Λ Ci) Ci Ci+1

G/P gate Gi Pi Gi 1 Pi 1 Pi 1 Ai Bi Gi = Ai Λ Bi Pi = Ai  Bi © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology G/P gate Gi 1 Pi 1 Pi 1 Ai Bi Gi Pi Gi = Ai Λ Bi Pi = Ai  Bi

Calculate using 2 G/P pairs Ci Gi Pi Gi+1 Pi+1 Ci+1 Ci+2 Ci+2=1  Gi+1 V (Gi Λ Pi+1) Ci+2=Ci  Pi Λ Pi+1 Ci+2=0  otherwise Gi Pi G’ P’ Gi+1 Pi+1 G’ = Gi+1 V (Gi Λ Pi+1) P’ = Pi Λ Pi+1 © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

חישוב וקטורי G ו-P: O(log(n)) A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 G0-1P0-1 G2-3P2-3 G4-5P4-5 G6-7P6-7 G0-3P0-3 G4-7P4-7 G0 P0 G1 P1 G2 P2 G3 P3 G4 P4 G5 P5 G6 P6 G7 P7 חישוב וקטורי G ו-P: O(log(n)) © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

חישוב של Cj+1 בהינתן Ci ובלוק Gi-jPi-j Cj+1 = Gi-j V (Pi-j Λ Ci) © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

תלות של Cj+1 ב-Ci ,Gi-j ו-Pi-j Cj+1 = Cj+1(Ci , Gi-j , Pi-j) = Gi-j V (Pi-j Λ Ci) C7 C5 C3 C1 C6 C4 C2 C0=0 C6 C2 G6-7P6-7 G4-5P4-5 G2-3P2-3 G0-1P0-1 C4 C0=0 C8 C0=0 C4 G4-7P4-7 G0-3P0-3 חישוב ה-carries בהינתן וקטורי G ו-P: O(log(n)) © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

log(n) +log(n) = 2log(n) = O(log(n)) C0=0 A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 G0 P0 G1 P1 G2 P2 G3 P3 C1 C2 C3 C4 G4 P4 G5 P5 G6 P6 G7 P7 C5 C6 C7 C8 G0-1P0-1 G2-3P2-3 G4-5P4-5 G6-7P6-7 G0-3P0-3 G4-7P4-7 log(n) +log(n) = 2log(n) = O(log(n)) © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

אין מסלול מ-Ci ל-G או P Gj Pj Gi Pi Gj Pj Gi Pi G0-1P0-1 Gi-j Pi-j © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology אין מסלול מ-Ci ל-G או P Gj Pj Gi Pi Gj Pj Gi Pi G0-1P0-1 Gi-j Pi-j G0-1P0-1 Cj+1 Ci Gi-j Pi-j Ci Cj+1

Timeline of Calculations for n=8 C0 is 0 from the beginning. 1) GiPi for each 0 ≤ i < 8 2) C1 (by C0 and G0P0) G0-1P0-1, G2-3P2-3, G4-5P4-5, G6-7P6-7 3) C2 (by C0 and G0-1P0-1) G0-3P0-3, G4-7P4-7 // Now all G...P... are known Ai Bi Gi Pi 4) C3 (by C2 and G2P2) C4 (by C0 and G0-3P0-3) 5) C5 (by C4 and G4P4) C6 (by C4 and G4-5P4-5) 6) C7 (by C6 and G6P6) © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

Final stage A0 B0 S0 C0 A1 B1 S1 C1 A2 B2 S2 C2 An-1 Bn-1 Sn-1 Cn-1 ... Cn Overall complexity: O(log(n))+1=O(log(n)) = 2⋅log2n + 1 © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology

No! 2∙log2n + 1 < n n ≥ 6 Example 2 from .pdf Ripple-Carry n Adder Calculation Time Ripple-Carry n Carry-Look-Ahead 2∙log2n + 1 CLA is better when: 2∙log2n + 1 < n n ≥ 6 © Dima Elenbogen 2010, Technion – Israel Institute of Technology

למעשה אותה פונקציה בוליאנית שאלה © Yohai Devir 2007, Dima Elenbogen 2011, Technion – Israel Institute of Technology רשמו את כל הפונקציות הבוליאניות מהצורה :{0,1}←{0,1}* המתארות את היחידות של מחבר CLA. למעשה אותה פונקציה AND למעשה אותה פונקציה AND למעשה אותה פונקציה בוליאנית Si = Ai  Bi  Ci

Example 3 from .pdf G* = Gi+2 + Gi+1Pi+2 + GiPi+1Pi+2 © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Example 3 from .pdf Ci Gi Pi Gi+1 Pi+1 Ci+1 Gi+2 Pi+2 Ci+3 Ci+2 G* = Gi+2 + Gi+1Pi+2 + GiPi+1Pi+2 P* = Pi  Pi+1  Pi+2

Comparator A==B, A>B © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Comparator A==B, A>B Propogate Generate A0 B0 A1 B1 A2 B2 A3 B3 EQ4 EQ1 EQ2 EQ3 EQ0=1 GR4 GR1 GR2 GR3 GR0=0

Comparator A==B, A>B © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology Comparator A==B, A>B A0 B0 A1 B1 EQ0-1 GR0-1 EQ0 GR0 GR1 EQ1 EQ0-1  A0A1==B0B1 EQ0-1 = EQ1 Λ EQ0 GR0-1  A0A1 > B0B1 GR0-1 = GR1 V (GR0 Λ EQ1)

log(n) + 1 = O(log(n)) A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 © Yohai Devir 2007, Dima Elenbogen 2010, Technion – Israel Institute of Technology A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A6 B6 A7 B7 log(n) + 1 = O(log(n))