Presentation is loading. Please wait.

Presentation is loading. Please wait.

1. 2 3 9.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.

Similar presentations


Presentation on theme: "1. 2 3 9.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."— Presentation transcript:

1 1

2 2

3 3 9.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 x i, with

4 4 Figure 9.1 Schematic representation of 4-bit code for integers in [0, 15]. 9.1 Positional Number Systems In a general radix-r positional system,

5 5 Figure 9.2 Overflow regions in finite number representation systems. For unsigned representations covered in this section, max – = 0. Overflow:The range of number is exceeded. Underflow: for numbers too small in magnitude to be distinguishable from 0.

6 6 9.2 Digit Sets and Encodings BCD: Binary-coded decimal ASCII: American Standard Code for Information Interchange 7 bits Upper- and lowercase letters Numbers Symbols DecimalBCD 00000 10001 20010 30011 40100 50101 60110 70111 81000 91001

7 7 Figure 9.3 Adding a binary number or another carry-save number to a carry-save number. Example 9.4 (self-study)

8 8 9.3 Number-radix conversion Binary to decimal Example 9.5

9 9 Figure 9.4 Justifying one step of the conversion of x to radix 2. Decimal to binary (or hexadecimal) Example 9.6

10 10 In the k-bit 2’s-complement format, a negative value –x, with x > 0, is encoded as the unsigned number 2 k -x. The range of representable values in k-bit 2’s- complement format is [-2 k-1, 2 k-1 -1] 9.4 Signed Integers 2’s-Complement Representation

11 11 Figure 9.5 Schematic representation of 4-bit 2’s-complement code for integers in [–8,+7]. 4-bit Signed Integers

12 12 Example 9.7 (10110101) 2’s-compl = -1x2 7 + 0x2 6 + 1x2 5 + 1x2 4 + 0x2 3 + 1x2 2 + 0x2 1 + 1x2 0 = -75 Calculation of 2’s-complement A negative value –x, with x > 0, is encoded as the unsigned number 2 k -x 2 k -x = (2 k -1)-x+1 = (x) bit-invert +1 E.g., if k = 4, x = (0111) 2 2 4 -1-0111 = 1000 Example 9.8 (In decimal system, if y is negative value, -y is positive value. In 2’s complement, it also holds)

13 13 Figure 9.6 Binary adder used as 2 ’ s-complement adder/subtractor. If Add/sub = 0, it conduct x+y If Add/sub = 1, it conduct x-y

14 14 Figure 9.7 Schematic representation of 4-bit 2 ’ s-complement encoding for (1 + 3)-bit fixed-point numbers in the range [ – 1, + 7/8]. 9.5 Fixed-Point Number

15 15 Example 9.9 Conversion from fixed-point binary to decimal Example 9.10 Conversion from fixed-point decimal to binary

16 16 Table 9.1 Some features of the ANSI/IEEE standard floating-point formats. 9.6 Floating-Point Numbers (ANSI/IEEE standard)

17 17 Short format: number value is (-1) S × 2 (E - 127) × (1 + M / 8388608 ) Long Format: number value is (-1) S × 2 (E - 1023) × (1 + M / 2 52 )

18 18 Example: Represent -6.25 in ANSI/IEEE short and long floating-point formats. Sol. (-6.25) 10 = (-110.01) 2 = -1.1001x2 2 Short Format: sign: 1 exponent: 127+2=129=(10000001) 2 significand: 10010000000000000000000 Long Format: sign: 1 exponent: 1023+2=1025=(10000000001) 2 significand: 1001000000000000000000000000000000000000000000000000


Download ppt "1. 2 3 9.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."

Similar presentations


Ads by Google