PHY 201 (Blum) 1 Adders, Digital to Analog Conversion Ch. 8 in Digital Principles (Tokheim)

Slides:



Advertisements
Similar presentations
Combinational Circuits
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
EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
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.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Chapter 4 Gates and Circuits.
Lecture 8 Arithmetic Logic Circuits
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
Lecture 3. Boolean Algebra, Logic Gates
PHY 201 (Blum)1 Karnaugh Maps References: Chapters 4 and 5 in Digital Principles (Tokheim) Chapter 3 in Introduction to Digital Systems (Palmer and Perlman)
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
PHY 201 (Blum)1 Some basic electronics and truth tables Some material on truth tables can be found in Chapters 3 through 5 of Digital Principles (Tokheim)
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Chapter 4 Gates and Circuits.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
3-1 Chapter 3 - Arithmetic Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer Architecture.
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Basic Arithmetic (adding and subtracting)
Digital Electronics. Digital circuits work on the basis of a transistor being used as a switch. Consider a light switch, a transistor can be considered.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Chapter 6-1 ALU, Adder and Subtractor
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Basic Arithmetic (adding and subtracting)
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Karnaugh Maps References:
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
CHAPTER 4 Combinational Logic
Topic 1 – Number Systems. What is a Number System? A number system consists of an ordered set of symbols (digits) with relations defined for addition,
PHY 201 (Blum)1 Transistor Odds and Ends. PHY 201 (Blum)2 RTL NOR.
PHY 201 (Blum)1 Transistor Odds and Ends. PHY 201 (Blum)2 RTL NOR.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
PHY 202 (Blum)1 Combinations of Resistors Series, Parallel.
Some basic electronics and truth tables Some material on truth tables can be found in Chapter 3 of Digital Principles (Tokheim)
Half-Adder: A combinational circuit which adds two one-bit binary numbers is called a half-adder. The sum column resembles like an output of the XOR gate.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
1. Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 2.
PHY 201 (Blum)1 Shift registers and Floating Point Numbers Chapter 11 in Tokheim.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
PHY 201 (Blum)1 Shift registers and Floating Point Numbers Chapter 11 in Tokheim.
Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 1.
Explain Half Adder and Full Adder with Truth Table.
Unit 1 Introduction Number Systems and Conversion.
Invitation to Computer Science, C++ Version, Fourth Edition
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Invitation to Computer Science, Java Version, Third Edition
FUNCTION OF COMBINATIONAL LOGIC CIRCUIT
Some basic electronics and truth tables
King Fahd University of Petroleum and Minerals
Digital Logic.
ECE 352 Digital System Fundamentals
Presentation transcript:

PHY 201 (Blum) 1 Adders, Digital to Analog Conversion Ch. 8 in Digital Principles (Tokheim)

PHY 201 (Blum) 2 Most significant/least significant  Recall that in a number such as 1234, the numbers are weighted according to their position: 1     1  Because the 1 in 1234 is weighted by the largest power of ten, it is called the most significant digit.  Because the 4 in 1234 is weighted by the smallest power of ten, it is called the least significant digit.

PHY 201 (Blum) 3 Adding Binary Numbers  Same as decimal; if the sum of two digits in a given position exceeds the base (10 for decimal, 2 for binary) then there is a carry into the next higher position Carry

PHY 201 (Blum) 4 Some terminology  Adding is a particular way of combining (acting on) two numbers to get another number.  A general term for an action is an operation.  The numbers that are being acted upon are known as operands.  Since addition requires two operands, it is known as a binary operation. We do not have to be adding binary numbers for the addition operation to be binary.

PHY 201 (Blum) 5 Adding Binary Numbers

PHY 201 (Blum) 6 Adding Binary Numbers Carry in Carry out

PHY 201 (Blum) 7 Addition Logic  Addition can always be done two digits at a time (but does not have to be done that way). If there is a carry from a lower digit, the two digits can be added and then the carry can be added to that result.  There are two outputs: The sum (often denoted with an S or a  ) is the number that has the same position (weighting) in the answer as the two digits being added. A carry (often denoted with a C o ) is the number to be included in the next higher positional order. The carry may be zero, i.e. no carry. The o subscript indicates that the carry is an output of the operation.

PHY 201 (Blum) 8 Half Adder Truth Table INPUTOUTPUT AB Sum A XOR B Carry-out A AND B “Half adder” implies no carry-in input is included.

PHY 201 (Blum) 9 Half-adder gate version

PHY 201 (Blum) 10 Half to Full  The previous circuit is called a half adder, it adds two binary digits.  However, there may have been a carry from summing the lower digits, so the half adder does not represent all that can occur in adding the binary digits of a given positions.  For that we go to the so-called full adder.

PHY 201 (Blum) 11 Full Adder Truth Table INPUTOUTPUT Carry-inABSumCarry-out

PHY 201 (Blum) 12 Full-adder logic gates Can be made with two half adders and an OR gate.

PHY 201 (Blum) 13 Building up  In the preceding circuit we simply used two half adders and an OR gate to construct a full adder.  Let us examine the Karnaugh map for a full adder to see if any simplifications are possible.

PHY 201 (Blum) 14 Sum output (Karnaugh) AB\ C in

PHY 201 (Blum) 15 Checkerboard Pattern  In the previous truth table, there were no groups of 1’s containing more than a single 1.  Hence there are no simplifications.  For convenience, we represent it by a single logic gate (the excluded OR).

PHY 201 (Blum) 16 2-Input Excluded OR

PHY 201 (Blum) 17 Not a genuine simplification  While replacing two NOTs, two ANDs and an OR by one XOR would appear to be a simplification, it is not a real simplification. Similarly the 3-input XOR replacing three NOTs, four ANDs and an 4-input OR is not a real simplification.  A real measure of simplification is whether it reduces the total number of transistors; it does not.  Another real measure is whether it reduces the number of “layers” of transistors (how many transistors the current must pass through); again it does not.

PHY 201 (Blum) 18 Carry-out output (Karnaugh) AB\ C in Hey, isn’t that the majority rules logic?

PHY 201 (Blum) 19 Karnaugh version of adding

PHY 201 (Blum) 20 Advantage The circuit on the right has the advantage in terms of layers. There are six layers of gates (XOR counts as three) in the first circuit and only three in the second.

PHY 201 (Blum) 21 Adding more than one positional digit  In the way most of us learned to add, we need to know the result of summing the lower digits since they might contribute a carry to the next higher digit.  In other words, the carry out of the lower digit addition becomes the carry in of the next higher digit addition.

PHY 201 (Blum) 22 Ripple adder  A circuit built upon this logic is known as a ripple adder

PHY 201 (Blum) 23 A problem

PHY 201 (Blum) 24 The problem with ripple adders  Your lowest-bit answer must be stable for you to have the correct input for the next highest digit.  Then that answer must be stable for you to have the correct input for the next highest digit.  Etc., etc., etc.,

PHY 201 (Blum) 25 The problem with ripple adders  Each stabilization requires time.  The more digits one is adding, the more time is required.  Eventually the total time would exceed the period of one’s clock.  The problem with ripple adders is that they do not scale!

PHY 201 (Blum) 26 Scaling  To scale something is to change its size.  If changing a system’s size does not introduce difficulty, the system is said to be scalable to simple to scale. Can we change the word size? Can we add records to a database? Can we add more computers to a network?

PHY 201 (Blum) 27 Scalable addition  Addition requires only combinatorial logic, the output depends solely on the input and not on any previous state of the system (i.e. no memory is required) It is not “sequential”  Combinatorial truth tables can always be realized in three stages (NOTing, ANDing and ORing)  So a scalable addition is possible.

PHY 201 (Blum) 28 The price  The scalable addition is more complicated circuitry.  The number of inputs of some of the logic gates (known as the fan-in) becomes large, and the gate must be able to handle that.  Similarly the output of a logic gate might be fed in as the input of many other gates (this is known as fan-out).

PHY 201 (Blum) 29 Subtracting  One could examine from scratch the subtraction logic (borrows, etc.)  But it’s easier to note that A-B is equal to A+(-B).  So subtraction is negation followed by addition.  We’re adding a layer to the logic (the operation of negation then followed by the operation of addition. versus one operation: subtraction) but it is not layer after layer, so this subtraction will scale if the addition scales.

PHY 201 (Blum) 30 Two’s Complement  One could represent negative numbers in various ways, the way that is convenient for integer addition and subtraction is the two’s complement representation. Other representations require one to break the problem into cases: Adding positive to positive Adding positive to negative Adding negative to positive Adding negative to negative

PHY 201 (Blum) 31 Two’s Complement Take inverse Add 1 to the lowest bit Unless stated otherwise, signed integers in this class will use the two’s complement representation.

PHY 201 (Blum) 32 Digital to Analog  Here we show one way to convert from a binary digital signal (highs and lows only) to a quasi-analog signal (a signal with more intermediate values).  The device performing this task is known as a digital-to-analog converter or DAC.

PHY 201 (Blum) 33 Inside versus Outside  Inside a computer the information is in digital form, but the outside world is analog.  To send sound to a speaker, to send an image to a monitor, etc. require converting digital information to analog information.

PHY 201 (Blum) 34 Intermediate values means fractions  In the end we want not just high or low but intermediate or fractions values.  Thus we will use our notion of binary fractions as the digital input. To obtain a voltage that is half of the high voltage, we will use the binary number corresponding to ½. To obtain a voltage that is one quarter of the high voltage, we will use the binary number corresponding to ¼. Etc.

PHY 201 (Blum) 35 Fractions  Similar to what we’re used to with decimal numbers =3 · · · · · · =1 · · · · · · · · 2 -6 (  )

PHY 201 (Blum) 36 The other piece of the puzzle  Recall that the highs and lows we are talking about are high and low voltages.  Voltage is the energy that a charge has.  When flowing through a circuit a charge must use up all of its voltage (energy) before returning home.  The charges divides its energy among the tasks at hand (resistances). Thus at some intermediate point in the circuit, the charge has used up some fraction of it energy and still has the rest to use up.

PHY 201 (Blum) 37 Resistors in Series  Resistors are in series if a charge that passes through the first has no choice but to pass through the second on its path around the circuit. Still need to pass through one third of the resistance so need one third of the voltage.

PHY 201 (Blum) 38 Resistors in Parallel  Resistors are in parallel if a charge can move through one or the other on its path around the circuit. A combination of resistors in parallel has a smaller resistance than either constituent resistor.

PHY 201 (Blum) 39 Voltage Divider  If two voltages are in series, part of the voltage is dropped across one resistor the rest across the second.  One can use this technique to reduce the voltage for devices that requires smaller voltages.

PHY 201 (Blum) 40 Voltage Divider

PHY 201 (Blum) 41 Voltage Divider

PHY 201 (Blum) 42 D-to-A  The idea of the voltage divider can be extended to make a simple digital-to-analog converter.  The digital inputs can be thought of as binary decimals. .101 would correspond to: 1/2 + 1/8 = 5/8

PHY 201 (Blum) 43 Digital to Analog (00) Nothing connected to high end of battery. B is low A is low

PHY 201 (Blum) 44 Digital to Analog (10) See next slide for rearranged circuit that’s easier to analyze. B is high A is low

PHY 201 (Blum) 45 (10) Think of as Resistors in parallel add reciprocally. 1/R eq = 1/R 1 +1/R 2 R eq =0.5 kOhm

PHY 201 (Blum) 46 Digital to Analog (01) B is low A is high

PHY 201 (Blum) 47 (01) Think of as R eq = kOhm

PHY 201 (Blum) 48 Digital to Analog (11) B is high A is high

PHY 201 (Blum) 49 (11) Think of as R eq =0.333 kOhm