ECE 301 – Digital Electronics

Slides:



Advertisements
Similar presentations
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
Advertisements

Comparator.
Arithmetic Functions and Circuits
Lecture Adders Half adder.
ELEC353 S. al Zahir UBC Sign-Magnitude Representation High order bit is sign: 0 = positive (or zero), 1 = negative Low order bits represent the magnitude:
Addition (2). Outline Full Adder 3-Bit Adder 2’s Complement Subtraction.
Arithmetic Operations and Circuits
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
Chapter 6 Arithmetic. Addition Carry in Carry out
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
Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Chapter 7 Arithmetic Operations and Circuits Hexadecimal Arithmetic 4 binary bits represent a single hexadecimal digit Addition –Add the digits.
CS 105 Digital Logic Design
1 Arithmetic and Logical Operations - Part II. Unsigned Numbers Addition in unsigned numbers is the same regardless of the base. Given a pair of bit sequences.
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
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.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
June 19, 2002Addition and multiplication1 Delays in the ripple carry adder The diagram below shows a 4-bit adder completely drawn out. This is called a.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
5-1 Programmable and Steering Logic Chapter # 5: Arithmetic Circuits.
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.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices X-OR gates and Parity circuits Comparators Adders, subtractors,
1 CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits 4-1,2: Iterative Combinational Circuits and Binary Adders.
Combinational Circuits
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
COMP541 Arithmetic Circuits
Computer Architecture Lecture 16 Fasih ur Rehman.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
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
1 Fundamentals of Computer Science Combinational Circuits.
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
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.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Integer Operations Computer Organization and Assembly Language: Module 5.
UNIT 2. ADDITION & SUBTRACTION OF SIGNED NUMBERS.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
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.
Addition and multiplication1 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.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Digital Arithmetic Wen-Hung Liao, Ph.D..
ECE 331 – Digital System Design
Chapter 5 – Number Representation and Arithmetic Circuits
Presentation transcript:

ECE 301 – Digital Electronics Multi-bit Adder Circuits, Multiplier Circuit, and Magnitude Comparator Circuit (Lecture #11)

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

ECE 301 - Digital Electronics Carry Lookahead Adder ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder Carry Propagate 1 1 1 1 1 1 1 1 1 1 X + 1 1 1 1 Y 1 1 1 1 Carry End Carry Generate ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder Carry Generate Gi = Xi . Yi Always generates a carry if Gi evaluates to true. Carry Propagate Pi = Xi xor Yi Propagates a carry if Pi evaluates to true AND there is a carry-in into the adder stage. Carry-in into the first adder stage. Carry-out generated in the previous adder stage. ECE 301 - Digital Electronics

The Full Adder in terms of Pi and Gi Pi = Ai xor Bi Si = Ai xor Bi xor Ci Ci+1 = Ai.Bi + Ai.Ci + Bi.Ci Gi = Ai.Bi ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder The Carry Generate (Gi) and Carry Propagate (Pi) can be created directly from the inputs. no ripple delay only 1 gate delay ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder Cout,i is a function of Gi and Pi Cout,i = (Xi.Yi) + ( (Xi + Yi).(Cin,i) ) This is the Cout of the Full Adder Cout,i = (Gi) + ( (Pi).(Cin,i) ) where Cin,i = Cout,i-1 ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder For the LSB, Cout,0 = (G0) + ( (P0).(Cin,0) ) no ripple delay ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder For LSB+1: Cout,1 = (G1) + ( (P1) . Cin,1 ) Cout,1 = (G1) + ( (P1) . Cout,0 ) Cout,1 = (G1) + ( (P1) . (G0 + P0.Cin,0) ) Cout,1 = G1 + P1.G0 + P1.P0.Cin,0 All G and P terms derived directly from associated inputs No ripple delay ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder For LSB+2: Cout,2 = (G2) + ( (P2) . Cin,2 ) Cout,2 = (G2) + ( (P2) . Cout,1 ) Cout,2 = (G2) + ( (P2) . (G1 + P1.Cin,1) ) Cout,2 = (G2) + ( (P2) . (G1 + P1.Cout,0) ) Cout,2 = G2 + P2.G1 + P2.P1.Cout,0 Similar for LSB+3, LSB+4, etc. Must be expanded in terms of G0, P0, and Cin,0 ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder Sum: Si is a function of Xi, Yi, and Cin,i Si = Xi xor Yi xor Cin,i Si = Xi xor Yi xor Cout,i-1 Carry: Cout,i derived from Gi and Pi Gi and Pi are functions of the inputs Carries do not ripple from one stage to the next Delay ~ log2(n) Area required ~ (n)*(log2(n)) Greater than area required for RCA ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Carry Lookahead Adder ECE 301 - Digital Electronics

74LS283: 4-bit Binary Adder with Fast Carry Carry Lookahead Adder 74LS283: 4-bit Binary Adder with Fast Carry ECE 301 - Digital Electronics

Adder/Subtractor using 2's Complement ECE 301 - Digital Electronics

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 its (positive) magnitude in Two’s Complement representation Must detect overflow ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Adder / Subtractor ECE 301 - Digital Electronics

ECE 301 - Digital Electronics 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 4-bit Adder) Overflow = X3.Y3.S3' + X3'.Y3'.S3 Overflow = C3 xor C4 = C3'.C4 + C3.C4' ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Multiplier Circuit ECE 301 - Digital Electronics

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

Binary Multiplication  1 1 1 0 1 0 1 1 1 0 0 1 1 0 1 0 Multiplicand M Multiplier Q Product P (11) (14) (154) + 1 0 1 0 1 0 0 0 0 0 1 0 1 0 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 301 - Digital Electronics

Binary Multiplication M (Multiplicand) = m3m2m1m0 Q (Multiplier) = q3q2q1q0 PP0 = m3.q0 m2.q0 m1.q0 m0.q0 partial product 0 pp03 pp02 pp01 pp00 + m3.q1 m2.q1 m1.q1 m0.q1 0 PP1 = pp14 pp13 pp12 pp11 pp10 ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Multiplier Circuit PP1 PP2 ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Multiplier Circuit Bit of PPi ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator How many rows are there in the Truth Table for an n-bit magnitude comparator? For a 2-bit magnitude comparator 4 inputs, 16 rows For a 3-bit magnitude comparator 6 inputs, 64 rows For an n-bit magnitude comparator 2n inputs, 22n rows ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator Designing a magnitude comparator using a Truth Table is too cumbersome. The magnitude comparator has a certain amount of regularity. Take advantage of the regularity. Design the circuit using an algorithm. ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator A = a3a2a1a0 B = b3b2b1b0 Xi = ai.bi + ai'.bi' = ai xnor bi (equivalence) (A = B): X3.X2.X1.X0 ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator A = a3a2a1a0 B = b3b2b1b0 Xi = ai.bi + ai'.bi' = ai xnor bi (equivalence) (A = B): X3.X2.X1.X0 (A > B): a3b3' + X3a2b2' + X3X2a1b1' + X3X2X1a0b0' ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator A = a3a2a1a0 B = b3b2b1b0 Xi = ai.bi + ai'.bi' = ai xnor bi (equivalence) (A = B): X3.X2.X1.X0 (A > B): a3b3' + X3a2b2' + X3X2a1b1' + X3X2X1a0b0' (A < B): a3'b3 + X3a2'b2 + X3X2a1'b1 + X3X2X1a0'b0 ECE 301 - Digital Electronics

ECE 301 - Digital Electronics Magnitude Comparator ECE 301 - Digital Electronics