Arithmetic Operations and Circuits

Slides:



Advertisements
Similar presentations
Exclusive-OR and Exclusive-NOR Gates
Advertisements

Interfacing to the Analog World
Chapter 13 Shift Registers
EET 1131 Unit 7 Arithmetic Operations and Circuits
Chapter 10 Flip-Flops and Registers Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. William Kleitz.
Chapter 3 Basic Logic Gates
CHAPTER 6 Functions of Combinational Logic
CHAPTER 2 Number Systems, Operations, and Codes
Arithmetic Operations and Circuits
Chapter 1 Binary Systems 1-1. Digital Systems
King Fahd University of Petroleum and Minerals
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
ECE 331 – Digital System Design
ECE 301 – Digital Electronics
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Synchronous Sequential Circuit Design Digital Clock Design.
Chapter 1 Number Systems and Codes William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle.
Synchronous Sequential Circuit Design
Chapter 7 Arithmetic Operations and Circuits Hexadecimal Arithmetic 4 binary bits represent a single hexadecimal digit Addition –Add the digits.
Arithmetic Operations and Circuits Lecture 5. Binary Arithmetic let’s look at the procedures for performing the four basic arithmetic functions: addition,
Chapter 5 Boolean Algebra and Reduction Techniques William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education,
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 10 Arithmetic Circuits.
CS 105 Digital Logic Design
Chapter 4 Programmable Logic Devices: CPLDs with VHDL Design Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Chapter 6 – Digital Arithmetic: Operations & Circuits
Binary Arithmetic Stephen Boyd March 14, Two's Complement Most significant bit represents sign. 0 = positive 1 = negative Positive numbers behave.
Chapter 7 Arithmetic Operations and Circuits Binary Arithmetic Addition –When the sum exceeds 1, carry a 1 over to the next-more-significant column.
Chapter 6 Digital Arithmetic: Operations and Circuits ECE 221 Intro
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
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 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Number Systems and Codes
Chapter 4 Programmable Logic Devices: CPLDs with VHDL Design Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
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
CS 105 DIGITAL LOGIC DESIGN Chapter 4 Combinational Logic 1.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 5: Arithmetic Circuits Chapter 5 (minus 5.3.4)
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
CPEN Digital System Design
Introduction to Digital Electronics Lecture 2: Number Systems.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
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.
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.
Unit 1 Introduction Number Systems and Conversion.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Digital Arithmetic Wen-Hung Liao, Ph.D..
Principles & Applications
King Fahd University of Petroleum and Minerals
Chapter 5 – Number Representation and Arithmetic Circuits
Presentation transcript:

Arithmetic Operations and Circuits Chapter 7 Arithmetic Operations and Circuits Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Addition Subtraction Multiplication Division Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Addition when the sum exceeds 1, carry a 1 over to the next-more-significant column 0 + 0 = 0 carry 0 0 + 1 = 1 carry 0 1 + 0 = 1 carry 0 1 + 1 = 0 carry 1 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Addition General form A0 + B0 = 0 + Cout summation symbol carry-out See Table 7-1 carry-out is added to the next-more-significant column as a carry-in See Figure 7-1 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-1 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Subtraction 0 - 0 = 0 borrow 0 0 - 1 = 1 borrow 1 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Subtraction General form A0 - B0 = R0 + Bout remainder is R0 borrow is Bout See Table 7-2 When A0 borrows from its left, A0 increases by 2 See Figure 7-2 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-2 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Multiplication multiply the 20 bit of the multiplier times the multiplicand multiply the 21 bit of the multiplier times the multiplicand. Shift the result one position to the left before writing it down repeat step 2 for the 22 bit of the multiplier, etc. take the sum of the partial products to get the final product Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Binary Arithmetic Division the same as decimal division see Example 7-4 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Two’s-Complement Representation Both positive and negative numbers can be represented Binary subtraction is simplified Groups of eight Most significant bit (MSB) signifies positive or negative sign bit Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Two’s-Complement Representation Sign bit 0 for positive 1 for negative Range of positive numbers (8-bit) 0000 0000 to 0111 1111 (0 to 128) Range of negative numbers (8-bit) 1111 1111 to 1000 0000 (-1 to -128) Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Two’s-Complement Representation See Table 7-3 Decimal-to-Two’s-Complement Conversion If number is positive, convert directly If number is negative complement each bit (one’s complement) add 1 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Two’s-Complement Representation Two’s-Complement-to-Decimal Conversion If number is positive, convert directly If number is negative complement entire two’s-complement number add 1 convert this to decimal result will be a negative number Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Two’s-Complement Arithmetic Addition regular binary addition Subtraction convert number to be subtracted to a negative two’s-complement number carry out of the MSB is ignored Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Hexadecimal Arithmetic 4 binary bits as a single hexadecimal digit Addition add the digits in decimal if sum is less than 16, convert to hexadecimal is sum is more than 16, subtract 16, convert to hexadecimal and carry 1 to the next-more-significant column Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Hexadecimal Arithmetic Subtraction when you borrow, the borrower increases by 16 See Example 7-15 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

BCD Arithmetic Group 4 binary digits to get combinations for 10 decimal digits Range of valid numbers 0000 to 1001 Addition add as regular binary numbers if sum is 9 or less - OK if sum is greater than 9 or if carry out generated add 6 (0110) saving any carry out Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Arithmetic Circuits Medium-scale-integration (MSI) circuits Basic Adder Circuit See Figure 7-5 Half-Adder 0 HIGH when A or B HIGH, but not both exclusive-OR function Cout high when A and B HIGH AND function Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-5 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Arithmetic Circuits Half-Adder Full-Adder See Figures 7-6 and 7-7 1 HIGH when 3 inputs are odd even parity generator see Figure 7-8 Cout HIGH when any two inputs are HIGH 3 ANDs and an OR see Figure 7-9 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-6 Figure 7-7 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-8 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-9 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Arithmetic Circuits Complete Full-Adder Block diagrams See Figure 7-10 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-10 Figure 7-14 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Four-Bit Full-Adder ICs Four full-adders in a single package Will add two 4-bit binary words plus one incoming carry See Table 7-5 and Figure 7-16 Fast-look-ahead carry evaluates 4 low-order inputs high-order bits added at same time eliminates waiting for propagation ripple Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-16 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

VHDL Adders Using Integer Arithmetic Addition process using the addition operator and integer data type integer data type allows inputs with numeric values other than 1 or 0 arithmetic operations can be performed specify range of variable A VHDL 4 bit binary adder and simulation see figure 7-18 see figure 7-19 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-18 Figure 7-19 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

System Design Applications Two’s-Complement Adder/Subtractor Circuit See Figure 7-21 BCD Adder Circuit See Figure 7-22 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-22 Figure 7-21 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Arithmetic/Logic Units ALU is a multipurpose device Mode Control (M) arithmetic logic see Figure 7-23 Function Select selects specific function to be performed Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-23 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-23 (continued) Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

CPLD Applications with VHDL and LPMs CPLD based arithmetic circuits using macrofunctions, VHDL, and LPMs library of parameterized modules are provided in Quartus II software to speed the design process Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

CPLD Applications with VHDL and LPMs Example 7-25 a 4 bit adder using the 74283 macrofunction see figures 7-25 and 7-26 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-25 Figure 7-26 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

CPLD Applications with VHDL and LPMs Example 7-26 an 8 bit adder/subtractor using the + and – arithmetic operators see figures 7-27 and 7-28 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-27 Figure 7-28 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

CPLD Applications with VHDL and LPMs Example 7-27 a BCD adder based on figure 7-22 see figures 7-29 and 7-30 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-29 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-30 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

CPLD Applications with VHDL and LPMs Example 7-28 an adder/subtractor using LPMs see figures 7-31, 7-32, 7-33 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-31 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Figure 7-32 Figure 7-33 Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Summary The binary arithmetic functions of addition, subtraction, multiplication and division can be performed bit by bit using several of the same rules of regular base 10 arithmetic. The two’s-complement representation of binary numbers is commonly used by computer systems for representing positive and negative numbers. Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Summary Two’s-complement arithmetic simplifies the process of subtraction of binary numbers. Hexadecimal addition and subtraction is often required for determining computer memory space and locations. When performing BCD addition a correction must be made for sums greater than 9 or when a carry to the next more significant digit occurs. Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Summary Binary adders can be built using simple combinational logic circuits. A half-adder is required for addition of the least significant bits A full-adder is required for addition of the more significant bits. Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Summary Multibit full-adder ICs are commonly used for binary addition and two’s-complement arithmetic. Arithmetic/logic units are multipurpose ICs capable of providing several different arithmetic and logic functions. Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version

Summary The logic circuits for adders can be described in VHDL using integer arithmetic. The Quartus II software provides 7400-series macrofunctions and a Library of Parameterized Modules to ease in the design of complex digital systems. Conditional assignments can be made using the IF-THEN-ELSE VHDL statements. Copyright ©2006 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. William Kleitz Digital Electronics with VHDL, Quartus® II Version