01 DigitalNumericalFormats
01 DigitalNumericalFormats
Numerical Representation
Fabrizio Frescura
DSP LAB
Dipartimento di Ingegneria Elettronica e
dell’Informazione - Perugia
What a DSP is
• Digital signal processing is defined as:
The science concerned with the
representation of signals by sequences
of numbers and the subsequent
processing of these number sequences
16/24 bits
32 bits
S Exponent Mantissa
Fixed Point Numbers
• An ordinary decimal number with which everyone is familiar consists of a
string of decimal digits and, possibly, a decimal point.
Decimal Point
10 i
D
N i
b 2 i
i ( B ( D 1))
i ( B ( D 1))
hard to find: we want an encoding
system with two properties:
TWO’S COMPLEMENT PROPERTIES
1. Only one representation for zero.
2. Exactly as many positive
numbers as negative numbers.
• The problem is that any set of numbers 0 0000 0111 7
with as many positive as negative
numbers and only one zero has an odd
number of members, whereas m bits
allow an even number of bit patterns. -1 1111 1000 -8
Overflow and Underflow and dynamic range
N = bD….. b2 b1 b0 . b-1 b-2 …….. b- (B - (D + 1))
• Largest (positive) representable number:
D
M FP 1 2 i
If N>MFP the number is no more representable so
i ( B ( D 1)) overflow occour:
no more representable
so underflow occour:
• For two’s complement numbers
D 1
the all 1s configuration is a
negative number (-1) so...
M FP 1 2 i
i ( B ( D 1))
Real-axe Representation with Fixed Point Numbers
B Bit Unsigned Format
-(2B-1* NFP ) -2*NFP -NFP 0 +NFP +2*NFP MFP = (2B-1* NFP )- NFP
Real-axe Representation with Fixed Point Numbers
Mfp
e
n f 10
• where f is called the fraction, or mantissa, and e is a
positive or negative integer called the exponent. The DSP
version of this notation is called floating point. Some
examples of numbers expressed in this form are:
3.14 = 0.314 x101 = 3.14 x100
0.000001 = 0.1 x10-5 = 1.0 x10-6
1941 = 0.1941 x104 = 1.941x x103
Principles of Floating Point
• The range is effectively determined by
the number of digits in the exponent
and the precision is determined by the
number of digits in the mantissa.
Because there is more than one way to
represent a given number, one form is
usually chosen as the standard. Mantissa Exponent
• To view the properties of this method
of representing numbers, consider a
Smaller number: +.100x10-99
representation, R, with a signed three-
digit fraction in the range 0.1 <= | f | < Largest number: +.999x10 +99