Digital Signal Processing Reference
In-Depth Information
1.1
Binary Representation
An unsigned binary number, X , with W f fractional bits can be written
W f
i = 1 x i 2 i
X
=
(1)
where x i ∈{
0
,
1
}
. Denoting the weight of the least significant position Q ,inthis
2 W f , one can see that the range of X is 0
case Q
Q . Q is sometimes
referred to as unit of least significant position, ulp . As an example, the number
0
=
X
1
2 3
.
25 10 is written using W f =
3as
.
010 2 and Q
=
=
0
.
125 10 .
1.2
Two's Complement Representation
To represent negative numbers, there are several different number representations
proposed. The most common one is the two's complement (2C) representation.
Here, a binary number, X , with W f fractional bits is written
W f
i = 1 x i 2 i
X
=
x 0 +
.
(2)
This gives a numerical range as
Q . It is worth noting that the range
is not symmetric. This will cause problems when implementing certain arithmetic
operations as discussed later. x 0 , the sign bit, is one if X
1
X
1
<
0 and zero otherwise.
A number
01 2 C .
A beneficial property of two's complement arithmetic is the fact that an arbitrary
long sequence of numbers can be added in arbitrary order as long as the result is
known to be in the range of the representation. Any overflows/underflows in the
intermediate computations will cancel. This is related to the fact that computations
in two's complement number representation are performed modulo 2 W S ,where W S
is the weight of the sign bit. For the representation in ( 2 ) W S =
0
.
25 10 is represented as 1
.
11 2 C with W f =
2, while 0
.
25 10 is 0
.
1 so all computations
are performed modulo 2.
1.3
Redundant Representations
A redundant representation is a representation where a number may have more than
one representation. As we will see later the fact that we can select the representation
will provide a number of advantages, most importantly the ability to perform
addition in constant time.
 
 
Search WWH ::




Custom Search