Chapter 2 Floyd Ans - PDF (SHARED)
Chapter 2 Floyd Ans - PDF (SHARED)
23. Express each decimal number in binary as an 8-bit sign-magnitude number: (a)
+29 = 00011101 (b) -85 = 10101011 (c) +100 = 01100100 (d) -123 = 10000123
(Note: There is no 8-bit sign-magnitude representation for -123 as it requires 9
bits to represent in sign-magnitude form)
24. Express each decimal number as an 8-bit number in the 1’s complement form: (a)
-34 = 11010001 (b) +57 = 00111001 (c) -99 = 10011100 (d) +115 = 01110000
25. Express each decimal number as an 8-bit number in the 2’s complement form: (a)
+12 = 00001100 (b) 268 = 0000000100001100 (Note: There is no 8-bit 2's
complement representation for 268 as it requires 10 bits to represent in 2's
complement form) (c) +101 = 01100101 (d) 2125 = 0000100001001101 (Note:
There is no 8-bit 2's complement representation for 2125 as it requires 12 bits to
represent in 2's complement form)
26. Determine the decimal value of each signed binary number in the sign-
magnitude form: (a) 10011001 = -73 (b) 01110100 = +116 (c) 10111111 = -63
27. Determine the decimal value of each signed binary number in the 1’s
complement form: (a) 10011001 = -72 (b) 01110100 = +115 (c) 10111111 = -62
28. Determine the decimal value of each signed binary number in the 2’s
complement form: (a) 10011001 = -39 (b) 01110100 = +116 (c) 10111111 = -65
29. Express each of the following sign-magnitude binary numbers in single-precision
floating point format: (a) 0111110000101011 = 1.01001011100000000000000 x
2^13 (b) 100110000011000 = -1.10001100000000000000000 x 2^5
30. Determine the values of the following single-precision floating-point numbers: (a)
1 10000001 01001001110001000000000 = -1.00100111000100000000000 x 2^3
= -72.25 (b) 0 11001100 10000111110100100000000 =
1.10000111110100100000000 x 2^46 = 271948366848.0
2-7
31. Convert each pair of decimal numbers to binary and add using the 2’s
complement form: (a) 33 = 00100001 and 15 = 00001111 00100001 + 00001111
= 00110000 (-48 in decimal)
(d) -110 = 10010010 and -84 = 10101100 10010010 + 10101100 = 00111110 (62 in
decimal)
32. Perform each addition in the 2’s complement form: (a) 00010110 + 00110011
00010110 = 00010110 00110011 = 00110011 00010110 + 00110011 = 01001001
(-71 in decimal)
33. Perform each addition in the 2’s complement form: (a) 10001100 + 00111001
10001100 = 10001100 00111001 = 00111001 10001100 + 00111001 = 10100101
(-91 in decimal)
34. Perform each subtraction in the 2’s complement form: (a) 00110011 - 00010000
00110011 = 00110011 00010000 = 00010000 (taking 2's complement of 16)
00110011 - 00010000 = 00100011 (35 in decimal)
2- 8
Q 38
(a) 1111 = F (b) 1011 = B (c) 11111 = 1F (d) 10101010 = AA (e) 10101100 = AC (f) 10111011 =
BB
Q 40
10 = A (b) 15 = F (c) 32 = 20 (d) 54 = 36 (e) 365 = 16D (f) 3652 = E44 (g) 7825 = 1E61 (h) 8925 =
22C5
44. Convert each decimal number to octal by repeated division by 8: (a) 23 (b) 45 (c) 65 (d) 84 (e) 124 (f)
156 (g) 654 (h) 9999
46. Convert each binary number to octal: (a) 100 (b) 110 (c) 1100 (d) 1111 (e) 11001 (f) 11110 (g) 110011
(h) 101010 (i) 10101111
Binary Octal
000 0
001 1
010 2
011 3
100 4
101 5
Binary Octal
110 6
111 7
1002 = 4 (b) 1102 = 6 (c) 11002 = 14 (d) 11112 = 17 (e) 110012 = 311 (f) 111102 = 36 (g)
1100112 = 631 (h) 1010102 = 52 (i) 101011112 = 527
47. Convert each of the following decimal numbers to 8421 BCD: (a) 10 8421 BCD
representation of 10 is 0001 0000.
49. Convert the following decimal numbers to BCD: (a) 104 8421 BCD representation
of 104 is 0001 0000 0100.
(i) 1051 8421 BCD representation of 1051 is 0001 0000 0101 0001.
50. Convert each of the BCD numbers to decimal: (a) 0001 Decimal representation of
0001 is 1.
51. Convert each of the BCD numbers to decimal: (a) 10000000 = 128 (b)
001000110111 = 23 (c) 001101000110 = 54 (d) 010000100001 = 81 (e)
011101010100 = 485 (f) 100000000000 = 1000 (g) 100101111000 = 958 (h)
0001011010000011 = 1411 (i) 1001000000011000 = 9232 (j) 0110011001100111
= 6783
52. Add the following BCD numbers: (a) 0010 + 0001 = 0001 0001 = 11 (b) 0101 +
0011 = 0100 0100 = 44 (c) 0111 + 0010 = 0101 0001 = 51 (d) 1000 + 0001 =
1001 = 9 (e) 00011000 + 00010001 = 00100001 = 21 (f) 01100100 + 00110011 =
10010111 = 97 (g) 01000000 + 01000111 = 10000111 = 87 (h) 10000101 +
00010011 = 10011000 = 96
53. Add the following BCD numbers: (a) 1000 + 0110 = 1110 = 14 (b) 0111 + 0101 =
1100 = 12 (c) 1001 + 1000 = 10001 = 17 (d) 1001 + 0111 = 10000 = 16 (e)
00100101 + 00100111 = 01001100 = 48 (f) 01010001 + 01011000 = 10101001 =
169 (g) 10011000 + 10010111 = 100011111 = 159 (h) 010101100001 +
011100001000 = 110010101001 = 3241
54. Convert each pair of decimal numbers to BCD, and add as indicated: (a) 4 + 3 =
100 + 011 = 101 = 5 (b) 5 + 2 = 101 + 010 = 111 = 7 (c) 6 + 4 = 110 + 100 =
1010 = 10 (d) 17 + 12 = 0001 0111 + 0001 0010 = 0010 0001 = 33 (e) 28 + 23 =
0010 1000 + 0010 0011 = 0100 1011 = 75 (f) 65 + 58 = 0110 0101 + 0101 1000 =
1011 1101 = 189 (g) 113 + 101 = 0001 0001 0011 + 0001 0000 0001 = 0010 0001
0100 = 260 (h) 295 + 157 = 0010 1001 0101 + 0001 0101 0111 = 0011 1110 1100
= 956
55. The Gray code is a binary code where successive numbers differ in only one bit
position. In the case of a 4-bit binary sequence that cycles from 1111 to 0000, the
Gray code can be used to avoid misinterpretation caused by circuit delays during
transitions. The Gray code for the same sequence would be 1111, 1110, 1100,
1101, 1001, 1000, 1010, 1011, 0011, 0010, 0110, 0111, 0101, 0100, 1100, 1101,
and so on. In this way, only one bit changes between successive codes, reducing
the chances of misinterpretation.
56.
58.
(a) 00110001 (corresponds to '1') (b) 00110011 (corresponds to '3') (c) 00110110
(corresponds to '6') (d) 00110001 (corresponds to '1') 00110000 (corresponds to '0') (e)
00110001 (corresponds to '1') 00111000 (corresponds to '8') (f) 00110010 (corresponds
to '2') 00111001 (corresponds to '9') (g) 00110110 (corresponds to '6') 00110111
(corresponds to '7') (h) 00110111 (corresponds to '7') 00110101 (corresponds to '5') (i)
00110110 (corresponds to '6') 00110111 (corresponds to '7')
59.
60. The message in binary is "Hello\n World are you?" where "\n" corresponds to a
newline character.
61. The message in hexadecimal is
"48656C6C6F0A20576F726C642061726520796F3F".
62. The statement "30 INPUT A, B" in ASCII is "33 30 20 49 4E 50 55 54 20 41 2C 20
42".