Title: 9.1 Positional Number Systems
11
22
39.1 Positional Number Systems
In a general radix-r positional system, with
fixed word width k, a number is represented by a
string of k digits xi, with
49.1 Positional Number Systems In a general
radix-r positional system,
Figure 9.1 Schematic representation of 4-bit
code for integers in 0, 15.
5OverflowThe range of number is
exceeded. Underflow for numbers too small in
magnitude to be distinguishable from 0.
Figure 9.2 Overflow regions in finite number
representation systems. For unsigned
representations covered in this section, max 0.
69.2 Digit Sets and Encodings
- BCD Binary-coded decimal
- ASCII American Standard Code for Information
Interchange - 7 bits
- Upper- and lowercase letters
- Numbers
- Symbols
7Example 9.4 (self-study)
Figure 9.3 Adding a binary number or another
carry-save number to a carry-save number.
89.3 Number-radix conversion
Binary to decimal Example 9.5
9Decimal to binary (or hexadecimal) Example 9.6
Figure 9.4 Justifying one step of the conversion
of x to radix 2.
109.4 Signed Integers
2s-Complement Representation
- In the k-bit 2s-complement format, a negative
value x, with x gt 0, is encoded as the unsigned
number 2k-x. - The range of representable values in k-bit
2s-complement format is -2k-1, 2k-1 -1
114-bit Signed Integers
Figure 9.5 Schematic representation of 4-bit
2s-complement code for integers in 8,7.
12- Example 9.7
- (10110101)2s-compl -1x27 0x26 1x25 1x24
0x23 1x22 0x21 1x20 -75 -
Calculation of 2s-complement A negative
value x, with x gt 0, is encoded as the unsigned
number 2k-x 2k-x (2k-1)-x1 (x)bit-invert
1 E.g., if k 4, x (0111) 2 24-1-0111
1000 Example 9.8 (In decimal system, if y is
negative value, -y is positive value. In 2s
complement, it also holds)
13If Add/sub 0, it conduct xy If Add/sub 1, it
conduct x-y
Figure 9.6 Binary adder used as 2s-complement
adder/subtractor.
149.5 Fixed-Point Number
Figure 9.7 Schematic representation of 4-bit
2s-complement encoding for (1 3)-bit
fixed-point numbers in the range 1, 7/8.
15- Example 9.9 Conversion from fixed-point binary to
decimal - Example 9.10 Conversion from fixed-point decimal
to binary
169.6 Floating-Point Numbers (ANSI/IEEE standard)
Table 9.1 Some features of the ANSI/IEEE
standard floating-point formats.
17Short format number value is (-1)S 2(E - 127)
(1 M / 8388608 ) Long Format number value
is (-1)S 2(E - 1023) (1 M / 252 )
18- Example Represent -6.25 in ANSI/IEEE short and
long floating-point formats. -
- Sol. (-6.25)10 (-110.01)2 -1.1001x22
- Short Format
- sign 1
- exponent 1272129(10000001)2
- significand 10010000000000000000000
- Long Format
- sign 1
- exponent 102321025(10000000001)2
- significand 10010000000000000000000000000000
00000000000000000000