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.

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
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.
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.
Addition (2). Outline Full Adder 3-Bit Adder 2’s Complement Subtraction.
ECE 331 – Digital System Design
Contemporary Logic Design Multi-Level Logic © R.H. Katz Transparency No Chapter # 3: Multi-Level Combinational Logic 3.3 and Time Response.
EECS Components and Design Techniques for Digital Systems Lec 17 – Addition, Subtraction, and Negative Numbers David Culler Electrical Engineering.
Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
Lecture 8 Arithmetic Logic Circuits
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Adders, subtractors, ALUs
 Arithmetic circuit  Addition  Subtraction  Division  Multiplication.
EECS Components and Design Techniques for Digital Systems Lec 15 – Addition, Subtraction, and Negative Numbers David Culler Electrical Engineering.
Binary Addition CSC 103 September 17, 2007.
Binary Addition Section 4.5. Binary Addition Example.
IKI a-Combinatorial Components Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
5-1 Programmable and Steering Logic Chapter # 5: Arithmetic Circuits.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Csci 136 Computer Architecture II – Constructing An Arithmetic Logic Unit Xiuzhen Cheng
Computing Systems Designing a basic ALU.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
V - Combinational Logic Case Studies © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Combinational logic design case studies General design procedure.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
ES 244: Digital Logic Design Chapter 4 Chapter 4: Combinational Logic Uchechukwu Ofoegbu Temple University.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
Number Systems and Circuits for Addition Lecture 5 Section 1.5 Thu, Jan 26, 2006.
Computer Architecture Lecture 16 Fasih ur Rehman.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
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.
Number Systems and Circuits for Addition – Binary Adders Lecture 6 Section 1.5 Fri, Jan 26, 2007.
Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions.
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
Addition and multiplication Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
Electrical Engineering Engineering the Future Digital Circuits Fundamentals Hands-on Full-Adder Simulation (afternoon)
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Presented by A. Maleki Fall Semester, 2010
1 CSE370, Lecture 4 Lecture 4 u Logistics n HW1 due now n HW2 posted now and is due one week from today n Lab1 going on this week n Feedback on lectures,
CDA3101 Recitation Section 5
Combinational Circuits
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
ECE 4110– Sequential Logic Design
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.
Combinational Circuits
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 14 Logistics Last lecture Today
Arithmetic Circuits (Part I) Randy H
COMS 361 Computer Organization
Lecture 14 Logistics Last lecture Today
Combinational Circuits
Arithmetic Circuits.
Presentation transcript:

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

3 Time vs. speed: Tree Gates:7 Max delay: 3

4 Modified circuit Calculate the OR of the first 2 inputs, the OR of the first 3, and so on, up to the OR of all 8 Gates: 7 Max delay: 7

Parallel version Gates: 12 Max delay: 3

6 Binary half adder 1-bit half adder  Computes sum, carry-out No carry-in  Sum = A'B + AB' = A xor B  Cout = AB ABSC out A BCout Sum Half Adder

7 Binary full adder 1-bit full adder  Computes sum, carry-out Carry-in allows cascaded adders  Sum = Cin xor A xor B  Cout = ACin + BCin + AB ABC in SC out A B Cin Cout Sum Full Adder

8 Full adder: Using 2 half adders Multilevel logic  Slower  Fewer gates: 5 vs. 6 2 XORs, 2 ANDs, 1 OR Sum = (A  B)  Cin Cout = ACin + BCin + AB = (A  B)Cin + AB ABC in SC out C out Distributive law?

9 Full adder: Using 2 half adders Ci+1 Ci Ai Bi Ai Bi Si 40 OR2 37 AND2 39 AND2 36 XOR 38 XOR

10 4-bit ripple-carry adder A B Cout Sum Cin 01 0 = Add 1 = Subtract A0B0B0' Sel Overflow A B Cout Sum Cin A1B1B1' Sel A B Cout Sum Cin A2B2B2' Sel AB Cout Sum Cin A3B3 B3' Sel S3 S2S1S0 Also subtracts!  Twos complement: A – B = A + (–B) = A + B' + 1

11 Problem: Ripple-carry delay Carry propagation limits adder speed ???? A0 B0 C0 S0 A1 B1 C1 S1 A2 B2 C2 S2 A3 B3 C3 S3 Cout

12 Ripple-carry C out takes two @0 Except when C in arrives late

13 Ripple-carry delay A0 B0 C0 A1 B1 A2 B2 A3 B3

14 Can we be more clever? Let’s compute all the carries in parallel  Derive carries from the data inputs Not from intermediate carries Use two-level logic  Compute all sums in parallel  How do we do that??? A0 B0 Cin S0 A1 B1 C1 S1 A2 B2 C2 S2 A3 B3 C3 S3 C4

15 Call this PROPAGATE Call this GENERATE Speeding up the adder Need to find a way to “predict” Cout for all bits without knowing what Cin is Predict Cout Predict Cout Predict Cout Cout is always 0 Cout is 0 if Cin is 0 Cout is 1 if Cin is 1 Cout is always Predict Cout Cout is 0 if Cin is 0 Cout is 1 if Cin is 1

16 Lookahead logic: Pi and Gi Step 1: Getting Pi and Gi  Carry generate: Gi = AiBi Generate carry when A = B = 1  Carry propagate: Pi = Ai xor Bi Propagate carry-in to carry-out when (A xor B) = 1

17 Lookahead logic: Sum and carry Step 2: Calculate Sum and Cout  S i = A i xor B i xor C i = P i xor C i  C i+1 = A i B i + C i (A i xor B i ) = G i + C i P i

18 Lookahead logic: Carries Step 3: Express all carries in terms of C0, G, and P  Derive intermediate results directly from inputs rather than from carries  Allows "sum" computations to proceed in parallel C 1 = G 0 + P 0 C 0 C 2 = G 1 + P 1 C 1 = G 1 + P 1 G 0 + P 1 P 0 C 0 C 3 = G 2 + P 2 C 2 = G 2 + P 2 G 1 + P 2 P 1 G 0 + P 2 P 1 P 0 C 0 C 4 = G 3 + P 3 C 3 = G 3 + P 3 G 2 + P 3 P 2 G 1 + P 3 P 2 P 1 G 0 + P 3 P 2 P 1 P 0 C 0

19 Lookahead logic: Carries C1 C0 P0 G0 C0 P0 G0 P1 G1 C2 C0 P0 G0 P1 G1 P2 G2 C3 G3 C0 P0 G0 P1 G1 P2 G2 P3 C4 Logic complexity increases with adder size

20 Lookahead logic: Sum 1 gate delay Ci 2 gate delays Bi Ai 1 gate delay

21 Lookahead logic timing A0 B0 C0 A1 B1 A2 B2 A3 B3 C 2 = G 1 + P 1 C 1 C 3 = G 2 + P 2 C P0 G0 P1 G1 P2 G2 P3 G3 C 4 = G 3 + P 3 C 3 = G 1 + P 1 G 0 + P 1 P 0 C = G 2 + P 2 G 1 + P 2 P 1 G 0 + P 2 P 1 P 0 C 0 = G 3 + P 3 G 2 + P 3 P 2 G 1 + P 3 P 2 P 1 G 0 + P 3 P 2 P 1 P 0 C 0 C 1 = G 0 + P 0 @4 1 gate delay Ci 2 gate delays Bi Ai 1 gate delay

22 Summary: Lookahead logic Compute all the carries in parallel  Derive carries from data inputs not from intermediate carries  Compute all sums in parallel using two-level logic Cascade simple adders to make large adders Speed improvement Complex combinational logic A0 B0 Cin A1 B1 A2 B2 A3 B3