Lecture 3: Basic Adders and Counters
|
|
- Austen Phillips
- 5 years ago
- Views:
Transcription
1 Lecture 3: Basic Adders and Counters ECE 645 Computer Arithmetic /5/8 ECE 645 Computer Arithmetic Lecture Roadmap Revisiting Addition and Overflow Rounding Techniques Basic Adders and Counters
2 Required Reading B. Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 7, Floating-Point Representations (7.5) Chapter 5, Basic Addition and Counting (5.-5.5) Note errata at: 3 Revisiting Addition and Overflow ECE 645 Computer Arithmetic
3 Adding Unsigned Binary Numbers: Ignoring Overflow Ignoring overflow, adding a K.L binary unsigned number to a K.L binary unsigned number results in a K.L number Example:. + K=4, L= Ignore c K. =. Adding resulted in 3.75 Must add ^K=^4=6 to result to get correct value due to overflow 5 Adding Unsigned Binary Numbers: Ignoring Overflow in VHDL library IEEE; use IEEE.STD_LOGIC_64.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; entity adder_unsigned is port( a : in STD_LOGIC_VECTOR( downto ); b : in STD_LOGIC_VECTOR( downto ); sum : out STD_LOGIC_VECTOR( downto )); end adder_unsigned; architecture arch of adder_unsigned is begin sum <= a + b; end arch; 6
4 Adding Unsigned Binary Numbers: Avoiding or Detecting Overflow To avoid overflow, adding a K.L binary unsigned number to a K.L binary unsigned number results in a (K+).L number Example:. + Carry-out c K is new MSB of result. =. K=4, L= If result is confined to a K.L number, need overflow detection, which is the carry-out bit (see previous lecture) Example:. +. = Carry-out c K indicates overflow. 7 Adding Unsigned Binary Numbers: Avoiding Overflow in VHDL Zero pad input values with '', then add and ignore final carryout (c K+ ) Example:. + K=4, L= Ignore c K+. =. use IEEE.STD_LOGIC_UNSIGNED.all; entity adder_unsigned_carryout is port( a : in STD_LOGIC_VECTOR( downto ); b : in STD_LOGIC_VECTOR( downto ); sum : out STD_LOGIC_VECTOR( downto )); end adder_unsigned_carryout; architecture arch of adder_unsigned_carryout is signal tempsum : std_logic_vector( downto ); begin tempsum <= ('' & a) + ('' & b); -- pad with before addition sum <= tempsum; -- alternatively, sum() is the carryout, i.e. overflow flag end arch; 8
5 Adding Two's Complement Numbers: Ignoring Overflow Ignoring overflow, adding a K.L two's complement number to a K.L two's complement number results in a K.L number Example: = Ignore c Ignore c K. = K.. Adding resulted in -.5 Must add ^K=^4=6 to result to get correct value (3.75) Adding resulted in + Must add -^K=-^4=-6 to get correct value (-5) Recall: overflow only possible when adding two numbers of the same sign (positive+positive or negative+negative) Two's complement addition ignoring overflow is also called modulo addition (with modulus of K ) or wraparound addition A two's complement overflow is also called a wraparound A number can represent itself (x) and any positive or negative multiple x + K *j, j=,+/-, +-/ 9 Adding Two's Complement Numbers: Ignoring Overflow in VHDL library IEEE; use IEEE.STD_LOGIC_64.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_SIGNED.all; entity adder_signed is port( a : in STD_LOGIC_VECTOR( downto ); b : in STD_LOGIC_VECTOR( downto ); sum : out STD_LOGIC_VECTOR( downto )); end adder_signed; architecture arch of adder_signed is begin sum <= a + b; end arch;
6 Two's Complement Wraparound Property Temporary wraparounds are fine as long as final value is in the correct dynamic range: Example: add ( ) + 7 = -7 + = Should be (-4) not (+) wraparound/overflow + = Final result is correct: (-7) If final result guaranteed to be in the correct dynamic range [-8,+7] then intermediate wraparounds are fine Two's Complement Wraparound
7 Adding Two's Complement Numbers: Avoiding or Detecting Overflow To avoid overflow, adding a K.L binary two's complement number to a K.L two's complement number results in a (K+).L number. To compute, sign extend MSB, ignore c K+ Example:. + K=4, L= Ignore c. = K+. If result is confined to a K.L number, need overflow detection, which is the c K xor c K- (see previous lecture) Example:. + c K XOR c K- indicates overflow. =. 3 Adding Two's Complement Numbers: Avoiding or Detecting Overflow in VHDL Sign extend input values, then add and ignore final carryout (c K+ ) Example:. + Ignore c K+. =. use IEEE.STD_LOGIC_SIGNED.all; entity adder_signed_carryout is port( a : in STD_LOGIC_VECTOR( downto ); b : in STD_LOGIC_VECTOR( downto ); sum : out STD_LOGIC_VECTOR( downto )); end adder_signed_carryout; architecture arch of adder_signed_carryout is signal tempsum : std_logic_vector( downto ); begin tempsum <= (a() & a) + (b() & b); -- sign extend before addition sum <= tempsum; end arch; 4
8 Subtracting Two's Complement Numbers: Ignoring Overflow Ignoring overflow, subtracting a K.L binary two's complement number from a K.L two's complement number results in a K.L number Example: - + = Ignore c K 7 (-8) resulted in - A wraparound/overflow occured Must add ^K=^4=6 to get correct value of +5 Again we see the modulo effect As with addition, temporary wraparounds are okay as long as final result is in correct dynamic range 5 Subtracting Two's Complement Numbers: Avoiding or Detecting Overflow To avoid overflow, subtracting a K.L binary two's complement number from a K.L two's complement number results in a (K+).L number Example: =. Ignore c K+ If result is confined to a K.L number, need overflow detection, which is the c K xor c K- (see previous lecture) Example: = c K XOR c K- indicates overflow. 6
9 Subtracting Two's Complement Numbers: Avoiding Overflow in VHDL library IEEE; use IEEE.STD_LOGIC_64.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_SIGNED.all; entity adder_signed_carryout is port( a : in STD_LOGIC_VECTOR( downto ); b : in STD_LOGIC_VECTOR( downto ); sum : out STD_LOGIC_VECTOR( downto )); end adder_signed_carryout; architecture arch of adder_signed_carryout is signal tempsum : std_logic_vector( downto ); begin tempsum <= (a() & a) - (b() & b); -- sign extend BEFORE addition, very important sum <= tempsum; end arch; 7 Negating a Two's Complement Number Negating a K.L two's complement number usually only requires a K.L digit result. The only exception is when you negate the largest negative number, and you need a K.(L+) digit result. - = - = need extra bit to negate largest negative number Can view negation of x as ( x) Can use the same mechanisms and overflow detection as subtraction + 8
10 Rounding Techniques ECE 645 Computer Arithmetic Rounding Rounding occurs when we want to approximate a more precise number (i.e. more fractional bits L) with a less precise number (i.e. fewer fractional bits L') Example : old:. (K=6, L=8) new:. (K'=6, L'=) Example : old:. (K=6, L=8) new:. (K'=6, L'=) The following pages show rounding from L> fractional bits to L'= bits, but the mathematics hold true for any L' < L Usually, keep the number of integral bits the same K'=K
11 Rounding Equation Whole part Fractional part x k x k... x x. x x... x Round l y k y k... y y y = round(x) Rounding Techniques There are different rounding techniques: ) truncation results in round towards zero in signed magnitude results in round towards - in two's complement ) round to nearest number 3) round to nearest even number (or odd number) 4) round towards + Other rounding techniques 5) jamming or von Neumann 6) ROM rounding Each of these techniques will differ in their error depending on representation of numbers i.e. signed magnitude versus two's complement Error = round(x) x
12 ) Truncation The simplest possible rounding scheme: chopping or truncation x k x k... x x. x x... x trunc l x k x k... x x ulp Truncation in signed-magnitude results in a number chop(x) that is always of smaller magnitude than x. This is called round towards zero or inward rounding. (3.5) (3) Error = -.5. (-3.5) (-3) Error = +.5 Truncation in two's complement results in a number chop(x) that is always smaller than x. This is called round towards - or downward-directed rounding. (3.5) (3) Error = -.5. (-3.5) (-4) Error = Truncation Function Graph: chop(x) chop(x) 4 3 x Fig. 7.5 Truncation or chopping of a signed-magnitude number (same as round toward ). chop(x) 4 3 x Fig. 7.6 Truncation or chopping of a s-complement number (same as round to - ). 4
13 Bias in two's complement truncation X (binary) X (decimal) chop(x) (binary) chop(x) (decimal) Error (decimal) Assuming all combinations of positive and negative values of x equally possible, average error is In general, average error = -( -L' - -L )/, where L' = new number of fractional bits 5 Implementation truncation in hardware Easy, just ignore (i.e. truncate) the fractional digits from L to L'+ x k- x k-.. x x. x - x -.. x -L = y k- y k-.. y y. ignore (i.e. truncate the rest) 6
14 ) Round to nearest number Rounding to nearest number what we normally think of when say round rtn in two's complement. (.5) (3) Error = +.5. (-.5) (-) Error = Round to Nearest Function Graph: rtn(x) rtn(x) x 3 4 8
15 Bias in two's complement round to nearest X (binary) X (decimal) rtn(x) (binary) rtn(x) (decimal) Error (decimal) Assuming all combinations of positive and negative values of x equally possible, average error is +.5 Smaller average error than truncation, but still not symmetric error We have a problem with the midway value, i.e. exactly at.5 or -.5 leads to positive error bias always Also have the problem that you can get overflow if only allocate K' = K integral bits Example: rtn(.) overflow This overflow only occurs on positive numbers near the maximum positive value, not on negative numbers 9 Implementing round to nearest (rtn) in hardware Two methods Method : Add '' in position one digit right of new LSB (i.e. digit L'+) and keep only L' fractional bits x k- x k-.. x x. x - x -.. x -L + = y k- y k-.. y y. Method : Add the value of the digit one position to right of new LSB (i.e. digit L'+) into the new LSB digit (i.e. digit L) and keep only L' fractional bits x k- x k-.. x x. x - x -.. x -L + x - y k- y k-.. y y. ignore (i.e. truncate the rest) ignore (i.e truncate the rest) 3
16 Round to Nearest Even Function Graph: rtne(x) To solve the problem with the midway value we implement round to nearest-even number (or can round to nearest odd number) rtne(x) R*(x) Fig. 7.8 Rounding to the nearest even number. x Fig. 7.9 R* rounding or rounding to the nearest odd number. x 3 Bias in two's complement round to nearest even (rtne) X (binary) X (decimal ) rtne(x) (binary) rtne(x) (decimal) Error (decimal) (overfl) average error is now (ignoring the overflow) cost: more hardware 3
17 4) Rounding towards infinity We may need computation errors to be in a known direction Example: in computing upper bounds, larger results are acceptable, but results that are smaller than correct values could invalidate upper bound Use upward-directed rounding (round toward + ) up(x) always larger than or equal to x Similarly for lower bounds, use downward-directed rounding (round toward - ) down(x) always smaller than or equal to x We have already seen that round toward - in two's complement can be implemented by truncation 33 Rounding Toward Infinity Function Graph: up(x) and down(x) up(x) down(x) down(x) can be implemented by chop(x) in two's complement 34
18 Two's Complement Round to Zero Two's complement round to zero (inward rounding) also exists inward(x ) 4 3 x Other Methods Note that in two's complement round to nearest (rtn) involves an addition which may have a carry propagation from LSB to MSB Rounding may take as long as an adder takes Can break the adder chain using the following two techniques: Jamming or von Neumann ROM-based 36
19 5) Jamming or von Neumann jam(x) x Chop and force the LSB of the result to Simplicity of chopping, with the near-symmetry or ordinary rounding Max error is comparable to chopping (double that of rounding) ) ROM Rounding ROM(x) x Fig. 7. ROM rounding with an 8 table. Example: Rounding with a 3 4 table Rounding result is the same as that of the round to nearest scheme in 3 of the 3 possible cases, but a larger error is introduced when x 3 = x = x = x = x = x k... x 4 x 3 x x x. x x... x l ROM x k... x 4 y 3 y y y ROM address ROM data 38
20 ANSI/IEEE Floating-Point Standard ANSI/IEEE standard includes four rounding modes: Round to nearest even [default rounding mode] Round toward zero (inward) Round toward + (upward) Round toward (downward) 39 Basic Addition and Counters ECE 645 Computer Arithmetic
21 Half-adder c s HA x y x + y = ( c s ) x y c s 4 Half-adder Alternative implementations () a) c = xy s = x y b) c = x + y s = xy + xy 4
22 Half-adder Alternative implementations () c) c = xy s = xc + yc = xc yc 43 Full-adder c out s FA x y c in x + y + c in = ( c out s ) x y c out s c in 44
23 Full-adder Alternative implementations () a) s = (x y) c in c out = xy + c in (x y) c c s 45 Full-adder Alternative implementations () b) c out = xy + xc in + yc in s = x y c in = xyc in + xyc in + xyc in + xyc in 46
24 Full-adder Alternative implementations (3) c) x y c out s c in c in c in c in c in c in 47 Full-adder Alternative implementations (4) Implementation used to generate fast carry logic in Xilinx FPGAs x y c out y c in c in y p = x y g = y x y A A XOR D p g C out C in S s= p c in = x y c in 48
25 CMOS Transmission Gate 49 Ripple-Carry Adder 5
26 Critical Path 5 Latency of a k-bit ripple-carry adder T ripple-add = T FA (x,y c out ) + + (k-) T FA (c in c out ) + + T FA (c in s) Latency k T FA Latency k 5
27 Layout of Ripple-Carry Adder in CMOS 53 Two's Complement Adder 54
28 Two's Complement Overflow Indication of overflow Formulas Positive + Positive = Negative Negative + Negative = Positive Overflow s complement = x k- y k- s k- + x k- y k- s k- = = c k c k- 55 Two's Complement Overflow x k- y k- c k- c k s k- overflow c k c k- 56
29 Bit-Serial Adder 57 Bit-Serial Adder Interface x i y i c i+ Bit-serial adder c start clk s i 58
30 Digit-Serial Adder x i d y i d c i+ Digit-serial adder c start clk d s i 59 Addition of a Constant () + x k- x k-... x x y k- y k-... y y s k- s k-... s s variable constant + x k- x k-... x h+ x h x h-... x y k- y k-... y h+... variable constant s k- s k-... s h+ x h x h-... x 6
31 Addition of a Constant () x k- x k-... x h+ x h+ x h x h-... x c k HA/ MHA HA/ MHA.. HA/ MHA HA/ MHA... s k- s k s h+ s h+ x h x h- x If y i = y i = Half-adder (HA) Modified half-adder (MHA) 6 Modified Half-Adder c s MHA x y x + y + = ( c s ) x y c s 6
32 Incrementer x k- x k-... x x x c k HA HA.. HA HA Decrementer s k- s k-... s s x x k- x k-... x x x c k MHA MHA.. MHA MHA s k- s k-... s s x 63 Counter 64
33 Three-Stage Up Counter 65 Possible Solutions to Carry Propagate Problem. Detect the end of propagation rather than wait for the worst-case time. Speed-up propagation via look-ahead carry skip carry select, etc 3. Limit carry propagation to within a small number of bits 4. Eliminate carry propagation through the redundant number representation 66
34 Carry Chain Lengths 67 Analysis of Carry Propagation Probability of carry generation = (x i y i = ) 4 Probability of carry propagation = (x i y i = or ) Probability of carry anihilation = (x i y i = or ) Probability of carry propagating from position i to position j = j j i+ i or or j i probability of propagation = probability of anihilation j i 68
35 Expected length of the carry chain that starts at position i () Expected length(i, k) = k j i j i ( ) j = i + k k i + ( ) i Length of the carry chain Probability of the given length Distance till the end of adder Probability of propagation till the end of adder 69 Expected length of the carry chain that starts at position i () Expected length(i, k) = ( k i ) For i << k Expected length of the carry propagation is 7
Number Representation
ECE 645: Lecture 5 Number Representation Part 2 Floating Point Representations Rounding Representation of the Galois Field elements Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and
More informationECE 645: Lecture 5 Number Representation
ECE 645: Lecture 5 Number Representation Part 2 Little-Endian vs. Big-Endian Representations Floating Point Representations Rounding Representation of the Galois Field elements Required Reading Endianness,
More informationECE 645: Lecture 1. Basic Adders and Counters. Implementation of Adders in FPGAs
ECE 645: Lecture Basic Adders and Counters Implementation of Adders in FPGAs Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 5, Basic Addition and Counting,
More informationH5H4, H5E7 lecture 5 Fixed point arithmetic. Overview
H5H4, H5E7 lecture 5 Fixed point arithmetic I. Verbauwhede Acknowledgements: H. DeMan, V. Öwall, D. Hwang, 007-008 K.U.Leuven 1 Overview Lecture 1: what is a system-on-chip Lecture : terminology for the
More informationVTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Arithmetic (a) The four possible cases Carry (b) Truth table x y
Arithmetic A basic operation in all digital computers is the addition and subtraction of two numbers They are implemented, along with the basic logic functions such as AND,OR, NOT,EX- OR in the ALU subsystem
More informationChapter 3: part 3 Binary Subtraction
Chapter 3: part 3 Binary Subtraction Iterative combinational circuits Binary adders Half and full adders Ripple carry and carry lookahead adders Binary subtraction Binary adder-subtractors Signed binary
More informationNumber Systems and Computer Arithmetic
Number Systems and Computer Arithmetic Counting to four billion two fingers at a time What do all those bits mean now? bits (011011011100010...01) instruction R-format I-format... integer data number text
More informationAn Efficient Implementation of Floating Point Multiplier
An Efficient Implementation of Floating Point Multiplier Mohamed Al-Ashrafy Mentor Graphics Mohamed_Samy@Mentor.com Ashraf Salem Mentor Graphics Ashraf_Salem@Mentor.com Wagdy Anis Communications and Electronics
More informationNumeric Encodings Prof. James L. Frankel Harvard University
Numeric Encodings Prof. James L. Frankel Harvard University Version of 10:19 PM 12-Sep-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved. Representation of Positive & Negative Integral and
More informationUNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666
UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer Arithmetic ECE 666 Part 4-B Floating-Point Arithmetic - II Israel Koren ECE666/Koren Part.4b.1 The IEEE Floating-Point
More informationFloating Point. The World is Not Just Integers. Programming languages support numbers with fraction
1 Floating Point The World is Not Just Integers Programming languages support numbers with fraction Called floating-point numbers Examples: 3.14159265 (π) 2.71828 (e) 0.000000001 or 1.0 10 9 (seconds in
More informationAt the ith stage: Input: ci is the carry-in Output: si is the sum ci+1 carry-out to (i+1)st state
Chapter 4 xi yi Carry in ci Sum s i Carry out c i+ At the ith stage: Input: ci is the carry-in Output: si is the sum ci+ carry-out to (i+)st state si = xi yi ci + xi yi ci + xi yi ci + xi yi ci = x i yi
More informationBinary Adders: Half Adders and Full Adders
Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order
More informationLecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1
Lecture 1: VHDL Quick Start Digital Systems Design Fall 10, Dec 17 Lecture 1 1 Objective Quick introduction to VHDL basic language concepts basic design methodology Use The Student s Guide to VHDL or The
More informationEE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing
EE878 Special Topics in VLSI Computer Arithmetic for Digital Signal Processing Part 4-B Floating-Point Arithmetic - II Spring 2017 Koren Part.4b.1 The IEEE Floating-Point Standard Four formats for floating-point
More informationChapter 6 Combinational-Circuit Building Blocks
Chapter 6 Combinational-Circuit Building Blocks Commonly used combinational building blocks in design of large circuits: Multiplexers Decoders Encoders Comparators Arithmetic circuits Multiplexers A multiplexer
More informationIntegers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0
Integers So far, we've seen how to convert numbers between bases. How do we represent particular kinds of data in a certain (32-bit) architecture? We will consider integers floating point characters What
More informationFoundations of Computer Systems
18-600 Foundations of Computer Systems Lecture 4: Floating Point Required Reading Assignment: Chapter 2 of CS:APP (3 rd edition) by Randy Bryant & Dave O Hallaron Assignments for This Week: Lab 1 18-600
More informationAn FPGA based Implementation of Floating-point Multiplier
An FPGA based Implementation of Floating-point Multiplier L. Rajesh, Prashant.V. Joshi and Dr.S.S. Manvi Abstract In this paper we describe the parameterization, implementation and evaluation of floating-point
More informationArithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit
Nurul Hazlina 1 1. Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit Nurul Hazlina 2 Introduction 1. Digital circuits are frequently used for arithmetic operations 2. Fundamental
More informationComputer (Literacy) Skills. Number representations and memory. Lubomír Bulej KDSS MFF UK
Computer (Literacy Skills Number representations and memory Lubomír Bulej KDSS MFF UK Number representations? What for? Recall: computer works with binary numbers Groups of zeroes and ones 8 bits (byte,
More informationMIPS Integer ALU Requirements
MIPS Integer ALU Requirements Add, AddU, Sub, SubU, AddI, AddIU: 2 s complement adder/sub with overflow detection. And, Or, Andi, Ori, Xor, Xori, Nor: Logical AND, logical OR, XOR, nor. SLTI, SLTIU (set
More informationChapter 4 Arithmetic Functions
Logic and Computer Design Fundamentals Chapter 4 Arithmetic Functions Charles Kime & Thomas Kaminski 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Overview Iterative combinational
More informationImplementation of Floating Point Multiplier Using Dadda Algorithm
Implementation of Floating Point Multiplier Using Dadda Algorithm Abstract: Floating point multiplication is the most usefull in all the computation application like in Arithematic operation, DSP application.
More informationFloating-point representations
Lecture 10 Floating-point representations Methods of representing real numbers (1) 1. Fixed-point number system limited range and/or limited precision results must be scaled 100101010 1111010 100101010.1111010
More informationFloating-point representations
Lecture 10 Floating-point representations Methods of representing real numbers (1) 1. Fixed-point number system limited range and/or limited precision results must be scaled 100101010 1111010 100101010.1111010
More informationCPE300: Digital System Architecture and Design
CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10122011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Fixed Point Arithmetic Addition/Subtraction
More informationPart V Real Arithmetic
Part V Real Arithmetic Parts Chapters I. Number Representation 1. 2. 3. 4. Numbers and Arithmetic Representing Signed Numbers Redundant Number Systems Residue Number Systems Elementary Operations II. III.
More informationBinary Arithmetic. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T.
Binary Arithmetic Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. MIT 6.004 Fall 2018 Reminder: Encoding Positive Integers Bit i in a binary representation (in right-to-left order)
More informationDIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS
C H A P T E R 6 DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS OUTLINE 6- Binary Addition 6-2 Representing Signed Numbers 6-3 Addition in the 2 s- Complement System 6-4 Subtraction in the 2 s- Complement
More informationRepresentation of Numbers
Computer Architecture 10 Representation of Numbers Made with OpenOffice.org 1 Number encodings Additive systems - historical Positional systems radix - the base of the numbering system, the positive integer
More informationMicrocomputers. Outline. Number Systems and Digital Logic Review
Microcomputers Number Systems and Digital Logic Review Lecture 1-1 Outline Number systems and formats Common number systems Base Conversion Integer representation Signed integer representation Binary coded
More informationFloating Point Arithmetic
Floating Point Arithmetic CS 365 Floating-Point What can be represented in N bits? Unsigned 0 to 2 N 2s Complement -2 N-1 to 2 N-1-1 But, what about? very large numbers? 9,349,398,989,787,762,244,859,087,678
More informationModule 2: Computer Arithmetic
Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N
More informationUNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666
UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer Arithmetic ECE 666 Part 4-C Floating-Point Arithmetic - III Israel Koren ECE666/Koren Part.4c.1 Floating-Point Adders
More informationPart V Real Arithmetic
Part V Real Arithmetic Parts Chapters I. Number Representation 1. 2. 3. 4. Numbers and Arithmetic Representing Signed Numbers Redundant Number Systems Residue Number Systems Elementary Operations II. III.
More informationEC2303-COMPUTER ARCHITECTURE AND ORGANIZATION
EC2303-COMPUTER ARCHITECTURE AND ORGANIZATION QUESTION BANK UNIT-II 1. What are the disadvantages in using a ripple carry adder? (NOV/DEC 2006) The main disadvantage using ripple carry adder is time delay.
More informationBinary Addition. Add the binary numbers and and show the equivalent decimal addition.
Binary Addition The rules for binary addition are 0 + 0 = 0 Sum = 0, carry = 0 0 + 1 = 0 Sum = 1, carry = 0 1 + 0 = 0 Sum = 1, carry = 0 1 + 1 = 10 Sum = 0, carry = 1 When an input carry = 1 due to a previous
More informationCS 6210 Fall 2016 Bei Wang. Lecture 4 Floating Point Systems Continued
CS 6210 Fall 2016 Bei Wang Lecture 4 Floating Point Systems Continued Take home message 1. Floating point rounding 2. Rounding unit 3. 64 bit word: double precision (IEEE standard word) 4. Exact rounding
More informationECE232: Hardware Organization and Design
ECE232: Hardware Organization and Design Lecture 11: Floating Point & Floating Point Addition Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Last time: Single Precision Format
More informationMid-Term Exam Solutions
CS/EE 26 Digital Computers: Organization and Logical Design Mid-Term Eam Solutions Jon Turner 3/3/3. (6 points) List all the minterms for the epression (B + A)C + AC + BC. Epanding the epression gives
More informationBasic Arithmetic (adding and subtracting)
Basic Arithmetic (adding and subtracting) Digital logic to show add/subtract Boolean algebra abstraction of physical, analog circuit behavior 1 0 CPU components ALU logic circuits logic gates transistors
More informationA High Speed Binary Floating Point Multiplier Using Dadda Algorithm
455 A High Speed Binary Floating Point Multiplier Using Dadda Algorithm B. Jeevan, Asst. Professor, Dept. of E&IE, KITS, Warangal. jeevanbs776@gmail.com S. Narender, M.Tech (VLSI&ES), KITS, Warangal. narender.s446@gmail.com
More informationCO212 Lecture 10: Arithmetic & Logical Unit
CO212 Lecture 10: Arithmetic & Logical Unit Shobhanjana Kalita, Dept. of CSE, Tezpur University Slides courtesy: Computer Architecture and Organization, 9 th Ed, W. Stallings Integer Representation For
More informationInternational Journal of Research in Computer and Communication Technology, Vol 4, Issue 11, November- 2015
Design of Dadda Algorithm based Floating Point Multiplier A. Bhanu Swetha. PG.Scholar: M.Tech(VLSISD), Department of ECE, BVCITS, Batlapalem. E.mail:swetha.appari@gmail.com V.Ramoji, Asst.Professor, Department
More informationAdvanced Computer Architecture-CS501
Advanced Computer Architecture Lecture No. 34 Reading Material Vincent P. Heuring & Harry F. Jordan Chapter 6 Computer Systems Design and Architecture 6.1, 6.2 Summary Introduction to ALSU Radix Conversion
More informationECE331: Hardware Organization and Design
ECE331: Hardware Organization and Design Lecture 15: Midterm 1 Review Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Basics Midterm to cover Book Sections (inclusive) 1.1 1.5
More informationInf2C - Computer Systems Lecture 2 Data Representation
Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack
More informationECE331: Hardware Organization and Design
ECE331: Hardware Organization and Design Lecture 10: Multiplication & Floating Point Representation Adapted from Computer Organization and Design, Patterson & Hennessy, UCB MIPS Division Two 32-bit registers
More informationBinary Adders. Ripple-Carry Adder
Ripple-Carry Adder Binary Adders x n y n x y x y c n FA c n - c 2 FA c FA c s n MSB position Longest delay (Critical-path delay): d c(n) = n d carry = 2n gate delays d s(n-) = (n-) d carry +d sum = 2n
More informationNumber System. Introduction. Decimal Numbers
Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26
More informationCOMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers Implementation
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 3 Arithmetic for Computers Implementation Today Review representations (252/352 recap) Floating point Addition: Ripple
More informationChapter 4. Operations on Data
Chapter 4 Operations on Data 1 OBJECTIVES After reading this chapter, the reader should be able to: List the three categories of operations performed on data. Perform unary and binary logic operations
More informationCOMP2611: Computer Organization. Data Representation
COMP2611: Computer Organization Comp2611 Fall 2015 2 1. Binary numbers and 2 s Complement Numbers 3 Bits: are the basis for binary number representation in digital computers What you will learn here: How
More informationECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012
Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate
More informationFloating Point Arithmetic
Floating Point Arithmetic Floating point numbers are frequently used in many applications. Implementation of arithmetic units such as adder, multiplier, etc for Floating point numbers are more complex
More informationFloating Point (with contributions from Dr. Bin Ren, William & Mary Computer Science)
Floating Point (with contributions from Dr. Bin Ren, William & Mary Computer Science) Floating Point Background: Fractional binary numbers IEEE floating point standard: Definition Example and properties
More informationComputer Organization and Levels of Abstraction
Computer Organization and Levels of Abstraction Announcements Today: PS 7 Lab 8: Sound Lab tonight bring machines and headphones! PA 7 Tomorrow: Lab 9 Friday: PS8 Today (Short) Floating point review Boolean
More informationGroups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...
Chapter 9 Computer Arithmetic Reading: Section 9.1 on pp. 290-296 Computer Representation of Data Groups of two-state devices are used to represent data in a computer. In general, we say the states are
More informationINF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic
INF2270 Spring 2010 Philipp Häfliger Lecture 4: Signed Binaries and Arithmetic content Karnaugh maps revisited Binary Addition Signed Binary Numbers Binary Subtraction Arithmetic Right-Shift and Bit Number
More informationECE468 Computer Organization & Architecture. The Design Process & ALU Design
ECE6 Computer Organization & Architecture The Design Process & Design The Design Process "To Design Is To Represent" Design activity yields description/representation of an object -- Traditional craftsman
More informationQuixilica Floating Point FPGA Cores
Data sheet Quixilica Floating Point FPGA Cores Floating Point Adder - 169 MFLOPS* on VirtexE-8 Floating Point Multiplier - 152 MFLOPS* on VirtexE-8 Floating Point Divider - 189 MFLOPS* on VirtexE-8 Floating
More informationChapter 2: Number Systems
Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many
More informationWorld Inside a Computer is Binary
C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix
More informationChapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>
Chapter 5 Digital Design and Computer Architecture, 2 nd Edition David Money Harris and Sarah L. Harris Chapter 5 Chapter 5 :: Topics Introduction Arithmetic Circuits umber Systems Sequential Building
More informationCO Computer Architecture and Programming Languages CAPL. Lecture 9
CO20-320241 Computer Architecture and Programming Languages CAPL Lecture 9 Dr. Kinga Lipskoch Fall 2017 A Four-bit Number Circle CAPL Fall 2017 2 / 38 Functional Parts of an ALU CAPL Fall 2017 3 / 38 Addition
More informationDigital Logic & Computer Design CS Professor Dan Moldovan Spring 2010
Digital Logic & Computer Design CS 434 Professor Dan Moldovan Spring 2 Copyright 27 Elsevier 5- Chapter 5 :: Digital Building Blocks Digital Design and Computer Architecture David Money Harris and Sarah
More informationBy, Ajinkya Karande Adarsh Yoga
By, Ajinkya Karande Adarsh Yoga Introduction Early computer designers believed saving computer time and memory were more important than programmer time. Bug in the divide algorithm used in Intel chips.
More informationWe are quite familiar with adding two numbers in decimal
Addition We are quite familiar with adding two numbers in decimal What about adding two binary numbers? If we use the two s complement method to represent binary numbers, addition can be done in a straightforward
More informationCPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS
CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:
More informationReal Digital Problem Set #6
Real igital Problem et #6. (2 points) ketch a block diagram for a magnitude comparator bit-slice circuit. Create K-maps to define the bit-slice circuit, and use them to find optimal logic equations. ketch
More informationECE 30 Introduction to Computer Engineering
ECE 30 Introduction to Computer Engineering Study Problems, Set #6 Spring 2015 1. With x = 1111 1111 1111 1111 1011 0011 0101 0011 2 and y = 0000 0000 0000 0000 0000 0010 1101 0111 2 representing two s
More informationPESIT Bangalore South Campus
INTERNAL ASSESSMENT TEST III Date : 21/11/2017 Max Marks : 40 Subject & Code : Computer Organization (15CS34) Semester : III (A & B) Name of the faculty: Mrs. Sharmila Banu Time : 11.30 am 1.00 pm Answer
More informationAddition and multiplication
Addition and multiplication Arithmetic is the most basic thing you can do with a computer, but it s not as easy as you might expect! These next few lectures focus on addition, subtraction, multiplication
More informationFloating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !
Floating point Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties Next time! The machine model Chris Riesbeck, Fall 2011 Checkpoint IEEE Floating point Floating
More informationDivide: Paper & Pencil
Divide: Paper & Pencil 1001 Quotient Divisor 1000 1001010 Dividend -1000 10 101 1010 1000 10 Remainder See how big a number can be subtracted, creating quotient bit on each step Binary => 1 * divisor or
More information60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design
60-265: Winter 2010 Computer Architecture I: Digital Design ANSWERS Exercise 4 Combinational Circuit Design Question 1. One-bit Comparator [ 1 mark ] Consider two 1-bit inputs, A and B. If we assume that
More informationIn this lesson you will learn: how to add and multiply positive binary integers how to work with signed binary numbers using two s complement how fixed and floating point numbers are used to represent
More informationCOMP 122/L Lecture 2. Kyle Dewey
COMP 122/L Lecture 2 Kyle Dewey Outline Operations on binary values AND, OR, XOR, NOT Bit shifting (left, two forms of right) Addition Subtraction Twos complement Bitwise Operations Bitwise AND Similar
More informationVHDL IMPLEMENTATION OF FLOATING POINT MULTIPLIER USING VEDIC MATHEMATICS
VHDL IMPLEMENTATION OF FLOATING POINT MULTIPLIER USING VEDIC MATHEMATICS I.V.VAIBHAV 1, K.V.SAICHARAN 1, B.SRAVANTHI 1, D.SRINIVASULU 2 1 Students of Department of ECE,SACET, Chirala, AP, India 2 Associate
More informationDigital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand
Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary
More informationCS101 Lecture 04: Binary Arithmetic
CS101 Lecture 04: Binary Arithmetic Binary Number Addition Two s complement encoding Briefly: real number representation Aaron Stevens (azs@bu.edu) 25 January 2013 What You ll Learn Today Counting in binary
More informationContents. Chapter 9 Datapaths Page 1 of 28
Chapter 9 Datapaths Page of 2 Contents Contents... 9 Datapaths... 2 9. General Datapath... 3 9.2 Using a General Datapath... 5 9.3 Timing Issues... 7 9.4 A More Complex General Datapath... 9 9.5 VHDL for
More informationComputer Architecture and Organization
3-1 Chapter 3 - Arithmetic Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 3 Arithmetic 3-2 Chapter 3 - Arithmetic Chapter Contents 3.1 Fixed Point Addition and Subtraction
More informationDigital System Construction
Digital System Construction FYSIKUM Lecture 4: More VHDL, memory, PRNG Arithmetic Memories Pipelines and buffers Pseudorandom numbers IP core generation in Vivado Introduction to Lab 3 Digital Systemkonstruktion
More informationDigital Fundamentals
Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted
More informationArithmetic Circuits. Design of Digital Circuits 2014 Srdjan Capkun Frank K. Gürkaynak.
Arithmetic Circuits Design of Digital Circuits 2014 Srdjan Capkun Frank K. Gürkaynak http://www.syssec.ethz.ch/education/digitaltechnik_14 Adapted from Digital Design and Computer Architecture, David Money
More informationDecimal & Binary Representation Systems. Decimal & Binary Representation Systems
Decimal & Binary Representation Systems Decimal & binary are positional representation systems each position has a value: d*base i for example: 321 10 = 3*10 2 + 2*10 1 + 1*10 0 for example: 101000001
More informationComputer Architecture Set Four. Arithmetic
Computer Architecture Set Four Arithmetic Arithmetic Where we ve been: Performance (seconds, cycles, instructions) Abstractions: Instruction Set Architecture Assembly Language and Machine Language What
More informationScientific Computing. Error Analysis
ECE257 Numerical Methods and Scientific Computing Error Analysis Today s s class: Introduction to error analysis Approximations Round-Off Errors Introduction Error is the difference between the exact solution
More informationDLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR
UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error
More informationCPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS
CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:
More informationCS 64 Week 1 Lecture 1. Kyle Dewey
CS 64 Week 1 Lecture 1 Kyle Dewey Overview Bitwise operation wrap-up Two s complement Addition Subtraction Multiplication (if time) Bitwise Operation Wrap-up Shift Left Move all the bits N positions to
More informationChapter 4 Arithmetic
Computer Eng 1 (ECE290) Chapter 4 Arithmetic Functions and Circuits HOANG Trang Reference: 2008 Pearson Education, Inc. Lecture note of Prof.Donna J.Brown Overview Binary adders Half and full adders Ripple
More informationReview. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;
LIBRARY list of library names; USE library.package.object; Review ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type; signal_name(s) : mode signal_type); END ENTITY entity_name;
More informationComputer Organization and Levels of Abstraction
Computer Organization and Levels of Abstraction Announcements PS8 Due today PS9 Due July 22 Sound Lab tonight bring machines and headphones! Binary Search Today Review of binary floating point notation
More informationLecture 5. Other Adder Issues
Lecture 5 Other Adder Issues Mark Horowitz Computer Systems Laboratory Stanford University horowitz@stanford.edu Copyright 24 by Mark Horowitz with information from Brucek Khailany 1 Overview Reading There
More informationFloating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3
Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Instructor: Nicole Hynes nicole.hynes@rutgers.edu 1 Fixed Point Numbers Fixed point number: integer part
More informationComputer Arithmetic Floating Point
Computer Arithmetic Floating Point Chapter 3.6 EEC7 FQ 25 About Floating Point Arithmetic Arithmetic basic operations on floating point numbers are: Add, Subtract, Multiply, Divide Transcendental operations
More informationECE331: Hardware Organization and Design
ECE331: Hardware Organization and Design Lecture 9: Binary Addition & Multiplication Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Pop Quiz! Using 4 bits signed integer notation:
More information