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.

Slides:



Advertisements
Similar presentations
Overview Part 2 – Combinational Logic Functions and functional blocks
Advertisements

Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 7 – Registers.
Arithmetic Functions and Circuits
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
DPSD This PPT Credits to : Ms. Elakya - AP / ECE.
Overview Iterative combinational circuits Binary adders
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 2 – Chapter.
Henry Hexmoor1 Chapter 5 Arithmetic Functions Arithmetic functions –Operate on binary vectors –Use the same subfunction in each bit position Can design.
CSE-221 Digital Logic Design (DLD)
1 CS 140 Lecture 14 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego Some slides from Harris and Harris.
Overview Iterative combinational circuits Binary adders
L9 – Arithmetic Circuits 1 Comp 411 – Fall /14/09 Arithmetic Circuits Didn’t I learn how to do addition in the second grade?
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 3 – Combinational.
Overview Iterative combinational circuits Binary adders
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 4 Technology.
Overview Iterative combinational circuits Binary adders
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.
CS 105 Digital Logic Design
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.
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
Digital Arithmetic and Arithmetic Circuits
IKI a-Combinatorial Components Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
Chapter 6-1 ALU, Adder and Subtractor
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
Arithmetic Functions and Circuits
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
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.
CHAPTER 4 Combinational Logic Design- Arithmetic Operation (Section 4.6&4.9)
COE 202: Digital Logic Design Combinational Circuits Part 2 KFUPM Courtesy of Dr. Ahmad Almulhem.
Computer Organization Department of CSE, SSE Mukka Chapter 6 : ARITHMETIC | Website for students | VTU NOTES.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
1 CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits 4-1,2: Iterative Combinational Circuits and Binary Adders.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
COMP541 Arithmetic Circuits
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 3 – Chapter.
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.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
COMP541 Arithmetic Circuits
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 10 Multiplexers MUX: –Selects binary information from one of many input lines and.
Digital Design Module –II Adders Amit Kumar Assistant Professor SCSE, Galgotias University, Greater Noida.
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 5: Arithmetic Circuits Chapter 5 (minus 5.3.4)
CPEN Digital System Design
Addition, Subtraction, Logic Operations and ALU Design
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 CS 151 : Digital Design Chapter 4: Arithmetic Functions and Circuits 4-3 : Binary Subtraction.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
CS151 Introduction to Digital Design Chapter 4: Arithmetic Functions and HDLs 4-1: Iterative Combinational Circuits 4-2: Binary Adders 1Created by: Ms.Amany.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
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.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Haifeng Liu 2014 Fall College of Computer Science and Technology, Zhejiang University Chapter 4 – Arithmetic Functions and Circuits.
Lecture 3 – Binary Arithmetic
Arithmetic Functions & Circuits
EE2174: Digital Logic and Lab
Overview Part 1 - Registers, Microoperations and Implementations
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Overview Iterative combinational circuits Binary adders
ECE 352 Digital System Fundamentals
Lecture 4 – Binary Logic and Logic Gates
Presentation transcript:

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 Fundamentals Lecture 16: Unsigned Arithmetic

Chapter 5 2 Overview  Iterative combinational circuits  Binary adders Half and full adders Ripple carry and carry lookahead adders  Unsigned Binary subtraction  Complement Radix Complement Diminished Radix Complement  Subtraction Using Complements

Chapter 5 3 Iterative Combinational Circuits  Arithmetic functions Operate on binary vectors Use the same subfunction in each bit position  Can design functional block for subfunction and repeat to obtain functional block for overall function  Cell - subfunction block  Iterative array - a array of interconnected cells  An iterative array can be in a single dimension (1D) or multiple dimensions

Chapter 5 4 Block Diagram of a 1D Iterative Array  Example: n = 32 Number of inputs = ? Truth table rows = ? Equations with up to ? input variables Equations with huge number of terms Design impractical!  Iterative array takes advantage of the regularity to make design feasible

Chapter 5 5 Functional Blocks: Addition  Binary addition used frequently  Addition Development: Half-Adder (HA), a 2-input bit-wise addition functional block, Full-Adder (FA), a 3-input bit-wise addition functional block, Ripple Carry Adder, an iterative array to perform binary addition, and Carry-Look-Ahead Adder (CLA), a hierarchical structure to improve performance.

Chapter 5 6 Functional Block: Half-Adder  A 2-input, 1-bit width binary adder that performs the following computations:  A half adder adds two bits to produce a two-bit sum  The sum is expressed as a sum bit, S and a carry bit, C  The half adder can be specified as a truth table for S and C  X Y C S X Y C S

Chapter 5 7 Implementations: Half-Adder  The most common half adder implementation is: (e) YXC YXS   X Y C S

Chapter 5 8 Functional Block: Full-Adder  A full adder is similar to a half adder, but includes a carry-in bit from lower stages. Like the half-adder, it computes a sum bit, S and a carry bit, C. For a carry-in (Z) of 0, it is the same as the half-adder: For a carry- in (Z) of 1: Z0000 X Y C S Z1111 X Y C S

Chapter 5 9 Logic Optimization: Full-Adder  Full-Adder Truth Table:  Full-Adder K-Map: XYZCS X Y Z S X Y Z C

Chapter 5 10 Equations: Full-Adder  From the K-Map, we get:  The S function is the three-bit XOR function (Odd Function):  The Carry bit C is 1 if both X and Y are 1 (the sum is 2), or if the sum is 1 and a carry-in (Z) occurs. Thus C can be re-written as:  The term X·Y is carry generate.  The term X  Y is carry propagate. Can also be implemented as (X+Y) ZYZXYXC ZYXZYXZYXZYXS   ZYXS  Z)YX(YXC 

Chapter 5 11 Implementation: Full Adder  Full Adder Schematic  Here X, Y, and Z, and C (from the previous pages) are A, B, C i and C o, respectively. Also, G = generate and P = propagate.  Note: This is really a combination of a 3-bit odd function (for S)) and Carry logic (for C o ): (G = Generate) OR (P =Propagate AND C i = Carry In) Co  G + P · Ci AiAi BiBi CiCi C i+1 GiGi PiPi SiSi

Chapter 5 12 Binary Adders  To add multiple operands, we “bundle” logical signals together into vectors and use functional blocks that operate on the vectors  Example: 4-bit ripple carry adder: Adds input vectors A(3:0) and B(3:0) to get a sum vector S(3:0)  Note: carry out of cell i becomes carry in of cell i + 1 Description Subscript Name Carry In CiCi Augend AiAi Addend BiBi Sum SiSi Carry out C i+1

Chapter bit Ripple-Carry Binary Adder  A four-bit Ripple Carry Adder made from four 1-bit Full Adders:

Chapter 5 14 Carry Propagation & Delay  Propagation delay: Carry must ripple from LSB to MSB.  The gate-level propagation path for a 4-bit ripple carry adder of the last example:  Too slow for many bits (e.g. 32 or 64)

Chapter 5 15 Carry Lookahead  Given Stage i from a Full Adder, we know that there will be a carry generated when A i = B i = "1", whether or not there is a carry-in.  Alternately, there will be a carry propagated if the “half-sum” is "1" and a carry-in, C i occurs.  These two signal conditions are called generate, denoted as G i, and propagate, denoted as P i respectively and are identified in the circuit: AiAi BiBi CiCi C i+1 GiGi PiPi SiSi

Chapter 5 16 Carry Lookahead (continued)  In the ripple carry adder: G i, P i, and S i are local to each cell of the adder C i is also local each cell  In the carry lookahead adder, in order to reduce the length of the carry chain, C i is changed to a more global function spanning multiple cells  Defining the equations for the Full Adder in term of the P i and G i : iiiiii BAGBAP  iii1iiii CPGCCPS  

Chapter 5 17 Carry Lookahead Development  Flatten equations for carry using G i and P i terms for less significant bits  Beginning at the cell 0 with carry in C 0 : C 1 = G 0 + 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 C 2 = G 1 + P 1 C 1 = G 1 + P 1 (G 0 + P 0 C 0 ) = 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 1 G 0 + P 1 P 0 C 0 ) = G 2 + P 2 G 1 + P 2 P 1 G 0 + P 2 P 1 P 0 C 0

Chapter 5 18 Group Carry Lookahead Logic  Directly generating carry for 4 bits results in Fan-in of 5 for AND gate and fan-in of 5 for OR gate Beyond 4 bits is not feasible due to increased fan-in Use hierarchy instead!  Consider group generate (G 0-3 ) and group propagate (P 0-3 ) functions:  Using these two equations:  Thus, it is possible to have four 4-bit adders use one of the same carry lookahead circuit to speed up 16-bit addition PPPPP GPPPPGPPGPGG     CPGC  

Chapter 5 19 Carry Lookahead Example  Specifications: 16-bit CLA Delays:  NOT = 1  XOR = 3  AND-OR = 2  Longest Delays: Ripple carry adder =  = 36 CLA =  = 12  Delay is proportional to log 2 (bits) CLA

Chapter 5 20 Unsigned Subtraction  Algorithm: Subtract N from M If no end borrow occurs, then M  N, and the result is a non-negative number and correct. If an end borrow occurs, then N > M and we really have M  N + 2 n due to the final borrow  Correct by subtracting from 2 n, and appending minus sign  Examples:  0111   1101 (  ) 0011

Chapter 5 21 Unsigned Subtraction (continued)  The subtraction, 2 n  N, is taking the 2’s complement of N  To do both unsigned addition and unsigned subtraction requires:  Quite complex!  Goal: Shared simpler logic for both addition and subtraction  Introduce complements as an approach

Chapter 5 22 Complements  Two complements: Diminished Radix Complement of N  (r  1)’s complement for radix r  1’s complement for radix 2  Defined as (r n     Radix Complement  r’s complement for radix r  2’s complement in binary  Defined as r n  N  Subtraction is done by adding the complement of the right-hand side  If result is negative, take complement and add ‘-’

Chapter 5 23 Binary 1's Complement  For r = 2, N = , n = 8 (8 digits): (r n – 1) = = or  The 1's complement of is then: –  Since the 2 n – 1 factor consists of all 1's and since 1 – 0 = 1 and 1 – 1 = 0, the one's complement is obtained by complementing each individual bit (bitwise NOT).

Chapter 5 24 Binary 2's Complement  For r = 2, N = , n = 8 (8 digits), we have: (r n ) = or  The 2's complement of is then: –  Note the result is the 1's complement plus 1, a fact that can be used in designing hardware

Chapter 5 25 Alternate 2’s Complement Method  Given: an n-bit binary number, beginning at the least significant bit and proceeding upward: Copy all least significant 0’s Copy the first 1 Complement all bits thereafter.  2’s Complement Example: Copy underlined bits: 100 and complement bits to the left:

Chapter 5 26 Subtraction with 2’s Compleme nt  For n-digit, unsigned numbers M and N, find M  N in base 2: Add the 2's complement of N to M: M + (2 n  N) = M  N + 2 n = 2 n  (N  M) If M  N, the sum produces end carry 2 n which is discarded; from above, M  N remains. If M < N, the sum does not produce an end carry and, from above, is equal to 2 n  ( N  M ), the 2's complement of ( N  M ). To obtain the result  (N – M), take the 2's complement of the sum and place a ‘  ’ to its left.

Chapter 5 27 Unsigned 2’s Complement Subtraction Example 1  Find – –  The carry of 1 indicates that no correction of the result is required. 1 2’s comp

Chapter 5 28 Unsigned 2’s Complement Subtraction Example 2  Find – –  The carry of 0 indicates that a correction of the result is required.  Result = – ( ) 0 2’s comp

Chapter 5 29 Summary  Iterative combinational circuits  Binary adders Half and full adders Ripple carry and carry lookahead adders  Unsigned Binary subtraction  Complement Radix Complement Diminished Radix Complement  Subtraction Using Complements

Chapter 5 30 Terms of Use  © 2004 by Pearson Education,Inc. All rights reserved.  The following terms of use apply in addition to the standard Pearson Education Legal Notice.Legal Notice  Permission is given to incorporate these materials into classroom presentations and handouts only to instructors adopting Logic and Computer Design Fundamentals as the course text.  Permission is granted to the instructors adopting the book to post these materials on a protected website or protected ftp site in original or modified form. All other website or ftp postings, including those offering the materials for a fee, are prohibited.  You may not remove or in any way alter this Terms of Use notice or any trademark, copyright, or other proprietary notice, including the copyright watermark on each slide.  Return to Title Page Return to Title Page