0% found this document useful (0 votes)
650 views8 pages

Chapter 2 Floyd Ans - PDF (SHARED)

The document provides examples of converting between decimal, binary, octal, and binary coded decimal (BCD) number systems. It includes examples of converting individual numbers and performing arithmetic operations like addition and subtraction in these different number systems. Converting between number systems and performing arithmetic in different bases is useful for digital circuits and computer systems that use binary representation of numbers.

Uploaded by

Mr Alpha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
650 views8 pages

Chapter 2 Floyd Ans - PDF (SHARED)

The document provides examples of converting between decimal, binary, octal, and binary coded decimal (BCD) number systems. It includes examples of converting individual numbers and performing arithmetic operations like addition and subtraction in these different number systems. Converting between number systems and performing arithmetic in different bases is useful for digital circuits and computer systems that use binary representation of numbers.

Uploaded by

Mr Alpha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

2-6

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)

(b) 56 = 00111000 and -27 = 11100101 00111000 + 11100101 = 00011101 (29 in


decimal)
(c) -46 = 11010110 and 25 = 00011001 11010110 + 00011001 = 11101111 (-17 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)

(b) 01110000 + 10101111 01110000 = 01110000 10101111 = 11101111 (taking 2's


complement of -21) 01110000 + 11101111 = 01011111 (-65 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)

(b) 11011001 + 11100111 11011001 = 11011001 11100111 = 11100111 11011001 +


11100111 = 110000100 (decimals not shown in binary)

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)

(b) 01100101 - 11101000 01100101 = 01100101 11101000 = 10011000 (taking 2's


complement of -24) 01100101 + 10011000 = 00011101 (29 in decimal)

35. Multiply 01101010 by 11110001 in the 2’s complement form. 01101010 =


01101010 (106 in decimal) 11110001 = 11110001 (-15 in decimal) -15 * 106 = -
1590 Convert -1590 to binary in 8 bits: 11011010
Therefore, 01101010 * 11110001 = 11011010
36. Divide 10001000 by 00100010 in the 2’s complement form. 10001000 =
10001000 (-120 in decimal) 00100010 = 00100010 (18 in decimal)
-120 / 18 = -6 remainder 12 Convert -6 to binary in 8 bits: 11111010
Therefore, 10001000 / 00100010 = 11111010 with remainder 00001100.

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

Section 2–9 Octal Numbers

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

(a) 23: 23 ÷ 8 = 2 remainder 7 2 ÷ 8 = 0 remainder 2

Therefore, 23 in octal is 27.

(b) 45: 45 ÷ 8 = 5 remainder 5 5 ÷ 8 = 0 remainder 5

Therefore, 45 in octal is 55.

(c) 65: 65 ÷ 8 = 8 remainder 1 8 ÷ 8 = 1 remainder 0 1 ÷ 8 = 0 remainder 1

Therefore, 65 in octal is 101.

(d) 84: 84 ÷ 8 = 10 remainder 4 10 ÷ 8 = 1 remainder 2 1 ÷ 8 = 0 remainder 1

Therefore, 84 in octal is 124.

(e) 124: 124 ÷ 8 = 15 remainder 4 15 ÷ 8 = 1 remainder 7 1 ÷ 8 = 0 remainder 1

Therefore, 124 in octal is 174.

(f) 156: 156 ÷ 8 = 19 remainder 4 19 ÷ 8 = 2 remainder 3 2 ÷ 8 = 0 remainder 2

Therefore, 156 in octal is 234.


(g) 654: 654 ÷ 8 = 81 remainder 6 81 ÷ 8 = 10 remainder 1 10 ÷ 8 = 1 remainder 2 1 ÷ 8
= 0 remainder 1

Therefore, 654 in octal is 1216.

(h) 9999: 9999 ÷ 8 = 1249 remainder 7 1249 ÷ 8 = 156 remainder 1 156 ÷ 8 = 19


remainder 4 19 ÷ 8 = 2 remainder 3 2 ÷ 8 = 0 remainder 2

Therefore, 9999 in octal is 23417.

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

Section 2–10 Binary Coded Decimal (BCD)

47. Convert each of the following decimal numbers to 8421 BCD: (a) 10 8421 BCD
representation of 10 is 0001 0000.

(b) 13 8421 BCD representation of 13 is 0001 0011.

(c) 18 8421 BCD representation of 18 is 0001 1000.

(d) 21 8421 BCD representation of 21 is 0010 0001.

(e) 25 8421 BCD representation of 25 is 0010 0101.

(f) 36 8421 BCD representation of 36 is 0011 0110.

(g) 44 8421 BCD representation of 44 is 0100 0100.

(h) 57 8421 BCD representation of 57 is 0101 0111.

(i) 69 8421 BCD representation of 69 is 0110 1001.


(j) 98 8421 BCD representation of 98 is 1001 1000.

(k) 125 8421 BCD representation of 125 is 0001 0010 0101.

(l) 156 8421 BCD representation of 156 is 0001 0101 0110.

49. Convert the following decimal numbers to BCD: (a) 104 8421 BCD representation
of 104 is 0001 0000 0100.

(b) 128 8421 BCD representation of 128 is 0001 0010 1000.

(c) 132 8421 BCD representation of 132 is 0001 0011 0010.

(d) 150 8421 BCD representation of 150 is 0001 0101 0000.

(e) 186 8421 BCD representation of 186 is 0001 1000 0110.

(f) 210 8421 BCD representation of 210 is 0010 0001 0000.

(g) 359 8421 BCD representation of 359 is 0011 0101 1001.

(h) 547 8421 BCD representation of 547 is 0101 0100 0111.

(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.

(b) 0110 Decimal representation of 0110 is 6.

(c) 1001 Decimal representation of 1001 is 9.

(d) 00011000 Decimal representation of 00011000 is 18.

(e) 00011001 Decimal representation of 00011001 is 19.

(f) 00110010 Decimal representation of 00110010 is 32.

(g) 01000101 Decimal representation of 01000101 is 45.

(h) 10011000 Decimal representation of 10011000 is 98.


(i) 100001110000 Decimal representation of 100001110000 is 872.

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

Section 2–11 Digital Codes

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.

(a) 10101 (b) 1111101 (c) 1010111100111


57.

(a) 1111 (b) 00110 (c) 100010011101

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.

(a) 0 (corresponds to NULL) (b) J (corresponds to 74 in decimal) (c) } (corresponds to 125


in decimal) (d) C (corresponds to 67 in decimal) (e) ~ (corresponds to 126 in decimal) (f)
B (corresponds to 66 in decimal)

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".

You might also like