CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu

Slides:



Advertisements
Similar presentations
CENG536 Computer Engineering department Çankaya University.
Advertisements

Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Computer Science 210 Computer Organization Floating Point Representation.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
9.4 FLOATING-POINT REPRESENTATION
Fixed and Floating Point Numbers Lesson 3 Ioan Despi.
ECE 8053 Introduction to Computer Arithmetic (Website: Course & Text Content: Part 1: Number Representation.
Floating Point Arithmetic
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Computer Organization and Design Information Encoding II Montek Singh Wed, Aug 29, 2012 Lecture 3.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
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.
DATA REPRESENTATION Data Types Complements Fixed Point Representations
Cosc 2150: Computer Organization Chapter 9, Part 3 Floating point numbers.
Floating Point Arithmetic – Part I
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
MATH Lesson 2 Binary arithmetic.
CS2100 Computer Organisation
Department of Computer Science Georgia State University
Computer Science 210 Computer Organization
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
Computer Architecture & Operations I
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
Integer Division.
Topics IEEE Floating Point Standard Rounding Floating Point Operations
CS 232: Computer Architecture II
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
April 2006 Saeid Nooshabadi
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
William Stallings Computer Organization and Architecture 7th Edition
Arithmetic for Computers
Outline Introduction Floating Point Arithmetic Adder Multiplier.
CS1010 Programming Methodology
CSE 575 Computer Arithmetic Spring 2005 Mary Jane Irwin (www. cse. psu
Wakerly Section 2.4 and further
Data Structures Mohammed Thajeel To the second year students
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
Topic 3d Representation of Real Numbers
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
CSE 575 Computer Arithmetic Spring 2002 Mary Jane Irwin (www. cse. psu
Data Representation Data Types Complements Fixed Point Representation
Computer Science 210 Computer Organization
Data Representation in Computer Systems
Arithmetic Logical Unit
How to represent real numbers
How to represent real numbers
ECEG-3202 Computer Architecture and Organization
Chapter 8 Computer Arithmetic
Prof. Giancarlo Succi, Ph.D., P.Eng.
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Topic 3d Representation of Real Numbers
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
Presentation transcript:

CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www.cse.psu.edu/~mji)

Student Presentations - April 29 1 9:45 Fast adders Matt & Ki-Yong 2 10:10 Array multipliers Jahan & Jaehyun 3 10:35 Divider Wei-Lun & Ing-Chao 11:00 BREAK 4 11:15 Log PE Swapna, Greg, Eric, & Theo 5 12:05 Nanosenor PE Aman

Number Representations “Understanding different ways of representing numbers, including their relative cost-performance benefits and conversions between various representations, is an important prerequisite for designing efficient arithmetic algorithms or circuits.” Parhami

Review of Machine Representations Positional - value of each symbol depends on its relative position Fixed radix, r - unit of each position is a constant multiple of the radix (base) Consecutive symbol (or digit) set, D, with at least r symbols Scale factor, s - implied radix point (integer, fraction, or mixed number) Precision, n=k+l - granularity of representation Range - number of distinct values from largest to smallest; depends on n, s, and r Advantages – simple and elegant algorithms for performing arithmetic Digit set consists of at least r consecutive, distinct, integer digits

Real Number Representations Floating point (approximation) Exact arithmetic (continued fractions, fixed-slash and floating-slash number systems) Keep numbers as num/denom pairs Exact arithmetic (e.g., 2/3) Division is multiplication Interval arithmetic Logarithmic representation Essentially logarithmic representation is floating point with no significand field (other than the hidden 1)

Logarithmic Number System Keep numbers as log2 |x| Fast, easy multiply and divide (just add and subtract) Large dynamic range, but low precision Hard addition and subtraction, conversion Positional - value of each symbol depends on its relative position Fixed radix, r - unit of each position is a constant multiple of the radix Consecutive symbol (or digit) set, D, with at least r symbols Scale factor, s - mixed number Advantages – simple and elegant algorithms for performing arithmetic Digit set consists of at least r consecutive, distinct, integer digits

Representing Logarithmic Numbers Components – sign, exponent E X=  bE so E = logb |X| where is b is a constant (usually 2) and where E is usually a signed mixed number (or is scaled up by a constant factor if X < 1 so that E is always positive) Do scaling so don’t have negative logarithms (would be the case for numbers between 0 and 1) if want to represent numbers smaller than 1 Scaling means logarithm part biased by the logarithm of the constant If we forced E to be an integer (rather than mixed number) we could only represent powers of b! sign Fixed point exponent E  Implied radix point

Conversion to Log Rep Given X an integer X = 2K * (1 + F) where 0  F < 1 log2 |X| = K + log2 (1 + F)  K + F K is the number of bits between the left most 1 and the binary point F is the remaining bits excluding the leftmost one represented as a fraction e.g., X = 1001001.2 = 7310 K = 6 = 1102; F = .0010012 E = 110.001001 (2E = 70.55) only exact for powers-of-two values of X

Conversion from Log Rep Given E = K + F then X = 2K * (1 + F) K is the integer part of E F is the fractional part of E e.g., E = 110.0010012 K = 1102 = 6; F = .0010012 X = 26 * (1.001001) = 10010012 = 7310

Logarithmic Arithmetic (SX, LX) = (sign(X), log2 |X|) Multiplication (SX, LX)  (SY, LY) = (SX  SY, LX + LY) Division (SX, LX) / (SY, LY) = (SX  SY, LX - LY) Addition/Subtraction (SX, LX)  (SY, LY) = (SZ, LZ)

Addition/Subtraction Assuming X  Y  0 LZ = log (X  Y)  computed via table lookup = log (X(1  Y/X)) = LX + log (1  Y/X) log (Y/X) can be easily computed as  = - (LX - LY) So, given , log (1  Y/X) = log (1  log-1 ) which is obtained via a table lookup ROM (with  as the input) log (X + Y ) = LX + +() log (X - Y ) = LX + -() Binary input ROM too expensive – for 12 bit operands would be a 2 **24 table of 12 bit results!!

Indirect Log Add&Subtract 2u+1 addr bits LX (u-bits) u contentbits  2** ROM log (1  log-1 ) Subtractor LY (u-bits) () Need two tables - one holding log(1+log-1 of delta) for add; and one holding log(1-log-1 of delta) for subtract Adder u +1 bits LZ (u-bits)

Logarithmic ALU SX SZ SY Control add/subt LX Compare LY +,- ROM LX>LY add/subt LX Compare LY +,- ROM mult/div Lm Assumes the use of scaling of all values by a multiplicative factor m, so that numbers between 0 and 1 are also represented with unsigned logarithms. So the log of the scale factor, m, (bias Lm) must be subtracted in multiplication and added in division. LZ

Other Arithmetic Topics Residue (next lecture) Distributed arithmetic On-line or digit-pipelined arithmetic . . .

Key References Muller, Scherbyna, Tisserand, Semi-logarithmic Number Systems, IEEE Trans. on Computers, 47(2):145-151, 1998. Noetzel, An interpolating memory unit for function evaluation, IEEE Trans. on Computers, 38(3):377-384, 1989. Parhami, Computer Arithmetic, Oxford Univ. Press, 1999. Swartzlander, Alexopoulos, The Sign/Logarithm Number System, IEEE Trans. on Computers, 24(12):1238-1242, 1975.