Download presentation
Presentation is loading. Please wait.
Published byAnn Henderson Modified over 9 years ago
1
Computer Arithmetic — Number Representation Paolo.Ienne@epfl.ch EPFL – I&C – LAP Vojin.Oklobdzija@epfl.ch EPFL – CSDA and UC Davis – ACSEL
2
© Ienne, Oklobdzjia 2004CompArith — Number Representation2 Why Representation? Need to map numbers to binary bits Need a representation anyway… Representation is consequential Complexity of arithmetic operations depends heavily on the representation Number representation is the heart of computer arithmetic…
3
© Ienne, Oklobdzjia 2004CompArith — Number Representation3 What Is a Number System? A number is represented as an ordered n-tuple of symbols (digit vector) Each symbol is a digit Digits usually represent integers from a given set—e.g.,
4
© Ienne, Oklobdzjia 2004CompArith — Number Representation4 Rule of Interpretation Mapping from set of digit vectors to numbers (e.g., integers, reals) “twelve” digit vectorsN, Z, R,…
5
© Ienne, Oklobdzjia 2004CompArith — Number Representation5 Positional Weighted Systems The rule of interpretation is a scalar product where is the weight vector
6
© Ienne, Oklobdzjia 2004CompArith — Number Representation6 Radix Systems Weights are not arbitrary but related to a radix vector in the following way
7
© Ienne, Oklobdzjia 2004CompArith — Number Representation7 Mixed-Radix Systems Fixed-radix if all elements of R are identical A few mixed-radix systems are very common—e.g., time
8
© Ienne, Oklobdzjia 2004CompArith — Number Representation8 Common Decimal Notation It is weighted It is positional It is fixed-radix
9
© Ienne, Oklobdzjia 2004CompArith — Number Representation9 Common Decimal Notation It is nonredundant because canonical 10 n possible digit vectors to represent 10 n values Weighted, positional, fixed-radix, nonredundant also called conventional systems
10
© Ienne, Oklobdzjia 2004CompArith — Number Representation10 Digit Set Canonical set A canonical system is nonredundant Any other choice is noncanonical
11
© Ienne, Oklobdzjia 2004CompArith — Number Representation11 Very Large Choice of Weighted Positional Number Systems Source: Parhami, © Oxford 2000
12
© Ienne, Oklobdzjia 2004CompArith — Number Representation12 Sign-and-Magnitude Representation Some advantages and disadvantages Familiar for users Simple naïve multiplication Adders are not the most efficient Redundant zero (+0 and –0) may cause some problems (e.g. testing for a variable =0)
13
© Ienne, Oklobdzjia 2004CompArith — Number Representation13 References M. D. Ercegovac and T. Lang, Digital Arithmetic, Morgan Kaufmann, 2004 I. Koren, Computer Arithmetic Algorithms, Peters, 2002 A. R. Omondi, Computer Arithmetic Systems— Algorithms, Architecture and Implementation, Prentice Hall, 1991 B. Parhami, Computer Arithmetic—Algorithms and Hardware Designs, Oxford, 2000
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.