Introduction to Chapter 6  Digital circuits are frequently used for arithmetic operations  Fundamental arithmetic operations on binary numbers and digital.

Slides:



Advertisements
Similar presentations
Functions of Combinational Logic
Advertisements

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
التصميم المنطقي Second Course
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
DPSD This PPT Credits to : Ms. Elakya - AP / ECE.
CHAPTER 2 Number Systems, Operations, and Codes
Arithmetic Operations and Circuits
Chapter 1 Binary Systems 1-1. Digital Systems
CSE-221 Digital Logic Design (DLD)
Digital Fundamentals Floyd Chapter 2 Tenth Edition
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
Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.
Overview Iterative combinational circuits Binary adders
IT Systems Number Operations EN230-1 Justin Champion C208 –
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,
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 10 Arithmetic Circuits.
CS 105 Digital Logic Design
Digital Systems © Korea Univ. of Tech. & Edu. Dept. of Info. & Comm. Chap. 6 Digital Arithmetic 6-1 Chap. 6 Digital Arithmetic: Operations & Circuits n.
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
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 ,
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Digital Arithmetic and Arithmetic Circuits
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Chapter # 5: Arithmetic Circuits
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Introduction to Chapter 7
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.
Introduction to Chapter 3  Now that we understand the concept of binary numbers, we will study ways of describing how systems using binary logic levels.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Introduction to Chapter 5  Logic circuits studied so far have outputs that respond immediately to inputs at some instant in time.  We now introduce the.
Combinational Circuits
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
1 Fundamentals of Computer Science Combinational Circuits.
Number Representation and Arithmetic Circuits
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.
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.
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..
Introduction to Chapter 2
Principles & Applications
2 Number Systems and Codes Edited by Jerry Bernardini.
Chapter 6 Functions of Combinational Logic
ECEG-3202 Computer Architecture and Organization
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Chap. 6 Digital Arithmetic: Operations & Circuits
Presentation transcript:

Introduction to Chapter 6  Digital circuits are frequently used for arithmetic operations  Fundamental arithmetic operations on binary numbers and digital circuits which perform arithmetic operations will be examined. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved...

6-1 Binary Addition  Binary numbers are added like decimal numbers.  In decimal, when numbers sum more than 9 a carry results.  In binary when numbers sum more than 1 a carry takes place.  Addition is the basic arithmetic operation used by digital devices to perform subtraction, multiplication, and division. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-2 Representing Signed Numbers  Since it is only possible to show magnitude with a binary number, the sign (+ or  ) is shown by adding an extra “sign” bit.  A sign bit of 0 indicates a positive number.  A sign bit of 1 indicates a negative number.  The 2’s complement system is the most commonly used way to represent signed numbers. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-2 Representing Signed Numbers  In order to change a binary number to 2’s complement it must first be changed to 1’s complement. To convert to 1’s complement, simply change each bit to its complement (opposite). To convert 1’s complement to 2’s complement add 1 to the 1’s complement.  A positive number is true binary with 0 in the sign bit.  A negative number is in 2’s complement form with 1 in the sign bit. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-2 Representing Signed Numbers  A number is negated when converted to the opposite sign.  A binary number can be negated by taking the 2’s complement of it. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-3 Addition in the 2’s Complement System  Perform normal binary addition of magnitudes.  The sign bits are added with the magnitude bits.  If addition results in a carry of the sign bit, the carry bit is ignored.  If the result is positive it is in pure binary form.  If the result is negative it is in 2’s complement form. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-4 Subtraction in the 2’s Complement System  The number subtracted (subtrahend) is negated.  The result is added to the minuend.  The answer represents the difference.  If the answer exceeds the number of magnitude bits an overflow results. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-5 Multiplication of Binary Numbers  This is similar to multiplication of decimal numbers.  Each bit in the multiplier is multiplied by the multiplicand.  The results are shifted as we move from LSB to MSB in the multiplier.  All of the results are added to obtain the final product. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-6 Binary Division  This is similar to decimal long division.  It is simpler because only 1 or 0 are possible.  The subtraction part of the operation is done using 2’s complement subtraction.  If the signs of the dividend and divisor are the same the answer will be positive.  If the signs of the dividend and divisor are different the answer will be negative. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-7 BCD Addition  When the sum of each decimal digit is less than 9, the operation is the same as normal binary addition.  When the sum of each decimal digit is greater than 9, a binary 6 is added. This will always cause a carry.  BCD subtraction – a more complicated operation – is not discussed in the book. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-8 Hexadecimal Arithmetic  Hex addition: Add the hex digits in decimal. If the sum is 15 or less express it directly in hex digits. If the sum is greater than 15, subtract 16 and carry 1 to the next position.  Hex subtraction – use the same method as for binary numbers.  When the MSD in a hex number is 8 or greater, the number is negative. When the MSD is 7 or less, the number is positive. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-9 Arithmetic Circuits  An arithmetic/logic unit (ALU) accepts data stored in memory and executes arithmetic and logic operations as instructed by the control unit. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-9 Arithmetic Circuits  Typical sequence of operations: Control unit is instructed to add a specific number from a memory location to a number stored in the accumulator register. The number is transferred from memory to the B register. Number in B register and accumulator register are added in the logic circuit, with sum sent to accumulator for storage. The new number remains in the accumulator for further operations or can be transferred to memory for storage. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-10 Parallel Binary Adder  The A and B variables represent 2 binary numbers to be added. The C variables are the carries. The S variables are the sum bits. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-11 Design of a Full Adder  Construct a truth table of 3 inputs (2 numbers to be added and carry in) and 2 outputs (sum and carry out).  Use algebraic methods or K-maps to simplify the resulting SOP form.  The result is the logic circuit shown in Figure 6-7.  The design process for a half adder is similar, but there is no carry in so there will be only 2 input bits. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-12 Complete Parallel Adder With Registers  Register notation – to indicate the contents of a register we use brackets: [A]=1011 is the same as A 3 =1, A 2 =0, A 1 =1, A 0 =1  A transfer of data to or from a register is indicated with an arrow [B]  [A] means the contents of register B have been transferred to register A. This is a common form of notation and is also found in HDL. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-12 Complete Parallel Adder With Registers  The following describes adding binary 1001 and 0101 using the circuit of Figure 6-9: A CLR pulse is applied at t 1 The first binary number 1001 is transferred from memory to the B register at t 2 The sum of 1001 and 0000 is transferred to the A register at t is transferred from memory to the B register at t 4 The sum outputs are transferred to the A register at t 5 The sum of the two numbers is now present in the accumulator. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-13 Carry Propagation  Parallel adder speed is limited by carry propagation (also called carry ripple).  Carry propagation results from having to wait for the carry bits to “ripple” through the device.  Additional bits will introduce more delay.  Various techniques have been developed to reduce the delay. The look-ahead carry scheme is commonly used in high speed devices. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-14 Integrated Circuit Parallel Adder  The most common parallel adder is a 4 bit device with 4 interconnected FAs and look-ahead Carry circuits.  The The A and B lines each represent 4 bit numbers to be added. The C 0 is the carry in, the C 4 is the carry out, and the  lines are the sum of the 2 numbers. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-14 Integrated Circuit Parallel Adder  Parallel adders may be cascaded together as shown to add larger numbers, in this case two 8 bit numbers. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-15 2’s Complement System  Addition of negative and positive numbers using adders is done by placing the negative number into 2’s complement form and performing normal addition.  Subtraction is done by converting the number to be subtracted (subtrahend) to 2’s complement and adding to the minuend.  An adder can be used to perform addition and subtraction by designing a way to take the 2’s complement for subtraction as described in Figure Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-16 ALU Integrated Circuits  ALUs can perform different arithmetic and logic functions as determined by a binary code on the function select inputs.  There are many different devices. The 74LS382 (TTL) and HC382 (CMOS) is a typical device with 8 possible functions. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-17 ALU Integrated Circuits Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-17 Troubleshooting Case Study  Read the case study in the text and determine the most likely fault in the circuit shown, given the test results described. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-18 Using TTL Library Functions with ALTERA  Altera offers pre-defined logic circuits in macrofunctions.  ALUs may be defined graphically, as shown in Figure  Graphic description may seem intuitive, but it is often easier to define a device using text and macrofunctions. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-19 Logical Operations on Bit Arrays  HDL techniques in two main areas: Specifying groups of bits in arrays Using logical operations to combine arrays using Boolean expressions  To refer to three most significant bits of d as a set: AHDL: VARIABLE d[3..0] :NODE VHDL: SIGNAL d:BIT_VECTOR (3 DOWNTO 1) Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-21 Expanding the Bit Capacity of a Circuit  Constants are fixed numbers that are represented by a symbol. The symbol is used in the code to refer to the value.  A circuit can be modified by simply changing the numbers the symbols refer to.  The examples in this section do not have look ahead carry circuits for simplicity. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-21 Expanding the Bit Capacity of a Circuit  AHDL – Refer to Figure Keyword CONSTANT is followed by the symbolic name and value assigned.  VHDL – Refer to Figure Packages contain constants. Within the package the keyword CONSTANT is followed by the symbolic name, type, and the value to be assigned. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..

6-21 Expanding the Bit Capacity of a Circuit  The VHDL generate statement can be used to concisely replicate several components that are cascaded together.  Altera offers a library of parameterized modules (LPMs) which offer generic solutions for the various logic circuits used in digital systems. Ronald Tocci/Neal Widmer/Gregory Moss Digital Systems: Principles and Applications, 10e Copyright ©2007 by Pearson Education, Inc. Columbus, OH All rights reserved..