© Yohai Devir 2007 Fast Arithmetics. © Yohai Devir 2007 Full Adder Cout AiAi BiBi SiSi Cin.

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

Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
Comparator.
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.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Henry Hexmoor1 Chapter 5 Arithmetic Functions Arithmetic functions –Operate on binary vectors –Use the same subfunction in each bit position Can design.
ECE 331 – Digital System Design
S. Reda EN160 SP’07 Design and Implementation of VLSI Systems (EN0160) Lecture 28: Datapath Subsystems 2/3 Prof. Sherief Reda Division of Engineering,
Digital Integrated Circuits 2e: Chapter Copyright  2002 Prentice Hall PTR, Adapted by Yunsi Fei ECE 300 Advanced VLSI Design Fall 2006 Lecture.
EECS Components and Design Techniques for Digital Systems Lec 18 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 4.
VLSI Arithmetic. Multiplication A = a n-1 a n-2 … a 1 a 0 B = b n-1 b n-2 … b 1 b 0  eg)  Shift.
CSE477 VLSI Digital Circuits Fall 2002 Lecture 20: Adder Design
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 6 - Logic &
Arithmetic Logic Unit (ALU) Lecture L7.5 Section 7.5.
Adders Lecture L7.1 Section 6.2 Section 10.4 (pp )
Design and Implementation of VLSI Systems (EN1600) Lecture 26: Datapath Subsystems 2/4 Prof. Sherief Reda Division of Engineering, Brown University Spring.
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Lecture 4.
Fall 2008EE VLSI Design I - © Kia Bazargan 1 EE 5323 – VLSI Design I Kia Bazargan University of Minnesota Adders.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
Combinational circuits
Spring 2002EECS150 - Lec10-cl1 Page 1 EECS150 - Digital Design Lecture 10 - Combinational Logic Circuits Part 1 Feburary 26, 2002 John Wawrzynek.
CS 140 Lecture 19 Professor CK Cheng 12/05/02. Sequential Machine Standard Modules Combinational Sequential System Designs.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
 Arithmetic circuit  Addition  Subtraction  Division  Multiplication.
CSC321 Emulate a 4-Bit ALU in Java A0A0 A1A1 A2A2 A3A3 B0B0 B1B1 B2B2 B3B3 S0S0 S1S1 S2S2 S3S3 C in ILIL IRIR C out OV 4-Bit ALU S0S0 S1S1 S2S2 S3S3 Sum.
ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin.
Chapter 6-1 ALU, Adder and Subtractor
1 Combinational Logic Logic and Digital System Design - CS 303 Erkay Savaş Sabancı University.
Arithmetic Building Blocks
EECS Components and Design Techniques for Digital Systems Lec 16 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
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.
Spring C:160/55:132 Page 1 Lecture 19 - Computer Arithmetic March 30, 2004 Sukumar Ghosh.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
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.
CS221: Digital Logic Design Combinational Circuits
Building a Faster Adder
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 10 Multiplexers MUX: –Selects binary information from one of many input lines and.
Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality = A B A = B Two bit strings.
CPE 232 MIPS Arithmetic1 CPE 232 Computer Organization MIPS Arithmetic – Part I Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin (
CMPEN 411 VLSI Digital Circuits Spring 2009 Lecture 19: Adder Design
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.
Combinational Logic Design
CPEN Digital System Design
Addition, Subtraction, Logic Operations and ALU Design
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
CSE477 VLSI Digital Circuits Fall 2002 Lecture 20: Adder Design
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Schematics adapted from those provided by the authors Hennessey and Patterson.
How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
How Computers Work Lecture 4 Page 1 How Computers Work Lecture 4 Computer Arithmetic.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
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.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Full Adder Truth Table Conjugate Symmetry A B C CARRY SUM
1 Arithmetic Building Blocks Today: Signed ArithmeticFirst Hour: Signed Arithmetic –Section 5.1 of Katz’s Textbook –In-class Activity #1 Second Hour: Adder.
Combinational Circuits
Carry Look Ahead (CLA).
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.
תרגול 6 בקר ומסלול נתונים חלק שני
CSE Winter 2001 – Arithmetic Unit - 1
לוגיקה צרופית Combinatorial Logic מעגל צירופי לוגי n m
Combinational Circuits
Presentation transcript:

© Yohai Devir 2007 Fast Arithmetics

© Yohai Devir 2007 Full Adder Cout AiAi BiBi SiSi Cin

© Yohai Devir 2007 Carry Ripple Adder A0A0 B0B0 S0S0 A1A1 B1B1 S1S1 A2A2 B2B2 S2S2 A3A3 B3B3 S3S3 C 0 =0C1C1 C2C2 C3C3 C4C4 Note: MSB is rightmost

© Yohai Devir 2007 Reduction Changing the goal to: Calculate the Carry vector In one time unit we can calculate S out of A,B,C No effect on complexity

© Yohai Devir 2007 A0A0 B0B0 S0S0 C0C0 A1A1 B1B1 S1S1 C1C1 A2A2 B2B2 S2S2 C2C2 A3A3 B3B3 S3S3 C3C3 Note: MSB is rightmost

© Yohai Devir 2007 Current problem C 0 =0 A0A0 B0B0 A1A1 B1B1 A2A2 B2B2 A3A3 B3B3 C1C1 C2C2 C3C3 C4C4 A4A4 B4B4 A5A5 B5B5 A6A6 B6B6 A7A7 B7B7 C5C5 C6C6 C7C7 Note: MSB is rightmost

© Yohai Devir 2007 Three Cases Generate: Cout = 1 11 ? Kill : Cout = 0 00 ? Propagate: Cout = Cin 10 ?

© Yohai Devir 2007 G/P gate AiAi BiBi GP G = A∙B P = A xor B

© Yohai Devir 2007 C 0 =0 A0A0 B0B0 A1A1 B1B1 A2A2 B2B2 A3A3 B3B3 A4A4 B4B4 A5A5 B5B5 A6A6 B6B6 A7A7 B7B7 G0G0 P0P0 G1G1 P1P1 G2G2 P2P2 G3G3 P3P3 C1C1 C2C2 C3C3 C4C4 G4G4 P4P4 G5G5 P5P5 G6G6 P6P6 G7G7 P7P7 C5C5 C6C6 C7C7 1+O(N) ! C8C8 Note: MSB is rightmost

© Yohai Devir 2007 If we could have calculated every 2 nd Carry C 0 =0 C1C1 C3C3 C5C5 C7C7 C2C2 C4C4 C6C6 C8C8 G0G0 P0P0 G1G1 P1P1 G2G2 P2P2 G3G3 P3P3 G4G4 P4P4 G5G5 P5P5 G6G6 P6P6 G7G7 P7P7 Note: MSB is rightmost

© Yohai Devir 2007 Calculate every 2 nd GiGi PiPi G’P’ C i+2 =1 iff G i+1 or (G i and P i+1 ) C i+2 =0 iff G i+1 =0 and P i+1 =0 C i+2 =C i iff P i and P i+1 G i+1 P i+1 CiCi GiGi PiPi G i+1 P i+1 C i+1 C i+2 G’ = G i+1 + G i ∙P i+1 P’ = P i ∙P i+1 Note: MSB is rightmost

© Yohai Devir 2007 C 0 =0 A0A0 B0B0 A1A1 B1B1 A2A2 B2B2 A3A3 B3B3 A4A4 B4B4 A5A5 B5B5 A6A6 B6B6 A7A7 B7B7 G0G0 P0P0 G1G1 P1P1 G2G2 P2P2 G3G3 P3P3 C1C1 C2C2 C3C3 C4C4 G4G4 P4P4 G5G5 P5P5 G6G6 P6P6 G7G7 P7P7 C5C5 C6C6 C7C7 G0G0 P0P0 G1G1 P1P1 G2G2 P2P2 G3G3 P3P3 G4G4 P4P4 G5G5 P5P5 G6G6 P6P6 G7G7 P7P7 C8C8 C2C2 C4C4 C3C3 C6C6 C8C8 2+O(N/2)+1 ! Note: MSB is rightmost

© Yohai Devir 2007 C 0 =0 A0A0 B0B0 A1A1 B1B1 A2A2 B2B2 A3A3 B3B3 A4A4 B4B4 A5A5 B5B5 A6A6 B6B6 A7A7 B7B7 G0G0 P0P0 G1G1 P1P1 G2G2 P2P2 G3G3 P3P3 C1C1 C2C2 C3C3 C4C4 G4G4 P4P4 G5G5 P5P5 G6G6 P6P6 G7G7 P7P7 C5C5 C6C6 C7C7 C2C2 C4C4 C3C3 C6C6 G0G0 P0P0 G1G1 P1P1 G2G2 P2P2 G3G3 P3P3 G4G4 P4P4 G5G5 P5P5 G6G6 P6P6 G7G7 P7P7 C8C8 C4C4 C8C8 C8C8 log(n) +log(n) = 2log(n) = O(log(n)) Note: MSB is rightmost

© Yohai Devir 2007 Final stage A0A0 B0B0 S0S0 C0C0 A1A1 B1B1 S1S1 C1C1 A2A2 B2B2 S2S2 C2C2 A3A3 B3B3 S3S3 C3C3 Overall complexity: O(log(n))+1=O(log(n)) Note: MSB is rightmost

© Yohai Devir 2007 Comparator A==B, A>B A0A0 B0B0 A1A1 B1B1 A2A2 B2B2 A3A3 B3B3 EQ 4 EQ 1 EQ 2 EQ 3 EQ 0 =1 Note: MSB is rightmost GR 4 GR 1 GR 2 GR 3 GR 0 =0

© Yohai Devir 2007 Comparator A==B, A>B A0A0 B0B0 A1A1 B1B1 ALL-EQ 1 Note: MSB is rightmost ALL-GR 1 ALL-EQ 1 iffA 0 A 1 ==B 0 B 1 ALL-EQ 1 = EQ 1 ∙EQ 0 ALL-GR 1 iffA 0 A 1 > B 0 B 1 ALL-GR 1 = GR 1 + GR 0 ∙EQ 1 EQ 0 GR 0

© Yohai Devir 2007 A0A0 B0B0 A1A1 B1B1 A2A2 B2B2 A3A3 B3B3 A4A4 B4B4 A5A5 B5B5 A6A6 B6B6 A7A7 B7B7 log(n) + 1 = O(log(n)) Note: MSB is rightmost