Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry.

Slides:



Advertisements
Similar presentations
Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
Advertisements

Cosc 2150: Computer Organization Chapter 9, Part 2 Integer multiplication and division.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 8 - Multiplication.
THE ARITHMETIC-LOGIC UNIT. BINARY HALF-ADDER BINARY HALF-ADDER condt Half adder InputOutput XYSC
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
UNIVERSITY OF MASSACHUSETTS Dept
EE 382 Processor DesignWinter 98/99Michael Flynn 1 AT Arithmetic Most concern has gone into creating fast implementation of (especially) FP Arith. Under.
Lecture 9 Sept 28 Chapter 3 Arithmetic for Computers.
Chapter 6 Arithmetic. Addition Carry in Carry out
L10 – Multiplication Division 1 Comp 411 – Fall /19/2009 Binary Multipliers ×
Computer Organization Multiplication and Division Feb 2005 Reading: Portions of these slides are derived from: Textbook figures © 1998 Morgan Kaufmann.
UNIVERSITY OF MASSACHUSETTS Dept
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
ECE 301 – Digital Electronics
COE 308: Computer Architecture (T041) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (Appendix A, Computer Architecture: A Quantitative Approach,
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
Computer Arithmetic Integers: signed / unsigned (can overflow) Fixed point (can overflow) Floating point (can overflow, underflow) (Boolean / Character)
Ch. 21. Square-rootingSlide 1 VI Function Evaluation Topics in This Part Chapter 21 Square-Rooting Methods Chapter 22 The CORDIC Algorithms Chapter 23.
ECE 645 – Computer Arithmetic Lecture 10: Fast Dividers ECE 645—Computer Arithmetic 4/15/08.
Lecture 10 Fast Dividers.
ECE 645 – Computer Arithmetic Lecture 9: Basic Dividers ECE 645—Computer Arithmetic 4/1/08.
3-1 Chapter 3 - Arithmetic Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
1 Arithmetic and Logical Operations - Part II. Unsigned Numbers Addition in unsigned numbers is the same regardless of the base. Given a pair of bit sequences.
ECE 4110– Sequential Logic Design
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
Conversion Between Lengths Positive number pack with leading zeros +18 = = Negative numbers pack with leading ones -18 =
Chapter 8 Problems Prof. Sin-Min Lee Department of Mathematics and Computer Science.
Copyright 1995 by Coherence LTD., all rights reserved (Revised: Oct 97 by Rafi Lohev, Oct 99 by Yair Wiseman, Sep 04 Oren Kapah) IBM י ב מ 10-1 The ALU.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Number Systems and Arithmetic or Computers go to elementary school Reading – Peer Instruction Lecture Materials for Computer Architecture by Dr.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Number Systems. Why binary numbers? Digital systems process information in binary form. That is using 0s and 1s (LOW and HIGH, 0v and 5v). Digital designer.
Multiplication of signed-operands
Lecture 6: Multiply, Shift, and Divide
Lecture 4 Multiplier using FPGA 2007/09/28 Prof. C.M. Kyung.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Mohamed Younis CMCS 411, Computer Architecture 1 CMSC Computer Architecture Lecture 11 Performing Division March 5,
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
COE 308: Computer Architecture (T032) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (Appendix A, Computer Architecture: A Quantitative Approach,
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.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 7 Division.
ECE/CS 552: Arithmetic I Instructor:Mikko H Lipasti Fall 2010 University of Wisconsin-Madison Lecture notes partially based on set created by Mark Hill.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
Integer Multiplication and Division COE 301 Computer Organization Dr. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University.
MicroProcessors Lec. 4 Dr. Tamer Samy Gaafar. Course Web Page —
Chapter 8 Computer Arithmetic. 8.1 Unsigned Notation Non-negative notation  It treats every number as either zero or a positive value  Range: 0 to 2.
UNIT 2. ADDITION & SUBTRACTION OF SIGNED NUMBERS.
Reconfigurable Computing - Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on Cockburn Sound,
S 2/e C D A Computer Systems Design and Architecture Second Edition© 2004 Prentice Hall Chapter 6 Overview Number Systems and Radix Conversion Fixed point.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
Arithmetic for Computers Chapter 3 1. Arithmetic for Computers  Operations on integers  Addition and subtraction  Multiplication and division  Dealing.
More Binary Arithmetic - Multiplication
UNIVERSITY OF MASSACHUSETTS Dept
Morgan Kaufmann Publishers
UNIVERSITY OF MASSACHUSETTS Dept
ECEG-3202 Computer Architecture and Organization
12/7/
Reading: Study Chapter (including Booth coding)
Montek Singh Mon, Mar 28, 2011 Lecture 11
Number Representation
Presentation transcript:

Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry Adder (See Fig. 2.6) Longest delay (Critical-path delay): d c(n) = n×d carry = 2n gate delays d s(n-1) = (n-1)× d carry +d sum = 2n gate delays Binary Adders

Digital Kommunikationselektronik TNE027 Lecture 2 2 Full adder

Digital Kommunikationselektronik TNE027 Lecture 2 3 Fast-carry logic in FPGAs –The fast-carry logic is about a magnitude faster than the delay through a regular logic LUT. See Fig FCL c n c n1- c n c 2 c 2 c 1 x n –1 y n1– x 1 y 1 x 0 y 0 c 1 c 0 x 1 y n1– x 1 y 1 x 0 y 0 XOR s n-1 XOR s 0 s 1

Digital Kommunikationselektronik TNE027 Lecture 2 4 Instruction pipeline for a RISC Instruction fetch Instruction decode and register fetch Execution and address calculation Memory access ResultW rite back IFIDEXMEMWB Instruction Pipelining Total latency: Total delay time from instruction fetch to result write back to a register Throughput (maximum frequency, registered performance): Number of results (instructions) per second

Digital Kommunikationselektronik TNE027 Lecture 2 5 Instruction Pipelining (continued)

Digital Kommunikationselektronik TNE027 Lecture 2 6 Pipelined adders –Pipelining principle can be applied to FPGA designs at little or no additional cost since each logic element contains a flip-flop, which is otherwise unused. –An arithmetic operation is broken into small primitive operations. The result of each primitive operations is saved in registers after each pipeline stage. –If one part of the data is not processed at a pipeline stage, this part of data should still be saved after the pipeline stage. See Fig Arithmetic Pipelining

Digital Kommunikationselektronik TNE027 Lecture 2 7 Modulo Adders –Building block of RNS-DSP design –Modulo operation is performed by (a) an extra adder or (b) a ROM look-up table. See Fig.2.11.

Digital Kommunikationselektronik TNE027 Lecture 2 8 Multiplication by 2 k can be implemented by shifting the bits of the operand to the left by k. Division by 2 k can be implemented by shifting the bits of the operand to the right by k. For signed numbers, it is necessary to preserve the sign. This is done by shifting the bits to the right and filling from the left with the value of the sign bit. Multiplication and Division by 2 k

Digital Kommunikationselektronik TNE027 Lecture 2 9 Binary Multipliers Multiplication of unsigned numbers  Multiplicand M Multiplier Q Product P (14) (11) (154) Multiplication of unsigned numbers by hand

Digital Kommunikationselektronik TNE027 Lecture 2 10  Multiplicand M Multiplier Q Product P (11) (14) (154) Partial product 0 Partial product 1 Partial product 2 Multiplication of unsigned numbers Multiplication for implementation in hardware

Digital Kommunikationselektronik TNE027 Lecture 2 11 Shift-add multiplier –Serial/parallel multiplier N full adders + shift registers –Serial/serial multiplier One carry-save adder + shift registers –Parallel/parallel multiplier (array multiplier) N 2 full adders (See Fig ) Fast array multiplier for FPGAs (See Fig ) Multiplier blocks P = Y  X = (Y 2 2 N +Y 1 ) (X 2 2 N +X 1 ) = Y 2 X 2 2 2N + (Y 2 X 1 +Y 1 X 2 ) 2 N + Y 1 X 1

Digital Kommunikationselektronik TNE027 Lecture 2 12 Carry-save adder Serial/serial multiplier Multiplicant & Multiplier Carry-save adder Partial product Full adder a b D Q Q Carry-out Clock Reset D Q Q s Y 2 Y 1 Sum bit y 2 y 1

Digital Kommunikationselektronik TNE027 Lecture 2 13 Serial/parallel multiplier using carry-save adders FA D D & D D & D... A n-2 A0A0 FA D & A n-1 B n-1 B n-2...B 0 shift... Multiplicant A n-1 A n-2...A 0 Multiplier B n-1 B n-2...B 0

Digital Kommunikationselektronik TNE027 Lecture 2 14 Binary Dividers Division –Division is the most complex operation among the 4 basic arithmetic operations. –Let N denote numerator and D denominator, two results are produced: the quotient Q and the remainder R: N / D = Q + R / D

Digital Kommunikationselektronik TNE027 Lecture 2 15 –In division, each quotient bit is determined in a sequential “trial-and-error” procedure. (In multiplication, all partial products can be produced parallel.) –Result should be constrained: Q  N and |R|  D –For signed numbers, R and N are assumed to have the same sign.

Digital Kommunikationselektronik TNE027 Lecture 2 16 Division Algorithms Linear Convergence Division Algorithms Restoring divider –a trial-and-error method translated directly from the “pencil-and-paper” method See example –The main disadvantage of the restoring divider is that we need two steps, subtract and add (i.e., restore), to determine one quotient bit.

Digital Kommunikationselektronik TNE027 Lecture 2 17 Nonperforming divider –A temporary remainder value is tested before the remainder register is updated. –Note that the following VHDL code describes a combinational circuit. t := r – d;--temporary remainder value IF t >= 0 THEN -- Nonperforming test r := t;-- Update remainder q := q * 2 + 1;-- Shift left and add 1 ELSE q :=q * 2;-- Shift left END IF;

Digital Kommunikationselektronik TNE027 Lecture 2 18 Nonrestoring divider –Always perform the subtraction. –If the remainder is negative, perform an addition of d k /2 in the next step, instead of the restoring addition of d k in the present step and the subtraction of d k /2 in the next step. –The quotient bit can be positive or negative, i.e., d k =  1, but not zero. This is a signed-digit representation. The negative ones can be saved in the quotient register as zeros.

Digital Kommunikationselektronik TNE027 Lecture 2 19 –The signed-digit representation should be converted to 2’s complement representation. For example: q SD =1111 is saved as 1001 in the quotient register. To convert: 1001 (positive ones) – 0110 (negative ones) 0011 alternatively: 2 * –Correct remainder if r < 0: r := r + D and q := q – 1.

Digital Kommunikationselektronik TNE027 Lecture 2 20 Fast Divider Design Division through multiplication with reciprocal of denominator –The reciprocal can be computed via a look-up table for small bit width. –One can use Newton Algorithm to compute the reciprocal. f(x) = 1/x – D  0 x ∞ = 1/D x k+1 = x k – f(x k ) / f ´(x k ) x k+1 = x k (2 – D  x k )

Digital Kommunikationselektronik TNE027 Lecture 2 21 Division by Convergence –Both numerator N and denominator D are multiplied by approximation factors f k. –After a sufficient number of iterations k (quadratic convergence), D Π f k  1 and N Π f k  Q Algorithm: 1)Normalize N and D such that D is close to 1. 2)Initialize x 0 = N and t 0 = D. 3)Repeat the following loop until x k shows the desired precision. f k = 2 – t k x k+1 = x k  f k t k+1 = t k  f k See Example 2.21.