Answers to Numbers & Encoding Test
1. 1. Calculate 1E5₁₆ - 177₁₆ using 16's complement method
1E5₁₆ = 485₁₀, 177₁₆ = 375₁₀
Using 16's complement:
1. 16's complement of 177₁₆ = 10000 - 0177 = 0E89
2. Add: 1E5 + E89 = 1070E
3. Drop carry: 070E₁₆
Answer: 070E₁₆
2. 2. Convert (21.21)₈ to decimal
21₈ = 2×8 + 1 = 17, .2 = 2×(1/8) = 0.25, .1 = 1×(1/64) = 0.015625 →
Total = 17.265625
Answer: 17.265625₁₀
3. 3. Add 7652₈ + 4574₈
7652₈ = 3994₁₀, 4574₈ = 2428₁₀ → 3994 + 2428 = 6422₁₀ = 14246₈
Answer: 14246₈
4. 4. DE.18₁₆ + [Link]₁₆
DE.18 = 222.09375, [Link] = 255.927734375 → Sum = 478.021484375
Hex = 1DE.057C (approx)
Answer: 1DE.057C₁₆
5. 5. Convert 34.56₁₀ to octal and hexadecimal
Octal: 34 = 42₈, 0.56×8 = 4.48 → 0.4, 0.48×8 = 3.84 → 0.3, ...
= 42.43...₈
Hex: 34 = 22₁₆, 0.56×16 = 8.96 → 0.8, 0.96×16 = 15.36 → 0.F...
= 22.8F...₁₆
Answer: Octal = 42.43, Hex = 22.8F
6. 6. Convert 1101111.111₂ to decimal and hexadecimal
1101111 = 111₁₀, .111 = 0.875 → Decimal = 111.875
Hex: 6F.E
Answer: Decimal = 111.875, Hex = 6F.E
7. 7. Express -18 in sign and magnitude form in 8 bits
18 = 00010010 → Sign-magnitude = 10010010
8. 8. Express -18 in 2's complement notation (n=8)
18 = 00010010 → Invert = 11101101 + 1 = 11101110
Answer: 11101110
9. 9. Express -38.9 in mantissa-exponent notation (16 bits)
-38.9 ≈ -100110.111001100... = 1.00110111 × 2⁵
Sign=1, Exp=5+15=20=10100, Mantissa=00110111...
Answer: 1 10000100 00110111001100000000000
1. Sign Bit (S):
0 → Positive number
2. Exponent (EEE):
011 in binary = 3
If using excess/bias-3 notation (typical for 3-bit exponent), then:
Actual exponent = 3 - 3 = 0
So the exponent part = 2⁰
3. Mantissa (MMM):
101 → Represents fraction bits
In normalized scientific notation, we assume leading 1, so:
1.101 in binary =
1+12+04+18=1+0.5+0+0.125=1.6251 + \frac{1}{2} + \frac{0}{4} + \
frac{1}{8} = 1 + 0.5 + 0 + 0.125 = 1.6251+21+40+81
=1+0.5+0+0.125=1.625
Final Value:
(+1)×1.625×20=1.625(+1) × 1.625 × 2^0 = 1.625(+1)×1.625×20=1.625
Final Answer:
1.625 (decimal)
11. Decimal value of single precision float:
10111110010000000000000000000000
Sign=1, Exp=01111100=124 → Exponent=124-127=-3, Mantissa=1.01 →
1.25×2⁻³=0.15625
Answer: -0.15625
10. 12. Convert 75.628 to hexadecimal
75 = 4B, .628×16 = 10.048 → A, 0.048×16 ≈ 0.77
Answer: 4B.A...₁₆
11. 13. Convert BA.78₁₆ to binary
BA = 10111010, .7=0111, .8=1000 → BA.78 = 10111010.01111000
Answer: 10111010.01111000
12. 14. Encode the word HaP123 in ASCII 7-bit code
H=1001000, a=1100001, P=1010000, 1=0110001, 2=0110010,
3=0110011
Answer: 1001000 1100001 1010000 0110001 0110010 0110011
13. 15. Convert DF.89₁₆ to decimal
DF = 223, .8 = 8/16 = 0.5, .9 = 9/256 ≈ 0.035 → Total ≈ 223.535
Answer: ≈ 223.535