ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)

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

Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
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.
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
Comparator.
Lecture Adders Half adder.
DPSD This PPT Credits to : Ms. Elakya - AP / ECE.
Arithmetic Operations and Circuits
ECE 331 – Digital System Design
Space vs. Speed: Binary Adders 11.3 Space vs. Speed.
EECS Components and Design Techniques for Digital Systems Lec 18 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
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
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
ECE 301 – Digital Electronics
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
ECE 331 – Digital System Design
AND Gate: A Logic circuit whose output is logic ‘1’ if and only if all of its inputs are logic ‘1’.
CS 105 Digital Logic Design
Binary Arithmetic Stephen Boyd March 14, Two's Complement Most significant bit represents sign. 0 = positive 1 = negative Positive numbers behave.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
Digital Arithmetic and Arithmetic Circuits
ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
CHAPTER 4 Combinational Logic Design- Arithmetic Operation (Section 4.6&4.9)
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
Combinational Circuits
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 16 Fasih ur Rehman.
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 5: Arithmetic Circuits Chapter 5 (minus 5.3.4)
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
Copied with Permission from prof. Mark PSU ECE
Addition, Subtraction, Logic Operations and ALU Design
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Number Representation and Arithmetic Circuits
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
Explain Half Adder and Full Adder with Truth Table.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Arithmetic Circuits I. 2 Iterative Combinational Circuits Like a hierachy, except functional blocks per bit.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Space vs. Speed: Binary Adders
ENG6530 Reconfigurable Computing Systems
ECE 331 – Digital System Design
Chapter 5 – Number Representation and Arithmetic Circuits
ECE 331 – Digital System Design
Presentation transcript:

ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)

ECE Digital System Design2 Implementations of Multi-bit Adders: 1. Ripple Carry Adder 2. Carry Lookahead Adder

ECE Digital System Design3 Ripple Carry Adder Multi-bit Adder Circuits

ECE Digital System Design4 FA x n –1 c n c n1” y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple Carry Adder Carry ripples from one stage to the next Carry-in Carry-out

ECE Digital System Design5 Ripple Carry Adder in VHDL 22 2

ECE Digital System Design6 Ripple Carry Adder in VHDL library ieee; use ieee.std_logic_1164.all; use work.pack.all; ENTITY add3bit IS PORT (a : IN std_logic_vector(2 downto 0); b : IN std_logic_vector(2 downto 0); cin : IN std_logic; s : OUT std_logic_vector(2 downto 0); cout : OUT std_logic); END add3bit;

ECE Digital System Design7 Ripple Carry Adder in VHDL ARCHITECTURE struct OF add3bit IS SIGNAL cin1, cin2: std_logic; BEGIN fa0: fa PORT MAP(a(0),b(0), cin, s(0), cin1 ); fa1: fa PORT MAP(a(1),b(1), cin1, s(1), cin2 ); fa2: fa PORT MAP(a(2),b(2), cin2, s(2), cout ); END struct;

ECE Digital System Design8 Ripple Carry Adder in VHDL CinCout ARCHITECTURE struct OF add3bit IS SIGNAL cin1, cin2: std_logic; BEGIN fa0: fa PORT MAP(a(0),b(0), cin, s(0), cin1 ); fa1: fa PORT MAP(a(1),b(1), cin1, s(1), cin2 ); fa2: fa PORT MAP(a(2),b(2), cin2, s(2), cout ); END struct;

ECE Digital System Design9 Ripple Carry Adder in VHDL ARCHITECTURE struct OF add3bit IS SIGNAL cy : std_logic_vector (3 downto 0); BEGIN fa0: fa PORT MAP(a(0),b(0),cy(0), s(0), cy(1)); fa1: fa PORT MAP(a(1),b(1),cy(1), s(1), cy(2)); fa2: fa PORT MAP(a(2),b(2),cy(2), s(2), cy(3)); END struct; CinCout

ECE Digital System Design10 Ripple Carry Adder in VHDL ARCHITECTURE struct OF add3bit IS SIGNAL cy : std_logic_vector (3 downto 0); BEGIN Adders: FOR i IN 0 TO 2 GENERATE myfa:fa PORT MAP(a(i),b(i),cy(i),s(i),cy(i+1)); END GENERATE; cout <= cy(3); cy(0) <= cin; END struct;

ECE Digital System Design11 The Ripple Carry Adder is slow! Why? How can the speed of the adder be increased?

ECE Digital System Design12 Increasing the speed of the Adder Method A: Include all inputs and outputs in the design  Inputs = X i, Y i, C in,i ; Outputs = S i, C out,i 1-bit3 inputs2 outputs 2-bit5 inputs3 outputs 4-bit9 inputs5 outputs n-bit2n+1 inputsn+1 outputs  Large number of operands, but only 2 logic levels Increase in speed Increase in area required decrease propagation delay increase # of logic gates Use Truth Table and K-Map to derive logic functions

ECE Digital System Design13 Increasing the speed of the Adder Method B: Manipulate the Boolean Expressions

ECE Digital System Design14 Carry Lookahead Adder Multi-bit Adder Circuits

ECE Digital System Design15 Carry Lookahead Adder Carry Generate 1101 Carry End 11 Carry Propagate X Y

ECE Digital System Design16 Carry Lookahead Adder Carry Generate  G i = X i. Y i  Always generates a carry if G i evaluates to true. Carry Propagate  P i = X i + Y i  Generates a carry if P i evaluates to true AND there was a Carry-In. Propagates the Carry-In if true.

ECE Digital System Design17

ECE Digital System Design18 Carry Lookahead Adder The Carry Generate (G i ) and Carry Propagate (P i ) can be created directly from the inputs. no ripple delay only 1 gate delay

ECE Digital System Design19 Carry Lookahead Adder C out,i is a function of G i and P i C out,i = (X i.Y i ) + ( (X i + Y i ).(C in,i ) )  This is the C out of the Full Adder C out,i = (G i ) + ( (P i ).(C in,i ) )  where C in,i = C out,i-1

ECE Digital System Design20 Carry Lookahead Adder For the LSB,  C out,i = (G 0 ) + ( (P 0 ).(C in,0 ) )  no ripple delay

ECE Digital System Design21 Carry Lookahead Adder For LSB+1:  C out,1 = (G 1 ) + ( (P 1 ). C in,1 )  C out,1 = (G 1 ) + ( (P 1 ). C out,0 )  C out,1 = (G 1 ) + ( (P 1 ). (G 0 + P 0.C in,0 ) )  C out,1 = G 1 + P 1.G 0 + P 1.P 0.C in,0 All G and P terms derived directly from associated inputs No ripple delay

ECE Digital System Design22 Carry Lookahead Adder For LSB+2:  C out,2 = (G 2 ) + ( (P 2 ). C in,2 )  C out,2 = (G 2 ) + ( (P 2 ). C out,1 )  C out,2 = (G 2 ) + ( (P 2 ). (G 1 + P 1.C in,1 ) )  C out,2 = (G 2 ) + ( (P 2 ). (G 1 + P 1.C out,0 ) )  C out,2 = G 2 + P 2.G 1 + P 2.P 1.C out,0 Similar for LSB+3, LSB+4, etc. Must be expanded in terms of G 0, P 0, and C in,0

ECE Digital System Design23 x 1 y 1 g 1 p 1 s 1 x 0 y 0 s 0 c 2 x 0 y 0 c 0 c 1 g 0 p 0

ECE Digital System Design24 Carry Lookahead Adder Sum: S i is a function of X i, Y i, and C in,i  S i = X i xor Y i xor C in,i  S i = X i xor Y i xor C out,i-1 Carry: C out,i derived from G i and P i  G i and P i are functions of the inputs Carries do not ripple from one stage to the next  Delay ~ log 2 (n)  Area required ~ (n)*(log 2 (n)) Greater than area required for RCA

ECE Digital System Design25 Carry Lookahead Adder 74LS283: 4-bit Binary Adder with Fast Carry

ECE Digital System Design26 Hierarchical Design: Building a bigger Adder Multi-bit Adder Circuits

ECE Digital System Design27 Block x 3124– c 32 c 24 y 3124– s 3124– x 158– c 16 y 158– s 8– c 8 x 70– y 70– s 70– c 0 3 Block 1 0 Hierarchical Design Carry Lookahead Adder Ripple carry (between blocks)

ECE Digital System Design28 Adder / Subtractor using Two's Complement

ECE Digital System Design29 Adder / Subtractor using Two’s Complement Could build separate binary adder and subtractor  Not common Use Two’s Complement integer representation  Addition uses binary adder  Subtraction uses binary adder with the Two’s Complement representation for the subtrahend Issues  Cannot directly convert the most negative n-bit binary number to Two’s complement representation  Must detect overflow

ECE Digital System Design30 Adder / Subtractor

ECE Digital System Design31 Detecting Overflow Compare sign of operands with sign of result  Overflow occurs if operands have same sign and result has different sign Addition of two positive #s results in negative # Addition of two negative #s results in positive # Logic function(s) for overflow (for a 4-bit Adder)  Overflow = X 3.Y 3.S 3 ' + X 3 '.Y 3 '.S 3  Overflow = C 3 xor C 4 = C 3 '.C 4 + C 3.C 4 '

ECE Digital System Design32 Multiplier Circuit

ECE Digital System Design33 Multiplier Circuit Multiplication requires two basic operations:  Addition  Logical Shift A binary multiplier circuit can be designed hierarchically using  Full Adders  AND gates

ECE Digital System Design34 Binary Multiplication  Multiplicand M Multiplier Q Product P (11) (14) (154) Partial product 0 Partial product 1 Partial product 2 4 bits 8 bits # of bits in P = # of bits in M + # of bits in Q

ECE Digital System Design35 Binary Multiplication M (Multiplicand) = m 3 m 2 m 1 m 0 Q (Multiplier) = q 3 q 2 q 1 q 0 PP0 = m 3.q 0 m 2.q 0 m 1.q 0 m 0.q 0 0pp0 3 pp0 2 pp0 1 pp0 0 +m 3.q 1 m 2.q 1 m 1.q 1 m 0.q 1 0 PP1 = pp1 4 pp1 3 pp1 2 pp1 1 pp1 0 partial product

ECE Digital System Design36 Multiplier Circuit PP1 PP2

ECE Digital System Design37 Multiplier Circuit Bit of PPi