ENGIN112 L14: Binary Adder Subtractor October 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 14 Binary Adders and Subtractors.

Slides:



Advertisements
Similar presentations
Abdullah Said Alkalbani University of Buraimi
Advertisements

Cs 121 Ch 4-2 Combinational Logic
Adders and Subtractors
Cs 1110 Ch 4-1 Combinational Logic. ° Introduction Logic circuits for digital systems may be: °2°2 combinational sequential OR A combinational circuit.
Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
Comparator.
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
ECE 331 – Digital System Design
Subtractors Module M8.2 Section 6.2. Subtractors Half Subtractor Full Subtractor Adder/Subtractor - 1 Adder/Subtractor - 2.
Binary Subtraction Section 3-9 Mano & Kime. Binary Subtraction Review from CSE 171 Two’s Complement Negative Numbers Binary Adder-Subtractors 4-bit Adder/Subtractor.
Adders Lecture L7.1 Section 6.2 Section 10.4 (pp )
Overview Iterative combinational circuits Binary adders
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
IT Systems Number Operations EN230-1 Justin Champion C208 –
Building Adders & Sub tractors Dr Ahmed Telba. Introducing adder circuits Adder circuits are essential inside microprocessors as part of the ALU, or arithmetic.
CS 105 Digital Logic Design
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Overview of Chapter 4 °Design digital circuit from specification °Digital inputs and outputs known Need to determine logic that can transform data °Start.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Combinational and Sequential Logic Circuits.
Binary Addition Section 4.5. Binary Addition Example.
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
ECE2030 Introduction to Computer Engineering Lecture 12: Building Blocks for Combinational Logic (3) Adders/Subtractors, Parity Checkers Prof. Hsien-Hsin.
Chapter 6-1 ALU, Adder and Subtractor
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
DIGITAL CIRCUITS David Kauchak CS52 – Fall 2015.
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.
Binary Adder DesignSpring Binary Adders. Binary Adder DesignSpring n-bit Addition –Ripple Carry Adder –Conditional Sum Adder –(Carry Lookahead.
ARITHMETIC MICRO OPERATIONS
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
Logic and computers 2/6/12. Binary Arithmetic /6/ Only two digits: the bits 0 and 1 (Think: 0 = F, 1.
COMP541 Arithmetic Circuits
Sep 29, 2004Subtraction (lvk)1 Negative Numbers and Subtraction The adders we designed can add only non-negative numbers – If we can represent negative.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
MIPS ALU. Building from the adder to ALU ALU – Arithmetic Logic Unit, does the major calculations in the computer, including – Add – And – Or – Sub –
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 7 Dr. Shi Dept. of Electrical and Computer Engineering.
COMP541 Arithmetic Circuits
69 Decimal (Base 10) Numbers n Positional system - each digit position has a value n 2534 = 2*1, * *10 + 4*1 n Alternate view: Digit position.
Computer Architecture Lecture 16 Fasih ur Rehman.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
COMBINATIONAL LOGIC.
Addition, Subtraction, Logic Operations and ALU Design
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 8 Dr. Shi Dept. of Electrical and Computer Engineering.
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.
MIPS ALU. Exercise – Design a selector? I need a circuit that takes two input bits, a and b, and a selector bit s. The function is that if s=0, f=a. if.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
Electrical Engineering Engineering the Future Digital Circuits Fundamentals Hands-on Full-Adder Simulation (afternoon)
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.
1 Review of Boolean algebra Not is a horizontal bar above the number –0 = 1 –1 = 0 Or is a plus –0+0 = 0 –0+1 = 1 –1+0 = 1 –1+1 = 1 And is multiplication.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Computer Organization Computer Organization Review: Combinational circuits Week 1 Lecture Notes Adapted by Dr. Adel Ammar.
Reference: Moris Mano 4th Edition Chapter 4
Digital System Design Review.
CSE Winter 2001 – Arithmetic Unit - 1
HALF ADDER FULL ADDER Half Subtractor.
Number Systems and Circuits for Addition
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
Presentation transcript:

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 14 Binary Adders and Subtractors

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation °Represent inputs and outputs Inputs: single bit values, carry in Outputs: Sum, Carry °Hardware features Create a single-bit adder and chain together °Same hardware can be used for addition and subtraction with minor changes °Dealing with overflow What happens if numbers are too big?

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Half Adder CABS 0001 A 0 B 0 S 0 C Dec Binary °Add two binary numbers A 0, B 0 -> single bit inputs S 0 -> single bit sum C 1 -> carry out

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Multiple-bit Addition A 3 A 2 A 1 A A B 3 B 2 B 1 B 0 B A B A i +B i C i SiSi C i+1 °Consider single-bit adder for each bit position. Each bit position creates a sum and carry

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder C i A i B i S i C i CiCi AiBiAiBi SiSi °Full adder includes carry in C i °Notice interesting pattern in Karnaugh map.

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder C i A i B i S i C i+1 S i = !C i & !A i & B i # !C i & A i & !B i # C i & !A i & !B i # C i & A i & B i °Full adder includes carry in C i °Alternative to XOR implementation

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder S i = !C i & !A i & B i # !C i & A i & !B i # C i & !A i & !B i # C i & A i & B i S i = !C i & (!A i & B i # A i & !B i ) # C i & (!A i & !B i # A i & B i ) S i = !C i & (A i $ B i ) # C i & !(A i $ B i ) S i = C i $ (A i $ B i ) °Reduce and/or representations into XORs

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder C i A i B i S i C i CiCi AiBiAiBi C i+1 °Now consider implementation of carry out °Two outputs per full adder bit (C i+1, S i ) Note: 3 inputs

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder C i A i B i S i C i+1 CiCi AiBiAiBi C i+1 C i+1 = A i & B i # C i & B i # C i & A i °Now consider implementation of carry out °Minimize circuit for carry out - C i+1

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder C i+1 = A i & B i # C i !A i & B i # C i & A i & !B i C i+1 = A i & B i # C i & (!A i & B i # A i & !B i ) C i+1 = A i & B i # C i & (A i $ B i ) Recall: S i = C i $ (A i $ B i ) C i+1 = A i & B i # C i & (A i $ B i )

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder S i = C i $ (A i $ B i ) Half-adder C i+1 = A i & B i # C i & (A i $ B i ) °Full adder made of several half adders

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder A full adder can be made from two half adders (plus an OR gate). °Hardware repetition simplifies hardware design

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Full Adder Block Diagram °Putting it all together Single-bit full adder Common piece of computer hardware

ENGIN112 L14: Binary Adder Subtractor October 3, Bit Adder C A B S °Chain single-bit adders together. °What does this do to delay?

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Negative Numbers – 2’s Complement = = = FF 16 = = = = = °Subtracting a number is the same as: 1.Perform 2’s complement 2.Perform addition °If we can augment adder with 2’s complement hardware?

ENGIN112 L14: Binary Adder Subtractor October 3, bit Subtractor: E = 1 +1 Add A to B’ (one’s complement) plus 1 That is, add A to two’s complement of B D = A - B

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Adder- Subtractor Circuit

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Overflow in two’s complement addition °Definition: When two values of the same signs are added: Result won’t fit in the number of bits provided Result has the opposite sign. Overflow? C N-1 B N-1 A N-1 Assumes an N-bit adder, with bit N-1 the MSB

ENGIN112 L14: Binary Adder Subtractor October 3, Addition cases and overflow OFL

ENGIN112 L14: Binary Adder Subtractor October 3, 2003 Summary °Addition and subtraction are fundamental to computer systems °Key – create a single bit adder/subtractor Chain the single-bit hardware together to create bigger designs °The approach is call ripple-carry addition Can be slow for large designs °Overflow is an important issue for computers Processors often have hardware to detect overflow °Next time: encoders/decoder.