Analog Devices adsp-2100 Manual page 457

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

C Numeric Formats
can grow by these two bits (two orders of magnitude) before overflowing;
thus, these bits are called guard bits. If it is known that a process will not
cause any value to grow by more than these two bits, then the process can
be run without loss of data. Afterward, however, the block must be
adjusted to replace the guard bits before the next process.
Figure C.5 shows the data after processing but before adjustment. The
block floating-point adjustment is performed as follows. Initially, the
value of SB is –2, corresponding to the 2 guard bits. During processing,
each resulting data value is inspected by the EXPADJ instruction, which
counts the number of redundant sign bits and adjusts SB is if the number
of redundant sign bits is less than 2. In this example, SB=–1 after
processing, indicating that the block of data must be shifted right one bit
to maintain the 2 guard bits. If SB were 0 after processing, the block would
have to be shifted two bits right. In either case, the block exponent is
updated to reflect the shift.
1. Check for Bit Growth
0x1FFF
0x3FFF
0x07FF
2. Shift Right to Restore Guard Bits
0x0FFF
0x1FFF
0x03FF
Figure C.5 Block Floating-Point Adjustment
C – 6
1 Guard Bit
=
0001
1111
1111
=
0011
1111
1111
=
0000
0111
1111
Sign Bit
2 Guard Bits
=
0000
1111
1111
=
0001
1111
1111
=
0000
0011
1111
Sign Bit
EXPADJ instruction checks
exponent, adjusts SB
1111
Exponent = –2
1111
Exponent = –1
1111
Exponent = –4
1111
1111
1111
SB = –2
SB = –1
SB = –1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents