0% found this document useful (0 votes)
98 views

Problems

Uploaded by

amr57khaled
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)
98 views

Problems

Uploaded by

amr57khaled
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/ 6

116 Number Systems, Operations, and Codes

KEY TERMS
Key terms and other bold terms in the chapter are defined in the end-of-book glossary.
Alphanumeric Consisting of numerals, letters, and other characters.
ASCII American Standard Code for Information Interchange; the most widely used alphanumeric
code.
BCD Binary coded decimal; a digital code in which each of the decimal digits, 0 through 9, is
represented by a group of four bits.
Byte A group of eight bits.
Cyclic redundancy check (CRC) A type of error detection code.
Floating-point number A number representation based on scientific notation in which the
number consists of an exponent and a mantissa.
Hexadecimal Describes a number system with a base of 16.
LSB Least significant bit; the right-most bit in a binary whole number or code.
MSB Most significant bit; the left-most bit in a binary whole number or code.
Octal Describes a number system with a base of eight.
Parity In relation to binary codes, the condition of evenness or oddness of the number of 1s in a
code group.

TRUE/FALSE QUIZ
Answers are at the end of the chapter.
1. The octal number system is a weighted system with eight digits.
2. The binary number system is a weighted system with two digits.
3. MSB stands for most significant bit.
4. In hexadecimal, 9 1 1 = 10.
5. The 1’s complement of the binary number 1010 is 0101.
6. The 2’s complement of the binary number 1111 is 0000.
7. The right-most bit in a signed binary number is the sign bit.
8. The hexadecimal number system has 16 characters, six of which are alphabetic characters.
9. BCD stands for binary coded decimal.
10. An error in a given code can be detected by verifying the parity bit.
11. CRC stands for cyclic redundancy check.
12. The modulo-2 sum of 11 and 10 is 100.

SELF-TEST
Answers are at the end of the chapter.
1. 3 * 101 + 4 * 100 is
(a) 0.34 (b) 3.4 (c) 34 (d) 340
2. The decimal equivalent of 1000 is
(a) 2 (b) 4 (c) 6 (d) 8
3. The binary number 11011101 is equal to the decimal number
(a) 121 (b) 221 (c) 441 (d) 256
4. The decimal number 21 is equivalent to the binary number
(a) 10101 (b) 10001 (c) 10000 (d) 11111
5. The decimal number 250 is equivalent to the binary number
(a) 11111010 (b) 11110110 (c) 11111000 (d) 11111011
6. The sum of 1111 1 1111 in binary equals
(a) 0000 (b) 2222 (c) 11110 (d) 11111
Problems 117

7. The difference of 1000 2 100 equals


(a) 100 (b) 101 (c) 110 (d) 111
8. The 1’s complement of 11110000 is
(a) 11111111 (b) 11111110 (c) 00001111 (d) 10000001
9. The 2’s complement of 11001100 is
(a) 00110011 (b) 00110100 (c) 00110101 (d) 00110110
10. The decimal number 1122 is expressed in the 2’s complement form as
(a) 01111010 (b) 11111010 (c) 01000101 (d) 10000101
11. The decimal number 234 is expressed in the 2’s complement form as
(a) 01011110 (b) 10100010 (c) 11011110 (d) 01011101
12. A single-precision floating-point binary number has a total of
(a) 8 bits (b) 16 bits (c) 24 bits (d) 32 bits
13. In the 2’s complement form, the binary number 10010011 is equal to the decimal number
(a) 219 (b) + 109 (c) + 91 (d) 2109
14. The binary number 101100111001010100001 can be written in octal as
(a) 54712308 (b) 54712418 (c) 26345218 (d) 231625018
15. The binary number 10001101010001101111 can be written in hexadecimal as
(a) AD46716 (b) 8C46F16 (c) 8D46F16 (d) AE46F16
16. The binary number for F7A916 is
(a) 1111011110101001 (b) 1110111110101001
(c) 1111111010110001 (d) 1111011010101001
17. The BCD number for decimal 473 is
(a) 111011010 (b) 110001110011 (c) 010001110011 (d) 010011110011
18. Refer to Table 2–7. The command STOP in ASCII is
(a) 1010011101010010011111010000 (b) 1010010100110010011101010000
(c) 1001010110110110011101010001 (d) 1010011101010010011101100100
19. The code that has an even-parity error is
(a) 1010011 (b) 1101000 (c) 1001000 (d) 1110111
20. In the cyclic redundancy check, the absence of errors is indicated by
(a) Remainder = generator code (b) Remainder = 0
(c) Remainder = 1 (d) Quotient = 0

PROBLEMS
Answers to odd-numbered problems are at the end of the book.

Section 2–1 Decimal Numbers


1. What is the weight of 7 in each of the following decimal numbers?
(a) 1947 (b) 1799 (c) 1979
2. Express each of the following decimal numbers as a power of ten:
(a) 1000 (b) 10000000 (c) 1000000000
3. Give the value of each digit in the following decimal numbers:
(a) 263 (b) 5436 (c) 234543
4. How high can you count with six decimal digits?

Section 2–2 Binary Numbers


5. Convert the following binary numbers to decimal:
(a) 001 (b) 010 (c) 101 (d) 110
(e) 1010 (f) 1011 (g) 1110 (h) 1111
6. Convert the following binary numbers into decimal:
(a) 100001 (b) 100111 (c) 101010 (d) 111001
(e) 1100000 (f) 11111101 (g) 11110010 (h) 11111111
118 Number Systems, Operations, and Codes

7. Convert each binary number to decimal:


(a) 110011.11 (b) 101010.01 (c) 1000001.111
(d) 1111000.101 (e) 1011100.10101 (f) 1110001.0001
(g) 1011010.1010 (h) 1111111.11111
8. What is the highest decimal number that can be represented by each of the following numbers
of binary digits (bits)?
(a) two (b) three (c) four (d) five (e) six
(f) seven (g) eight (h) nine (i) ten (j) eleven
9. How many bits are required to represent the following decimal numbers?
(a) 5 (b) 10 (c) 15 (d) 20
(e) 100 (f) 120 (g) 140 (h) 160
10. Generate the binary sequence for each decimal sequence:
(a) 0 through 7 (b) 8 through 15 (c) 16 through 31
(d) 32 through 63 (e) 64 through 75

Section 2–3 Decimal-to-Binary Conversion


11. Convert each decimal number to binary by using the sum-of-weights method:
(a) 12 (b) 15 (c) 25 (d) 50
(e) 65 (f) 97 (g) 127 (h) 198
12. Convert each decimal fraction to binary using the sum-of-weights method:
(a) 0.26 (b) 0.762 (c) 0.0975
13. Convert each decimal number to binary using repeated division by 2:
(a) 13 (b) 17 (c) 23 (d) 30
(e) 35 (f) 40 (g) 49 (h) 60
14. Convert each decimal fraction to binary using repeated multiplication by 2:
(a) 0.76 (b) 0.456 (c) 0.8732

Section 2–4 Binary Arithmetic


15. Add the binary numbers:
(a) 10 + 10 (b) 10 + 11 (c) 100 + 11
(d) 111 + 101 (e) 1111 + 111 (f) 1111 + 1111
16. Use direct subtraction on the following binary numbers:
(a) 10 - 1 (b) 100 - 11 (c) 110 - 100
(d) 1111 - 11 (e) 1101 - 101 (f) 110000 - 1111
17. Perform the following binary multiplications:
(a) 11 * 10 (b) 101 * 11 (c) 111 * 110
(d) 1100 * 101 (e) 1110 * 1110 (f) 1111 * 1100
18. Divide the binary numbers as indicated:
(a) 110 , 11 (b) 1010 , 10 (c) 1111 , 101

Section 2–5 Complements of Binary Numbers


19. What are two ways of representing zero in 1’s complement form?
20. How is zero represented in 2’s complement form?
21. Determine the 1’s complement of each binary number:
(a) 100 (b) 111 (c) 1100
(d) 10111011 (e) 1001010 (f) 10101010
22. Determine the 2’s complement of each binary number using either method:
(a) 11 (b) 110 (c) 1010 (d) 1001
(e) 101010 (f) 11001 (g) 11001100 (h) 11000111
Problems 119

Section 2–6 Signed Numbers


23. Express each decimal number in binary as an 8-bit sign-magnitude number:
(a) + 29 (b) 285 (c) + 100 (d) 2123
24. Express each decimal number as an 8-bit number in the 1’s complement form:
(a) 234 (b) + 57 (c) 299 (d) + 115
25. Express each decimal number as an 8-bit number in the 2’s complement form:
(a) + 12 (b) 268 (c) + 101 (d) 2125
26. Determine the decimal value of each signed binary number in the sign-magnitude form:
(a) 10011001 (b) 01110100 (c) 10111111
27. Determine the decimal value of each signed binary number in the 1’s complement form:
(a) 10011001 (b) 01110100 (c) 10111111
28. Determine the decimal value of each signed binary number in the 2’s complement form:
(a) 10011001 (b) 01110100 (c) 10111111
29. Express each of the following sign-magnitude binary numbers in single-precision floating-
point format:
(a) 0111110000101011 (b) 100110000011000
30. Determine the values of the following single-precision floating-point numbers:
(a) 1 10000001 01001001110001000000000
(b) 0 11001100 10000111110100100000000

Section 2–7 Arithmetic Operations with Signed Numbers


31. Convert each pair of decimal numbers to binary and add using the 2’s complement form:
(a) 33 and 15 (b) 56 and 227 (c) 246 and 25 (d) 2110 and 284
32. Perform each addition in the 2’s complement form:
(a) 00010110 + 00110011 (b) 01110000 + 10101111
33. Perform each addition in the 2’s complement form:
(a) 10001100 + 00111001 (b) 11011001 + 11100111
34. Perform each subtraction in the 2’s complement form:
(a) 00110011 2 00010000 (b) 01100101 2 11101000
35. Multiply 01101010 by 11110001 in the 2’s complement form.
36. Divide 10001000 by 00100010 in the 2’s complement form.

Section 2–8 Hexadecimal Numbers


37. Convert each hexadecimal number to binary:
(a) 4616 (b) 5416 (c) B416 (d) 1A316
(e) FA16 (f) ABC16 (g) ABCD16
38. Convert each binary number to hexadecimal:
(a) 1111 (b) 1011 (c) 11111
(d) 10101010 (e) 10101100 (f) 10111011
39. Convert each hexadecimal number to decimal:
(a) 4216 (b) 6416 (c) 2B16 (d) 4D16
(e) FF16 (f) BC16 (g) 6F116 (h) ABC16
40. Convert each decimal number to hexadecimal:
(a) 10 (b) 15 (c) 32 (d) 54
(e) 365 (f) 3652 (g) 7825 (h) 8925
41. Perform the following additions:
(a) 2516 + 3316 (b) 4316 + 6216 (c) A416 + F516 (d) FC16 + AE16
42. Perform the following subtractions:
(a) 6016 2 3916 (b) A516 2 9816 (c) F116 2 A616 (d) AC16 2 1016
120 Number Systems, Operations, and Codes

Section 2–9 Octal Numbers


43. Convert each octal number to decimal:
(a) 148 (b) 538 (c) 678 (d) 1748
(e) 6358 (f) 2548 (g) 26738 (h) 77778
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
45. Convert each octal number into binary:
(a) 178 (b) 268 (c) 1458 (d) 4568
(e) 6538 (f) 7778
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

Section 2–10 Binary Coded Decimal (BCD)


47. Convert each of the following decimal numbers to 8421 BCD:
(a) 10 (b) 13 (c) 18 (d) 21 (e) 25 (f) 36
(g) 44 (h) 57 (i) 69 (j) 98 (k) 125 (l) 156
48. Convert each of the decimal numbers in Problem 47 to straight binary, and compare the
number of bits required with that required for BCD.
49. Convert the following decimal numbers to BCD:
(a) 104 (b) 128 (c) 132 (d) 150 (e) 186
(f) 210 (g) 359 (h) 547 (i) 1051
50. Convert each of the BCD numbers to decimal:
(a) 0001 (b) 0110 (c) 1001
(d) 00011000 (e) 00011001 (f) 00110010
(g) 01000101 (h) 10011000 (i) 100001110000
51. Convert each of the BCD numbers to decimal:
(a) 10000000 (b) 001000110111
(c) 001101000110 (d) 010000100001
(e) 011101010100 (f) 100000000000
(g) 100101111000 (h) 0001011010000011
(i) 1001000000011000 (j) 0110011001100111
52. Add the following BCD numbers:
(a) 0010 + 0001 (b) 0101 + 0011
(c) 0111 + 0010 (d) 1000 + 0001
(e) 00011000 + 00010001 (f) 01100100 + 00110011
(g) 01000000 + 01000111 (h) 10000101 + 00010011
53. Add the following BCD numbers:
(a) 1000 + 0110 (b) 0111 + 0101
(c) 1001 + 1000 (d) 1001 + 0111
(e) 00100101 + 00100111 (f) 01010001 + 01011000
(g) 10011000 + 10010111 (h) 010101100001 + 011100001000
54. Convert each pair of decimal numbers to BCD, and add as indicated:
(a) 4 + 3 (b) 5 + 2 (c) 6 + 4 (d) 17 + 12
(e) 28 + 23 (f) 65 + 58 (g) 113 + 101 (h) 295 + 157

Section 2–11 Digital Codes


55. In a certain application a 4-bit binary sequence cycles from 1111 to 0000 periodically. There
are four bit changes, and because of circuit delays, these changes may not occur at the same
Answers 121

instant. For example, if the LSB changes first, the number will appear as 1110 during the
transition from 1111 to 0000 and may be misinterpreted by the system. Illustrate how the Gray
code avoids this problem.
56. Convert each binary number to Gray code:
(a) 11011 (b) 1001010 (c) 1111011101110
57. Convert each Gray code to binary:
(a) 1010 (b) 00010 (c) 11000010001
58. Convert each of the following decimal numbers to ASCII. Refer to Table 2–7.
(a) 1 (b) 3 (c) 6 (d) 10 (e) 18
(f) 29 (g) 56 (h) 75 (i) 107
59. Determine each ASCII character. Refer to Table 2–7.
(a) 0011000 (b) 1001010 (c) 0111101
(d) 0100011 (e) 0111110 (f) 1000010
60. Decode the following ASCII coded message:
1001000 1100101 1101100 1101100 1101111 0101110
0100000 1001000 1101111 1110111 0100000 1100001
1110010 1100101 0100000 1111001 1101111 1110101
0111111
61. Write the message in Problem 60 in hexadecimal.
62. Convert the following statement to ASCII:
30 INPUT A, B

Section 2–12 Error Codes


63. Determine which of the following even parity codes are in error:
(a) 100110010 (b) 011101010 (c) 10111111010001010
64. Determine which of the following odd parity codes are in error:
(a) 11110110 (b) 00110001 (c) 01010101010101010
65. Attach the proper even parity bit to each of the following bytes of data:
(a) 10100100 (b) 00001001 (c) 11111110
66. Apply modulo-2 to the following:
(a) 1100 + 1011 (b) 1111 + 0100 (c) 10011001 + 100011100
67. Verify that modulo-2 subtraction is the same as modulo-2 addition by adding the result of each
operation in problem 66 to either of the original numbers to get the other number. This will
show that the result is the same as the difference of the two numbers.
68. Apply CRC to the data bits 10110010 using the generator code 1010 to produce the transmitted
CRC code.
69. Assume that the code produced in problem 68 incurs an error in the most significant bit during
transmission. Apply CRC to detect the error.

ANSWERS
SECTION CHECKUPS
Section 2–1 Decimal Numbers
1. (a) 1370: 10 (b) 6725: 100 (c) 7051: 1000 (d) 58.72: 0.1
2. (a) 51 = (5 * 10) + (1 * 1)
(b) 137 = (1 * 100) + (3 * 10) + (7 * 1)
(c) 1492 = (1 * 1000) + (4 * 100) + (9 * 10) + (2 * 1)
(d) 106.58 = (1 * 100) + (0 * 10) + (6 * 1) + (5 * 0.1) + (8 * 0.01)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy