C
Numeric Formats
C – 3
The notation used to describe a format consists two numbers separated by
a period (.); the first number is the number of bits to the left of radix point,
the second is the number of bits to the right of the radix point. For
example, 16.0 format is an integer format; all bits lie to the left of the radix
point. The format in Figure C.2 is 13.3.
Table C.1 shows the ranges of numbers representable in the fractional
formats that are possible with 16 bits.
Format
Number of Number of
Largest Positive
Largest Negative
Value of 1 LSB
Integer
Fractional
Value (0x7FFF)
Value (0x8000)
(0x0001)
Bits
Bits
In Decimal
In Decimal
In Decimal
1.15
1
15
0.999969482421875
–1.0
0.000030517578125
2.14
2
14
1.999938964843750
–2.0
0.000061035156250
3.13
3
13
3.999877929687500
–4.0
0.000122070312500
4.12
4
12
7.999755859375000
–8.0
0.000244140625000
5.11
5
11
15.999511718750000
–16.0
0.000488281250000
6.10
6
10
31.999023437500000
–32.0
0.000976562500000
7.9
7
9
63.998046875000000
–64.0
0.001953125000000
8.8
8
8
127.996093750000000
–128.0
0.003906250000000
9.7
9
7
255.992187500000000
–256.0
0.007812500000000
10.6
10
6
511.984375000000000
–512.0
0.015625000000000
11.5
11
5
1023.968750000000000
–1024.0
0.031250000000000
12.4
12
4
2047.937500000000000
–2048.0
0.062500000000000
13.3
13
3
4095.875000000000000
–4096.0
0.125000000000000
14.2
14
2
8191.750000000000000
–8192.0
0.250000000000000
15.1
15
1
16383.500000000000000
–16384.0
0.500000000000000
16.0
16
0
32767.000000000000000
–32768.0
1.000000000000000
Table C.1 Fractional Formats And Their Ranges
C.4
BINARY MULTIPLICATION
In addition and subtraction, both operands must be in the same format
(signed or unsigned, radix point in the same location) and the result
format is the same as the input format. Addition and subtraction are
performed the same way whether the inputs are signed or unsigned.
In multiplication, however, the inputs can have different formats, and the
result depends on their formats. The ADSP-2100 family assembly
language allows you to specify whether the inputs are both signed, both
unsigned, or one of each (mixed-mode). The location of the radix point in
the result can be derived from its location in each of the inputs. This is