d
- Convert 0.1015625 to IEEE 32-bit floating point format.
- Converting:
So 0.101562510 = 0.00011012.0.1015625 × 2 = 0.203125 0 Generate 0 and continue. 0.203125 × 2 = 0.40625 0 Generate 0 and continue. 0.40625 × 2 = 0.8125 0 Generate 0 and continue. 0.8125 × 2 = 1.625 1 Generate 1 and continue with the rest. 0.625 × 2 = 1.25 1 Generate 1 and continue with the rest. 0.25 × 2 = 0.5 0 Generate 0 and continue. 0.5 × 2 = 1.0 1 Generate 1 and nothing remains. - Normalize: 0.00011012 = 1.1012 × 2-4.
- Mantissa is 10100000000000000000000, exponent is -4 + 127 = 123 = 011110112, sign bit is 0.
- Converting:
- Convert 39887.5625 to IEEE 32-bit floating point format.
- The integral part is 3988710 = 10011011110011112. The fractional:
So 39887.562510 = 1001101111001111.10012.0.5625 × 2 = 1.125 1 Generate 1 and continue with the rest. 0.125 × 2 = 0.25 0 Generate 0 and continue. 0.25 × 2 = 0.5 0 Generate 0 and continue. 0.5 × 2 = 1.0 1 Generate 1 and nothing remains. - Normalize: 1001101111001111.10012 = 1.00110111100111110012 × 215.
- Mantissa is 00110111100111110010000, exponent is 15 + 127 = 142 = 100011102, sign bit is 0.
- The integral part is 3988710 = 10011011110011112. The fractional:
- Convert the 32-bit floating point number a3358000 (in hex) to decimal.
- Convert and separate: a335800016 = 10100011001101011000000000000000 2
- Exponent: 010001102 = 7010; 70 − 127 = -57.
- Since the exponent is far from zero, convert the original (normalized) mantissa:
Exponents 20 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 Place Values 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125 0.00390625 Bits 1 . 0 1 1 0 1 0 1 1 Value 1 + 0.25 + 0.125 + 0.03125 + 0.0078125 + 0.00390625 = 1.41796875 - Use calculator to find 1.41796875 × 2-57. You should get something like 9.83913471531 × 10-18 .
- Sign: negative
- Convert the 32-bit floating point number 76650000 (in hex) to decimal.
- Convert and separate: 7665000016 = 01110110011001010000000000000000 2
- Exponent: 111011002 = 23610; 236 − 127 = 109.
- Since the exponent is far from zero, convert the original (normalized) mantissa:
Exponents 20 2-1 2-2 2-3 2-4 2-5 2-6 2-7 Place Values 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125 Bits 1 . 1 1 0 0 1 0 1 Value 1 + 0.5 + 0.25 + 0.03125 + 0.0078125 = 1.7890625 - Use calculator to find 1.7890625 × 2109. You should get something like 1.16116794981 × 1033 .
- Sign: positive
Show the decimal integer 1 in 7-bit sign magnitude, one’s complement, two’s complement and excess-63 respectively in the given order, separated by comma.
The integer will be positive because the binary number starts with a 0
Sign magnitude: 0000001 = 2^(0) = 1
One’s and Two’s Complement is the same as sign magnitude
Excess-Notation= sign magnitude + excess number = X
Convert X to binary
= 1 + 63 = 64
= 64/2 = 32r0 32/2 = 16r0 16/2 = 8r0 8/2 = 4r0 4/2 = 2r0
2/2 = 1r0 1/2 = 0r1
= 1000000
Answer:0000001,0000001,0000001,1000000
Given a 9-bit binary sequence 011000101, show the decimal integer it represents in sign magnitude, one’s complement, two’s complement and excess-255 respectively in the given order, separated by comma.
Sign Magnitude: Convert binary to decimal
011000101 = 1 + 4 + 64 + 128 = 197
One’s Complementand Two’s Complement: Same as
Excess-X: Subtract the excess number from the sign magnitude
197 – 255 = -58
Show the decimal integer -134 in 9-bit sign magnitude, one’s complement, two’s complement and excess-255 respectively in the given order, separated by comma.
Sign Magnitude: Convert the 134 to binary and add a 1 at the beginning
10000110 = 110000110
One’s Complement: Take sign-magnitude binary number, set the 1 at the beginning aside and switch the numbers (1 = 0, 0 = 1)
1 10000110= 1 01111001
Two’s Complement: Take one’s complement and add 1
101111001 + 1 = 101111010
Excess-Notation: Excess number – positive decimal integer = answer in binary
255 – 134 = 121
121 to binary = 001111001
Answer: 110000110, 101111001, 101111010, 001111001
Given a 9-bit binary sequence 110111010, show the decimal integer it represents in sign magnitude, one’s complement, two’s complement and excess-255 respectively in the given order, separated by comma.
First three answers will be negative and the excess will be positive
Sign Magnitude: Take 1 at the beginning off the binary number and convert to decimal and make it negative
1 10111010 = 10111010
2 + 8 + 16 + 32 + 128 = –186
One’s Complement:Take sign-magnitude binary number, set the 1 at the beginning aside and switch the numbers (1 = 0, 0 = 1)
110111010 = 01000101
1 + 4 +64 = –69
Two’s Complement: Subtract 1 from one’s complement
-69 – 1 = -70
Excess-Number: Convert the whole binary number including the 1 at the beginning, subtract the excess from that number.
110111010 = 442
442 – 255 = 187
Answer: -186, -69, -70, 187