136
D. Rocchesso: Sound Processing
bytes
hexadecimal
fixed point
floating point
· there is only one representation of the zero
19
.
· it has a cyclic structure: a unit increment of the largest representable
positive number gives the negative number with the largest absolute value
· the sums between signed numbers are performed by simple bitwise op-
eration and without caring about the sign (a carry on the left can be
ignored)
We note that
· the negative number with the largest absolute value is 100 . . . 0
2
. Its abso-
lute value exceeds that of the largest positive number (i.e., 011 . . . 1
2
) by
one
· the negative number with the smallest absolute value is represented by
111 . . . 1
2
· the range of the numbers representable in two's complement with 16 bits
is [-2
15
, 2
15
- 1] = [-32768, 32767]
· the range of the numbers representable in two's complement with 8 bits
is [-2
7
, 2
7
- 1] = [-128, 127]
Often, in computer memory words and addresses are organized as collections
of 8-bit packets, called bytes. Therefore, it is useful to use a representation where
the bits are considered in packets of four units, each packet tacking integer values
from 0 to 15. This representation is called hexadecimal and, for the numbers
between 10 and 15, it uses the hexadecimal "digits" A, B, C, D, E, F. For
instance, a 16-bit binary number can be represented as
0100101100100110
2
= 4B26
16
.
(63)
A.9.2
Rational Numbers
We have two alternative possibilities to represent rational non-integer numbers:
· fixed point
· floating point
The fixed point representation is similar to the representation of integer
numbers, with te difference that we have a decimal point at a prescribed position.
The digits are divided into two sets: the integer part and the fractional part.
The 16-bit representation, without sign and with 3 bits of integer part is
x =
2
i=-13
x
i
× 2
i
,
(64)
and is obtained by multiplication of the integer number on 16 bits by 2
-13
.
In the two's complement representation, the operations can be done without
caring of the position of the decimal point, as we would be operating on integer
19
Vice versa, the sign and magnitude representation has one positive and one negative zero
Next Page >>
<< Previous Page
Back to the Table of Contents