Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Advertisements

Modular Combinational Logic
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
Comparator.
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.
Lecture Adders Half adder.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
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
Overview Iterative combinational circuits Binary adders
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Overview Iterative combinational circuits Binary adders
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
Overview Iterative combinational circuits Binary adders
ENGIN112 L14: Binary Adder Subtractor October 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 14 Binary Adders and Subtractors.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 4 – Arithmetic Functions Logic and Computer.
Adders, subtractors, ALUs
CS 105 Digital Logic Design
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Digital Arithmetic and Arithmetic Circuits
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
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.
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
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
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.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices X-OR gates and Parity circuits Comparators Adders, subtractors,
9/15/09 - L15 Decoders, Multiplexers Copyright Joanne DeGroat, ECE, OSU1 Decoders and Multiplexer Circuits.
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.
Lecture 4. Adder & Subtractor Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
N, Z, C, V in CPSR with Adder & Subtractor Prof. Taeweon Suh Computer Science Education Korea University.
Combinational Circuits
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)
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
CS 151: Digital Design Chapter 4: Arithmetic Functions and Circuits
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Prof. Hsien-Hsin Sean Lee
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.
CS151 Introduction to Digital Design Chapter 4: Arithmetic Functions and HDLs 4-1: Iterative Combinational Circuits 4-2: Binary Adders 1Created by: Ms.Amany.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
Lecture 7. Subtractor Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Logic Design.
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.
Reference: Moris Mano 4th Edition Chapter 4
Principles & Applications
ECE 331 – Digital System Design
King Fahd University of Petroleum and Minerals
Arithmetic Functions & Circuits
Unit 5 COMBINATIONAL CIRCUITS-1
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Overview Iterative combinational circuits Binary adders
ECE 352 Digital System Fundamentals
Adder Circuits By: Asst Lec. Basma Nazar
Half & Full Subtractor Half Subtractor Full Subtractor.
Half & Full Subtractor Half Subtractor Full Subtractor.
Presentation transcript:

Arithmetic Functions BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering

Iterative Arrays  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

Half Adder (1-bit) ABS(um)C(arry) Half Adder AB S C B A S B A C A B Sum Carry

Full Adder CinABS(um)Cout Full Adder AB S Carry Out (Cout) Carry In (Cin) Cin AB Cin AB

Full Adder A B Cin Cout S H.A. Cout S Half Adder S C A B Half Adder S C A B B A Cin

4-bit Ripple Adder using Full Adder Full Adder AB Cin Cout S S0 A0B0 Full Adder AB Cin Cout S S1 A1B1 Full Adder AB Cin Cout S S2 A2B2 Full Adder AB Cin Cout S S3 A3B3 Carry A B S C Half Adder A B Cin Cout S H.A. Full Adder

Half Subtractor(1-bit) ABDifference (D) Borrow (B) Half Subtractor AB DiffBorrow A B Diff Borrow

Full Subtractor Borrow (in) ABDifference (D) Borrow (out) Full Subtractor AB Difference BorrowOut (Bout) Borrow In (Bin)

4-bit Ripple Subtractor using Full Subtractor AB Bin Bout D D0D0 A0B0 AB Bin Bout D D1D1 A1B1 AB Bin Bout D D2D2 A2B2 Full Subtractor AB Bin Bout D D3D3 A3B3 Borrow Full Subtractor Full Subtractor Full Subtractor

Adder/Subtractor Design  A – B = A + (-B)  Take 2’s complement of B  Perform addition of A and 2’s complement of B Full Adder AB Cin Cout S S0 A0 Full Adder AB Cin Cout S S1 A1 Full Adder AB Cin Cout S S2 A2 Full Adder AB Cin Cout S S3 A3 B0B1B2B3 C Subtract

Overflow/Underflow (+72) (+57) +__________ (+129) 8-bit Signed number addition (-127) (-6) -_____________ (-133) 8-bit Signed number addition Cn-1 = 1 Cn = 0 Cn-1 = 0 Cn = 1 What is largest positive number represented by 8-bit? What is smallest negative number represented by 8-bit?

Overflow/Underflow Detection C n-1 A n-1 B n-1 S n-1 CnCn OF  Examine the MSB bit  Bottom line:  P: positive; N: negative  N + N = N  P + P = P  P+N or N+P always fall into the range  E.g P cannot be smaller than -128 or bigger than 127  Problem lies in  N+N = P  P+P = N Discarded

Overflow/Underflow Detection C n-1 A n-1 B n-1 S n-1 CnCn OF Discarded

Overflow/Underflow Detection AB Cin Cout S S0 A0B0 AB Cin Cout S S1 A1B1 AB Cin Cout S S2 A2B2 AB Cin Cout S S3 A3B3 Carry Overflow/ Underflow n-bit Adder/Subtractor Overflow/ Underflow Cn Cn-1

Design by Contraction  Contraction is a technique for simplifying the logic in a functional block to implement a different function  Contraction of a ripple carry adder to incrementer for n = 3  Set B = 001

Unsigned Integer Multiplier (2-bit) s carry carry out p0 a0b0 H.A. p1 c s a1b0 a0b1 H.A. c s p2p3 a1b1

Unsigned Integer Multiplier (3-bit) p0 a0b0 s F.A. p1 a1b0a0b1 0 co s ci c F.A. p2 s a2b0 a1b1 co s ci c F.A. s co s ci a0b2 00 c F.A. p3 a2b1 co s ci c F.A. co s ci a1b2 0 s s s c p4 c F.A. co s ci a2b2 p5

Multiplication by a Constant  Multiplication of B(3:0) by 101 B 1 B 2 B B 0 B 1 B 2 B 3 Carry output 4-bit Adder Sum B 0 C 0 C 1 C 2 C 3 C 4 C 5 C 6