Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.

Slides:



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

Comparator.
HEXADECIMAL NUMBERS Code
Arithmetic Operations and Circuits
King Fahd University of Petroleum and Minerals
Assembly Language and Computer Architecture Using C++ and Java
Computer Structure - The ALU Goal: Build an ALU  The Arithmetic Logic Unit or ALU is the device that performs arithmetic and logical operations in the.
Assembly Language and Computer Architecture Using C++ and Java
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
ECE 301 – Digital Electronics
1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
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,
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See: P&H Chapter 2.4, 3.2, B.2, B.5, B.6.
©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.
Dr. Bernard Chen Ph.D. University of Central Arkansas
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.
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.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Numbers and Arithmetic Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Operations on Bits Arithmetic Operations Logic Operations
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Arithmetic Circuits. Half Adder ABSumCarry
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.
Combinational Circuits
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
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.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
COMBINATIONAL LOGIC.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Chapter 4 Register Transfer and Microoperations Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS.
Number Representation and Arithmetic Circuits
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
Number Representation (Part 2) Computer Architecture (Fall 2006)
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
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.
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.
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.
Addition and Subtraction
Digital Systems and Number Systems
Digital Arithmetic Wen-Hung Liao, Ph.D..
Principles & Applications
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Arithmetic Circuits.
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. Read and understand the IEEE/ANSI symbol for a parallel adder. Analyze troubleshooting case studies of adder/subtractor circuits. Program a PLD to operate as a 4-bit full adder.

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

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 = -2^3 = = -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: – 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.(Figure 6-5*)

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

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 A 3 =1, A 2 =0, A 1 =1, A 0 =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 (C 0 =0) Figure 6.12: subtraction (C 0 =1)

Combined Addition and Subtraction Figure 6-13

BCD Adder How to detect when sum > 9? X=S 4 +S 3 (S 2 +S 1 ) 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