Abdullah Said Alkalbani University of Buraimi

Slides:



Advertisements
Similar presentations
Date of Birth Design Problem
Advertisements

CSE 370 Sample Final Exam Questions. 1) Logic Minimization CD AB F = Σm(0,6,7,8,9,11,15) + d(1,13)
15 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
A Simple ALU Binary Logic.
B261 Systems Architecture
Cs 121 Ch 4-2 Combinational Logic
Logic Circuits Basic Building Blocks Dr John Cowell
Discrete Mathematical Structures: Theory and Applications
ADDER, HALF ADDER & FULL ADDER
Binary Lesson 3 Hexadecimal. Counting to 15 Base Base Base 16 Base Base Base 16 Two Ten (Hex) Two Ten (Hex)
Binary Lesson 3 Hexadecimal. Counting to 15 Base Base Base 16 Base Base Base 16 Two Ten (Hex) Two Ten (Hex)
Digital Logic & Design Lecture No. 3. Number System Conversion Conversion between binary and octal can be carried out by inspection.  Each octal digit.
Adders and Subtractors
ELECTRONICS TECHNOLOGY Digital Devices I Karnaugh Maps
Adders Module M8.1 Section 6.2. Adders Half Adder Full Adder TTL Adder.
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
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.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
ECE 331 – Digital System Design
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 )
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
IT Systems Number Operations EN230-1 Justin Champion C208 –
ENGIN112 L14: Binary Adder Subtractor October 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 14 Binary Adders and Subtractors.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
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.
Combinational and Sequential Logic Circuits.
+ 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.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Digital Electronics and Computer Interfacing
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.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
COMP541 Arithmetic Circuits
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.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
1 Fundamentals of Computer Science Combinational 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.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Computer Arthmetic Chapter Four P&H. Data Representation Why do we not encode numbers as strings of ASCII digits inside computers? What is overflow when.
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.
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.
Computer Organization Computer Organization Review: Combinational circuits Week 1 Lecture Notes Adapted by Dr. Adel Ammar.
Combinational Circuits
Digital Systems Section 8 Multiplexers. Digital Systems Section 8 Multiplexers.
Combinational Circuits
Reference: Moris Mano 4th Edition Chapter 4
Digital System Design Review.
ECE 331 – Digital System Design
Number Systems and Circuits for Addition
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
XOR Function Logic Symbol  Description  Truth Table 
Presentation transcript:

Abdullah Said Alkalbani alklbany@hotmail.com University of Buraimi ECEN2102 Digital Logic Design Lecture 9 Combinational Circuits Binary Adders and Subtractors Abdullah Said Alkalbani alklbany@hotmail.com University of Buraimi

Addition and subtraction of binary data is fundamental 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? credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

1 1 +1 +1 2 10 Half Adder Add two binary numbers 0 0 0 0 0 1 1 0 A0 , B0 -> single bit inputs S0 -> single bit sum C1 -> carry out C A B S 1 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 Dec Binary 1 1 +1 +1 2 10

Multiple-bit Addition Consider single-bit adder for each bit position. A3 A2 A1 A0 0 1 0 1 A 0 1 1 1 B3 B2 B1 B0 B Ai +Bi Ci Si Ci+1 0 1 0 1 0 1 1 1 A B 1 Each bit position creates a sum and carry

Si Full Adder Full adder includes carry in Ci Notice interesting pattern in Karnaugh map. 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Ci Ai Bi Si Ci+1 1 Ci AiBi 00 01 11 10 Si

Full Adder Full adder includes carry in Ci Alternative to XOR implementation 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Ci Ai Bi Si Ci+1 Si = !Ci & !Ai & Bi # !Ci & Ai & !Bi # Ci & !Ai & !Bi # Ci & Ai & Bi

Full Adder Reduce and/or representations into XORs Si = !Ci & !Ai & Bi # !Ci & Ai & !Bi # Ci & !Ai & !Bi # Ci & Ai & Bi Si = !Ci & (!Ai & Bi # Ai & !Bi) # Ci & (!Ai & !Bi # Ai & Bi) Si = !Ci & (Ai $ Bi) # Ci & !(Ai $ Bi) Si = Ci $ (Ai $ Bi)

Ci+1 Full Adder Now consider implementation of carry out Two outputs per full adder bit (Ci+1, Si) 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Ci Ai Bi Si Ci+1 1 Ci AiBi 00 01 11 10 Ci+1 Note: 3 inputs

Ci+1 Full Adder Now consider implementation of carry out Minimize circuit for carry out - Ci+1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Ci Ai Bi Si Ci+1 Ci AiBi 00 01 11 10 1 Ci+1 Ci+1 = Ai & Bi # Ci & Bi # Ci & Ai

Recall: Full Adder Ci+1 = Ai & Bi # Ci !Ai & Bi # Ci & Ai & !Bi # Ci & (!Ai & Bi # Ai & !Bi) Ci+1 = Ai & Bi # Ci & (Ai $ Bi) Recall: Si = Ci $ (Ai $ Bi) Ci+1 = Ai & Bi # Ci & (Ai $ Bi)

Half-adder Full Adder Full adder made of several half adders Si = Ci $ (Ai $ Bi) Ci+1 = Ai & Bi # Ci & (Ai $ Bi) Half-adder

A full adder can be made from two half adders (plus an OR gate). Hardware repetition simplifies hardware design A full adder can be made from two half adders (plus an OR gate).

Putting it all together Full Adder Putting it all together Single-bit full adder Common piece of computer hardware Block Diagram

4-Bit Adder Chain single-bit adders together. What does this do to delay? C 1 1 1 0 A 0 1 0 1 B 0 1 1 1 S 1 1 0 0

Negative Numbers – 2’s Complement. Subtracting a number is the same as: Perform 2’s complement Perform addition If we can augment adder with 2’s complement hardware? 110 = 0116 = 00000001 -110 = FF16 = 11111111 12810 = 8016 = 10000000 -12810 = 8016 = 10000000

+1 4-bit Subtractor: E = 1 Add A to B’ (one’s complement) plus 1 That is, add A to two’s complement of B D = A - B

Adder- Subtractor Circuit

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? CN-1 BN-1 AN-1 Assumes an N-bit adder, with bit N-1 the MSB

Addition cases and overflow 00 0010 0011 -------- 0101 01 0011 0110 -------- 1001 11 1110 1101 -------- 1011 10 1101 1010 -------- 0111 00 0010 1100 -------- 1110 11 1110 0100 -------- 0010 -3 -6 7 2 -4 -2 -2 4 2 2 3 5 3 6 -7 -2 -3 -5 OFL OFL

Addition and subtraction are fundamental to computer systems 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. credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.