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.

Slides:



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

Modular Combinational Logic
Combinational Circuits
Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
EET 1131 Unit 7 Arithmetic Operations and Circuits
Number Bases Informatics INFO I101 February 9, 2004 John C. Paolillo, Instructor.
Forging new generations of engineers. Binary Addition & Subtraction.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Parallel Adder Recap To add two n-bit numbers together, n full-adders should be cascaded. Each full-adder represents a column in the long addition. The.
Assembly Language and Computer Architecture Using C++ and Java
Assembly Language and Computer Architecture Using C++ and Java
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
1 COMP541 Arithmetic Circuits Montek Singh Mar 20, 2007.
ECE 301 – Digital Electronics
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
IT Systems Number Operations EN230-1 Justin Champion C208 –
9/15/09 - L15 Decoders, Multiplexers Copyright Joanne DeGroat, ECE, OSU1 Binary additon & subtraction.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Lecture # 12 University of Tehran
Logic Gates Combinational Circuits
Building Adders & Sub tractors Dr Ahmed Telba. Introducing adder circuits Adder circuits are essential inside microprocessors as part of the ALU, or arithmetic.
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 10 Arithmetic Circuits.
CS 105 Digital Logic Design
Dr. Bernard Chen Ph.D. University of Central Arkansas
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Chapter 6 Digital Arithmetic: Operations and Circuits ECE 221 Intro
Basic Arithmetic (adding and subtracting)
Digital Arithmetic and Arithmetic Circuits
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Basic Arithmetic (adding and subtracting)
ECEN 248 Lab 4: Multiplexer Based Arithmetic Logic Unit
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
ARITHMETIC MICRO OPERATIONS
Combinational Circuits
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Addition and Substraction
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
Introduction * Binary numbers are represented with a separate sign bit along with the magnitude. * For example, in an 8-bit binary number, the MSB is.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
2's Complement Arithmetic
Introduction to Digital Electronics Lecture 2: Number Systems.
Two’s and one’s complement arithmetic CLOCK ARITHMETIC.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Arithmetic Circuits I. 2 Iterative Combinational Circuits Like a hierachy, except functional blocks per bit.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
Chapter 6. Digital Arithmetic: Operations and Circuits
Addition and Subtraction
Combinational Circuits
2's Complement Arithmetic
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
Homework Reading Machine Projects Labs
Digital Systems Section 8 Multiplexers. Digital Systems Section 8 Multiplexers.
Principles & Applications
Addition and Substraction
ECE 331 – Digital System Design
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
Homework Reading Machine Projects Labs
Combinational Circuits
2's Complement Arithmetic
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Two’s Complement & Binary Arithmetic
Presentation transcript:

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 System:

Lab 10 : Adder system Layout : To demonstrate the process used by a digital adder system, two binary numbers will be added by hand. Add the 2 LSB’s. 1+1=10 (2 in binary) …or… 1+1 = 0 and a carry out of 1. Add Carry In = 10 Add using four bit hand addition: Carry Out of Add Carry In = Carry Out of 0 00 Ignore the Carry Out Add Carry In = 00 Answer = 4 A Cin B Cout S Adder systems are made up of modules called Full Adders. A + B + Cin (carry in) = S (sum) & Cout (carry out). A 4 bit adder requires 4 Full Adder modules. A Cin B Cout S A Cin B Cout S A Cin B Cout S Add using the adder system : A+B+Cin = S & Cout = 0 and A+B+Cin Cin must be connected to Cout A+B+Cin = S & Cout = 0 and A+B+Cin Cin must be connected to Cout A+B+Cin = S & Cout = 1 and 0 A+B+Cin Cin must be connected to Cout Answer =4 (0100) Full Adder Slide #2

Lab 10: 2’s Complement Conversion : Signed numbers encoded using 2’s complement notation can be added and subtracted using one process: “The process of addition”. Converting numbers to 2’s complement form is easy. Positive Numbers: Example: Convert +22 into 8 bit 2’s complement form. Rule : 2’s complement notation = Binary Notation Sign Bit Process: Write 22 as a 7 bit number. Make the Sign Bit =0 to denote a positive number and your done! = 22 0 Thus +22 = in 8 bit 2’s complement notation. Negative Numbers: Example: Convert -22 into 8 bit 2’s complement form. Rule : 2’s complement notation is NOT= Binary Notation. You must use a 3 step procedure to convert the negative number. Step 1: Write –22 as an 8 bit positive number From the work above: +22 = Sign Bit Step 2: Invert all bits The result of this process is called 1’s complement notation Step 3: Add 1 to this new binary pattern Thus -22 = in 8 bit 2’s complement notation. Theory: Adding a positive and a negative 2’s comp. number will subtract the 2 numbers. Test the Theory: Try 22+(-22) At first glance it does not appear to work. The 1 in the MSB is actually a carry out and can be ignored! Answer = 0 Slide #3

5 bit signed numbers will be used to demonstrate arithmetic overflow. The valid range of 5 bit numbers is –16 to +15. The range can be represented using a number line. Lab 10: Arithmetic Overflow : Arithmetic Overflow is an error that occurs when 2 numbers being added together generate an answer that requires more bits than are available for the answer Add 9+8. Each number on there own is a valid 5 bit number but there sum (17) exceeds the valid range Sign Bit (2 4 ) –ve #s. 16 (2 4 ) +ve #s. The sum turns out to be a negative number. To check which negative number it is: invert and +1 and it will convert to its equivalent +ve number. If the error goes undetected then the system would calculate 9+8 = -15 Error! Negative # Invert Add 1 Detecting Arithmetic Overflow errors is easy. All calculators and computers do it. Overflow never occurs if the 2 numbers being added have opposite sign bits. Think about it using the number line. One number on the positive side and the other on the negative side always generates a sum in between One number on this side Answer always falls in the middle NO overflow! Overflow may occur if the 2 numbers being added have the same sign bits. Think about it using the number line. Both numbers from the positive side may generate a sum that exceeds +15. Both numbers from the negative side may generate a sum that exceeds -16. Overflow from 2 positive numbers always wraps around to the negative end of the number line. In our example = Overflow from 2 negative numbers always wraps around to the positive end of the number line. For example (–9) + (-8) = +15. (-9)+(-8)+15 An overflow detection system checks the logic level of each number’s sign bit. If they are the same then it checks the sign bit of the answer. If the sign bit of the answer is different than the sign bit of each number then overflow has occurred and the system generates an error message. Slide #4

Lab 10: 8 Bit Adder/Subtractor : Two 4-bit adders are combined with XOR gates to create an 8-bit adder/subtractor system. The system will be used to add 12 + (-4) and then subtract 12 – (-4). Load the data registers with the 2 numbers: +12 and – Sign Bit Invert Add Put the system in the ADD mode. ADD/SUB =0. The XOR gates are controlled inverters and will pass the number –4 to the adders Add the numbers and show the response at the S output of the adders. 0 1 Register B Register A C C Register B Register A C C Answer is 8 [12+(-4)] Put the system in the SUB mode. ADD/SUB =1. The XOR gates are controlled inverters and will pass the inverse of the number –4 to the adders. This will make the system subtract 12-(-4) Add the numbers and show the response at the S output of the adders. 1 Register B Register A C C Register B Register A C C Answer is 16 [12-(-4)] Slide #5