Digital Arithmetic Wen-Hung Liao, Ph.D..

Slides:



Advertisements
Similar presentations
EET 1131 Unit 7 Arithmetic Operations and Circuits
Advertisements

Arithmetic Operations and Circuits
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.
ECE 301 – Digital Electronics
1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.
Chapter 7 Arithmetic Operations and Circuits Hexadecimal Arithmetic 4 binary bits represent a single hexadecimal digit Addition –Add the digits.
Arithmetic Operations and Circuits
Arithmetic Operations and Circuits Lecture 5. Binary Arithmetic let’s look at the procedures for performing the four basic arithmetic functions: addition,
Logic Gates Combinational Circuits
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 10 Arithmetic Circuits.
CS 105 Digital Logic Design
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
Digital Systems © Korea Univ. of Tech. & Edu. Dept. of Info. & Comm. Chap. 6 Digital Arithmetic 6-1 Chap. 6 Digital Arithmetic: Operations & Circuits n.
Chapter 6 – Digital Arithmetic: Operations & Circuits
Chapter 6 Digital Arithmetic: Operations and Circuits ECE 221 Intro
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
Basic Arithmetic (adding and subtracting)
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Digital Arithmetic and Arithmetic Circuits
Introduction to Chapter 6  Digital circuits are frequently used for arithmetic operations  Fundamental arithmetic operations on binary numbers and digital.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Operations on Bits Arithmetic Operations Logic Operations
Arithmetic Circuits. Half Adder ABSumCarry
Combinational Circuits
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Lecture 2 Binary Arithmetic Topics Terminology Fractions Base-r to decimal Unsigned Integers Signed magnitude Two’s complement August 26, 2003 CSCE 211.
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.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Number Representation and Arithmetic Circuits
Number Representation (Part 2) Computer Architecture (Fall 2006)
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
MicroProcessors Lec. 4 Dr. Tamer Samy Gaafar. Course Web Page —
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
Arithmetic Circuits I. 2 Iterative Combinational Circuits Like a hierachy, except functional blocks per bit.
Chapter 6. Digital Arithmetic: Operations and Circuits
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Lecture 4: Digital Systems & Binary Numbers (4)
Addition and Subtraction
Combinational Circuits
Array multiplier TU/e Processor Design 5Z032.
CHAPTER 9 COMPUTER ARITHMETIC - ALU
Digital Systems and Number Systems
Chapter 4 Register Transfer and Microoperations
CSCI206 - Computer Organization & Programming
Reference: Moris Mano 4th Edition Chapter 4
Fundamentals & Ethics of Information Systems IS 201
University of Gujrat Department of Computer Science
Exercise: Add these two single precision IEEE 754 numbers: … …0 Left number: 1.101x24 Right number: 1.011x 22= x24.
Principles & Applications
Chapter 6 Functions of Combinational Logic
Combinational Circuits
CSCI206 - Computer Organization & Programming
King Fahd University of Petroleum and Minerals
Arithmetic Circuits (Part I) Randy H
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Combinational Functional Devices
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
Digital Systems and Binary Numbers
2’s Complement form 1’s complement form 2’s complement form
Decimal and binary representation systems
Number Systems Rayat Shikshan Sanstha’s
Number Systems Rayat Shikshan Sanstha’s
XOR Function Logic Symbol  Description  Truth Table 
ECE 331 – Digital System Design
Chap. 6 Digital Arithmetic: Operations & Circuits
Arithmetic Circuits.
Chapter 1 (Part c) Digital Systems and Binary Numbers
Presentation transcript:

Digital Arithmetic Wen-Hung Liao, Ph.D.

Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and subtract hexadecimal numbers. Know the difference between binary addition and OR addition. Compare the advantages and disadvantages among three different systems of representing signed binary numbers. Manipulate signed binary numbers using the 2's complement system. Understand the BCD adder circuit and the BCD addition process. Describe the basic operation of an arithmetic/logic unit.

Objectives (cont’d) Employ full adders in the design of parallel binary adders. Cite the advantages of parallel adders with the look-ahead carry feature. Explain the operation of a parallel adder/subtractor circuit. Use an ALU integrated circuit to perform various logic and arithmetic operations on input data.

Binary Addition Performed in the same manner as the addition of decimal numbers. Most important arithmetic operation in digital systems, since subtraction, multiplication and division are all based on addition.

Representing Signed Numbers Sign-magnitude system: left most bit as sign bit (0 for +, 1 for -), remaining bits as the magnitude. Problems: How to perform addition? Two zeros: 1 0000 and 0 0000

1’s and 2’s-Complement Form 1‘s complement: change 0 to 1 and 1 to 0. 2’s complement: take 1’s complement and add 1 to the LSB. Examples: +13, -9,+3,-2,-8 Negation vs. complement

2’s Complement Range of values can be represented using 1 sign bit and N magnitude bits: -2^N to 2^N-1 1000 = -2^3 =-8 10000 = -2^4 = -16…

Addition in 2’s Complement Form Case I: Two positive numbers Case II: Positive number and smaller negative number Case III: Positive number and larger negative number Case IV: Two negative numbers Case V: Equal and opposite numbers

Subtraction in 2’s Complement A – B = A + (-B) Arithmetic overflow: results of addition or subtraction fall outside the range of values that can be represented.

Binary Multiplication Similar to multiplication of decimal numbers 1001 x 1011 What about the sign? Overflow?

Binary Division 1001 divided by 11

BCD Addition Sum equals 9 or less: digit-by-digit addition Sum greater than 9: Example: 6 + 7 Add 6 (0110) to correct the result (will produce a carry)

Hexadecimal Arithmetic Hex addition Hex subtraction Convert to binary,take 2’s complement, convert back to Hex Subtract each hex digit from F, then add 1 Hex representation of signed numbers: 3A  +58 E5  -29 When MSD >=8, negative

Arithmetic Circuits Parallel Binary Adder (Figure 6-5*): sum and carry bit.

Design of a Full Adder Figure 6-6 (Truth Table) Figure 6-7* Half adder: take 2 inputs and generate sum and carry bits.

Truth Table for a Full-Adder

Four-Bit Parallel Adder Complete parallel adder with registers (Figure 6-9):

Register Notation Register notation: [A]: the content of register A Example: [A]=1011 means that A3=1, A2=0, A1=1, A0=1.

Carry Propagation For parallel adders, sum bit generated in the last position (MSB) depended on the carry that was generated by the addition in the first position (LSB). More delay for addition of 32 or 64 bit numbers. Use look-ahead carry to reduce propagation delay.

Integrated-Circuit Parallel Adder 4-bit parallel adder: 74HC283 Cascading parallel adders

2’s Complement System Figure 6.11: addition (C0=0)

Figure 6.12: Subtraction (C0=1)

Combined Addition & Subtraction Figure 6-13

BCD Adder How to detect when sum > 9? X=S4+S3(S2+S1) Figure 6-14

Cascading BCD Adders

ALU Integrated Circuits

ALU ICs 74LS382/74HC382 CLEAR, B minus A, A minus B, A plus B, A XOR B, A+B, AB, preset Expanding the ALU: combining 2 4-bit ALUs. IEEE symbols