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.

Slides:



Advertisements
Similar presentations
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
Advertisements

CPE 626 CPU Resources: Adders & Multipliers Aleksandar Milenkovic Web:
Arithmetic for Computers
Chapter 4 -- Modular Combinational Logic. Decoders.
Lecture 19: Hardware for Arithmetic Today’s topic –Designing an ALU –Carry Look-Ahead Adder 1.
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.
Datorteknik ArithmeticCircuits bild 1 Computer arithmetic Somet things you should know about digital arithmetic: Principles Architecture Design.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
Lecture 20: Hardware for Arithmetic Today’s topic –Carry Look-Ahead Adder 1.
DPSD This PPT Credits to : Ms. Elakya - AP / ECE.
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.
Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
1 Lecture 4: Arithmetic for Computers (Part 3) CS 447 Jason Bakos.
Computer Structure - The ALU Goal: Build an ALU  The Arithmetic Logic Unit or ALU is the device that performs arithmetic and logical operations in the.
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
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
1  1998 Morgan Kaufmann Publishers Chapter Four Arithmetic for Computers.
Chapter 3 Arithmetic for Computers. Arithmetic Where we've been: Abstractions: Instruction Set Architecture Assembly Language and Machine Language What's.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Abdullah Aldahami ( ) Feb26, Introduction 2. Feedback Switch Logic 3. Arithmetic Logic Unit Architecture a.Ripple-Carry Adder b.Kogge-Stone.
Digital Arithmetic and Arithmetic Circuits
Chapter # 5: Arithmetic Circuits
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
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 7: 32-bit ALU, Fast Carry Lookahead Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Computing Systems Designing a basic ALU.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
FPGA-Based System Design: Chapter 4 Copyright  2003 Prentice Hall PTR Topics n Number representation. n Shifters. n Adders and ALUs.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
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.
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Arithmetic: Part II.
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.
1  2004 Morgan Kaufmann Publishers Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let’s review Boolean.
Addition, Subtraction, Logic Operations and ALU Design
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.
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
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.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1.
EE204 L03-ALUHina Anwar Khan EE204 Computer Architecture Lecture 03- ALU.
1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.
Computer Architecture & Operations I
Topics Number representation. Shifters. Adders and ALUs.
Combinational Circuits
CSE Winter 2001 – Arithmetic Unit - 1
Topic 3b Computer Arithmetic: ALU Design
Arithmetic Circuits (Part I) Randy H
Lecture 11: Hardware for Arithmetic
Topic 3b Computer Arithmetic: ALU Design
COMS 361 Computer Organization
Combinational Circuits
74LS283 4-Bit Binary Adder with Fast Carry
Presentation transcript:

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 a previous addition/adder –Single bit output for the sum. –Second output to pass on the carry.

3 ECE 4436ECE 5367 Concepts I/P output specification – 1 bit adder Input s Output s abCarry in Carry out SumComments = 00 two = 01 two = 01 two = 10 two = 01 two = 10 two = 10 two = 11 two

4 ECE 4436ECE 5367 Concepts Logical equations CarryOut = (b.CarryIn) + (a.CarryIn) + (a.b) + (a.b.Carryin). –If the last term (a.b.carryin) is true, then one of the first three has to be true so we can leave out the last term CarryOut = (b.CarryIn) + (a.CarryIn) + (a.b). Sum = 1 when exactly one or all three inputs are 1.

5 ECE 4436ECE 5367 Hardware for CarryOut signal Input combinations for which we have a carryout Inputs abCarryIn

6 ECE 4436ECE bit logical Unit- &, + Use a mux to select between the two functions – arith. And logic addition. 1-bit selector since we have two operations to select from

7 ECE 4436ECE bit ALU This ALU can perform the logical functions +, &, and the arithmetic fn. Of addition. A 2-bit selector is used to determine which operation is sent to the O/P.

8 ECE 4436ECE bit ALU obtained from 1-bit ALUs.

9 ECE 4436ECE 5367 Subtraction Same as addition. We negate the appropriate operand and then perform the addition. –2’s complement –1’s complement

10 ECE 4436ECE 5367 Subtraction Include a mux which chooses btw b and b. We set the carry in signal to 1: –Remember 2s complement of a number a + b + 1 = a + (b + 1) = a – b *** b +1 = -b (2s complement)

11 ECE 4436ECE 5367 Adder types Ripple carry adder Carry Lookahead adder Skip adder Carry Select adder

12 ECE 4436ECE 5367 Ripple carry adder Created by linking directly the carries of 1-bit adders. –a single carry out of the LSB can ripple all the way through the adder. –this results in a carry out of the MSB Problem: The computation is time consuming.

13 ECE 4436ECE 5367 Carry Lookahead Question: How quickly can we add two operands e.g 32 bit operands? The carry input depends on the operation in the previous 1-bit adder. Looking at the dependencies involved, the MSB of the sum has to wait for each of the preceding bit adders to sequentially evaluate. –PROBLEM : TOO SLOW

14 ECE 4436ECE 5367 Analysis CarryIn2 is exactly = CarryOut1. = (b1.Carryin1) + (a1.Carryin1) + (b1.a1) Similarly CarryIn1 is exactly = CarryOut0. = (b0.Carryin0) + (a0.Carryin0) + (b0.a0) The purpose is to calculate ahead of time and bypass some adders thereby reducing calculation time.

15 ECE 4436ECE 5367 Analysis Using ci = CarryIni: c2 = (b1.c1) + (a1.c1) + (a 1.b1). c1 = (b0.c0) + (a0.c0) + (a 0.b0). This expansion becomes more complex as we move to higher order bits.

16 ECE 4436ECE 5367 Propagate and generate Attempt is to limit complexity as well as increasing the speed. Fast carry schemes attempt to do this. Carry Lookahead adder. –Uses levels of abstraction in its implementation. Propagate generate

17 ECE 4436ECE 5367 Propagate & generate C i+1 = (bi.ci) + (ai.ci) + (ai.bi) = (ai.bi) + ci.(ai+bi) Using this formula: c2 = (ai.bi) + (ai+bi). ((a0.b0) + (a0+b0). c0) –generate = gi = (ai.bi). –propagate = pi = (ai+bi). ci+1 = gi + pi. ci gi pi

18 ECE 4436ECE 5367 pi & gi contd. Assuming gi = 1: ci+1 = gi + pi. ci = 1 + pi. ci = 1 –The adder generates a CarryOut(ci+1) independent of the value of CarryIn(ci) if gi=1. Assuming gi = 0 & pi = 1: ci+1 = gi + pi. Ci = 0 + pi. ci = ci –The adder propagtes CarryIn (ci) to a CarryOut.

19 ECE 4436ECE 5367 Logical expressions c1 = g0 + (p0.c0) c2 = g1 + (p1.g0) + (pi.p0.c0) c3 = g2 +(p2.g1) + (p2p1g0) + (p2.p1.p0.c0) c4 = g3 + (p3.g2) + (p3.p2.g1) + (p3.p2.p1.g0) + (p3.p2.p1.p0.c0) Cin propagates a carry if some earlier adder generates a carry and all intermediary adders propagate a carry.

20 ECE 4436ECE nd level of abstraction. Faster => carry lookahead at a higher level. –4-bits adder, we need P0, P1, P2, P3 P0 = p3.p2.p1.p0 P1 = p3.p2.p1.p0 P2 = p3.p2.p1.p0 P3 = p3.p2.p1.p0 ******Super propagate (Pi) is only true if each of the bits will propagate a carry P = super propagate Propagate & generate at higher level

21 ECE 4436ECE 5367 Example P3, G3P2, G2P1, G1P0, G0 Remember, a carry is generated out of position i if gi = 1 or pi = 1 and there was a carryin From the previous position. pi = ai + bi gi = ai.bi

22 ECE 4436ECE nd level of abstraction. Generate Gi. –Is there a carryout of the MSB of the 4-bit addition? A Gi of the MSB is true If gi is true for the MSB If a previous gi is true and all intermediate propagates are true. G0 = g3 + (p3.g2)+(p3.p2.g1)+(p3.p2.p1.g0) G1 = g7 + (p7.g6)+(p7.p6.g5)+(p7.p6.p5.g4) G2 = g11 + (p11.g10)+(p11.p10.g9)+(p11.p10.p9.g8) G3 = g15 + (p15.g14)+(p15.p14.g13)+(p15.p14.p13.g12)

23 ECE 4436ECE 5367 Carryout The carries out of every fourth position is then given by… –C1 = G0 + (P0.c0) –C2 = G1 + (P1.G0) + (P1.P0.c0) –C3 = G2 + (P2.G1) + (P2.P1.G0) + (P2.P1.P0.c0) –C4 = G3 + (P3.G2) + (P3.P2.G1) + (P3.P2.P1.G0) + (P3.P2.P1.P0.c0)

24 ECE 4436ECE 5367

25 ECE 4436ECE 5367 Carry Lookhead Unit  pre-calculated the carry bit

26 ECE 4436ECE 5367 At bit 0

27 ECE 4436ECE 5367 At bit 1

28 ECE 4436ECE 5367 At bit 2

29 ECE 4436ECE 5367 At bit 4

30 ECE 4436ECE 5367 Overall

31 ECE 4436ECE 5367 Total Delay

32 ECE 4436ECE 5367 Extension for 64 bits ?

33 ECE 4436ECE 5367 Basic unit of 4 bits

34 ECE 4436ECE 5367 p and g inputs

35 ECE 4436ECE 5367 Big block

36 ECE 4436ECE 5367

37 ECE 4436ECE 5367 Two-level

38 ECE 4436ECE 5367 P and G ?

39 ECE 4436ECE 5367 Generate the G

40 ECE 4436ECE 5367 Propagate

41 ECE 4436ECE 5367 Big picture

42 ECE 4436ECE 5367 Multiple Level