In this chapter, we introduced digital systems and digital computers and showed why such systems use signals having only two values. We briefly introduced the structure of the stored-program digital computer and showed how computers can be applied to a broad range of specialized applications by using embedded systems. We then related the computer structure to a representative example of a personal computer (PC). We also described the concept of layers of abstraction for managing the com-plexity of designing a computer system built from millions of transistors, as well as outlining the basic design procedure for digital circuits.
Number-system concepts, including base (radix) and radix point, were pre-sented. Because of their correspondence to two-valued signals, binary numbers were discussed in detail. Octal (base 8) and hexadecimal (base 16) were also emphasized, since they are useful as shorthand notation for binary. Arithmetic operations in bases other than base 10 and the conversion of numbers from one base to another were covered. Because of the predominance of decimal in normal use, Binary-Coded Decimal (BCD) was treated. The representation of information in the form of char-acters instead of numbers by means of the ASCII code for the English alphabet was presented. Unicode, a standard for providing characters for languages worldwide, was described. The parity bit was presented as a technique for error detection, and the Gray code, which is critical to selected applications, was defined.
In subsequent chapters, we treat the representation of signed numbers and floating-point numbers. Although these topics fit well with the topics in this chapter, they are difficult to motivate without associating them with the hardware used to
M01_MANO0637_05_SE_C01.indd 32 21/01/15 8:05 AM
Problems
33
implement the operations performed on them. Thus, we delay their presentation until we examine the associated hardware.
r
eferences1. Gray, F. Pulse Code Communication. U. S. Patent 2 632 058, March 17, 1953.
2. Moggridge, B. Designing Interactions. Boston: MIT Press, 2006.
3. Patterson, D. A., and J. L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3rd ed. San Francisco: Morgan Kaufmann, 2004.
4. The Unicode Consortium. “Unicode 6.3.0.” 13 November 2013.
http://www.unicode.org/versions/Unicode6.3.0/
5. White, R. How Computers Work: Millennium Edition, 5th ed. Indianapolis: Que, 1999.
p
robLemsThe plus (+) indicates a more advanced problem, and the asterisk (*) indicates that a solution is available on the Companion Website for the text.
1-1. This problem concerns wind measurements made by the wireless weather station illustrated in Example 1-1. The wind-speed measurement uses a rotating anemometer connected by a shaft to an enclosed disk that is one-half clear and one-half black. There is a light above and a photodiode below the disk in the enclosure. The photodiode produces a 3 V signal when exposed to light and a 0 V signal when not exposed to light. (a) Sketch the relative appearance of voltage waveforms produced by this sensor (1) when the wind is calm, (2) when the wind is 10 mph, and (3) when the wind is 100 mph.
(b) Explain verbally what information the microcomputer must have available and the tasks it must perform to convert the voltage waveforms produced into a binary number representing wind speed in miles per hour.
1-2. Using the scheme in Example 1-1, find the discrete, quantized value of voltage and the binary code for each of the following Fahrenheit temperatures:
-34, +31, +77, and +108.
1-3. *List the binary, octal, and hexadecimal numbers from 16 to 31.
1-4. What is the exact number of bits in a memory that contains (a) 128K bits;
(b) 32M bits; (c) 8G bits?
1-5. How many bits are in 1 Tb? [Hint: Depending on the tool used to calculate this, you may need to use a trick to get the exact result. Note that 220 = 1,000,00010 + d, where d is the difference between 220 and 1,000,00010, and that 1T = (1,000,00010 + d)2. Expand the equation for 1T into a sum-of-products form, insert the value of d, find the three sum-of-products, and then find their sum.]
1-6. What is the decimal equivalent of the largest binary integer that can be obtained with (a) 11 bits and (b) 25 bits?
M01_MANO0637_05_SE_C01.indd 33 21/01/15 8:05 AM
34
CHAPTER 1 / DigiTAl SySTEmS AnD infoRmATion1-7. *Convert the following binary numbers to decimal: 1001101, 1010011.101, and 10101110.1001.
1-8. Convert the following decimal numbers to binary: 187, 891, 2014, and 20486.
1-9. *Convert the following numbers from the given base to the other three bases listed in the table:
Decimal binary Octal Hexadecimal
369.3125 ? ? ?
? 10111101.101 ? ?
? ? 326.5 ?
? ? ? F3C7.A
1-10. *Convert the following decimal numbers to the indicated bases, using the methods of Examples 1-4 on page 23 and 1-7 on page 24:
(a) 7562.45 to octal
(a) (673.6)8 to hexadecimal
(a) 1010 * 1100
(b) 1938.257 to hexadecimal
(b) (E7C.B)16 to octal
(b) 0110 * 1001
(c) 175.175 to binary.
(c) (310.2)4 to octal
(c) 1111001 * 011101 1-11. *Perform the following conversion by using base 2 instead of base 10 as the
intermediate base for the conversion:
1-12. Perform the following binary multiplications:
1-13. +Division is composed of multiplications and subtractions. Perform the binary division 1010110 , 101 to obtain a quotient and remainder.
1-14. A limited number system uses base 12. There are at most four integer digits.
The weights of the digits are 123, 122, 12, and 1. Special names are given to the weights as follows: 12 = 1 dozen, 122 = 1 gross, and 123 = 1 great gross.
(a) How many beverage cans are in 6 great gross + 8 gross + 7 dozen + 4?
(b) Find the representation in base 12 for 756910 beverage cans.
1-15. Considerable evidence suggests that base 20 has historically been used for number systems in a number of cultures.
(a) Write the digits for a base 20 system, using an extension of the same digit representation scheme employed for hexadecimal.
(b) Convert (2014)10 to base 20. (c) Convert (BCI.G)20 to decimal.
1-16. *In each of the following cases, determine the radix r:
(a) (BEE)r = (2699)10 (b) (365)r = (194)10
M01_MANO0637_05_SE_C01.indd 34 21/01/15 8:05 AM
Problems
35
1-17. The following calculation was performed by a particular breed of unusually intelligent chicken. If the radix r used by the chicken corresponds to its total number of toes, how many toes does the chicken have on each foot?
((34)r + (24)r) * (21)r = (1480)r
1-18. *Find the binary representations for each of the following BCD numbers:
(a) 0100 1000 0110 0111 (b) 0011 0111 1000.0111 0101 1-19. *Represent the decimal numbers 715 and 354 in BCD.
1-20. *Internally in the computer, with few exceptions, all numerical computation is done using binary numbers. Input, however, often uses ASCII, which is formed by appending 011 to the left of a BCD code. Thus, an algorithm that directly converts a BCD integer to a binary integer is very useful. Here is one such algorithm:
1. Draw lines between the 4-bit decades in the BCD number.
2. Move the BCD number one bit to the right.
3. Subtract 0011 from each BCD decade containing a binary value > 0111.
4. Repeat steps 2 and 3 until the leftmost 1 in the BCD number has been moved out of the least significant decade position.
5. Read the binary result to the right of the least significant BCD decade.
(a) Execute the algorithm for the BCD number 0111 1000.
(b) Execute the algorithm for the BCD number 0011 1001 0111.
1-21. Internally in a computer, with few exceptions, all computation is done using binary numbers. Output, however, often uses ASCII, which is formed by appending 011 to the left of a BCD code. Thus, an algorithm that directly converts a binary integer to a BCD integer is very useful. Here is one such algorithm:
1. Draw lines to bound the expected BCD decades to the left of the binary number.
2. Move the binary number one bit to the left.
3. Add 0011 to each BCD decade containing a binary value > 0100.
4. Repeat steps 2 and 3 until the last bit in the binary number has been moved into the least significant BCD decade position.
5. Read the BCD result.
(a) Execute the algorithm for the binary number 1111000.
(b) Execute the algorithm for the binary number 01110010111.
M01_MANO0637_05_SE_C01.indd 35 21/01/15 8:05 AM
36
CHAPTER 1 / DigiTAl SySTEmS AnD infoRmATion1-22. What bit position in an ASCII code must be complemented to change the ASCII letter represented from uppercase to lowercase and vice versa?
1-23. Write your full name in ASCII, using an 8-bit code: (a) with the leftmost bit always 0 and (b) with the leftmost bit selected to produce even parity. Include a space between names and a period after the middle initial.
1-24. Decode the following ASCII code: 1000111 1101111 0100000 1000011 1100001 1110010 1100100 1101001 1101110 110001 1101100 1110011 0100001.
1-25. *Show the bit configuration that represents the decimal number 255 in:
(a) binary, (b) BCD, (c) ASCII, and (d) ASCII with odd parity.
1-26. Encode the following Unicode code points in UTF-8. Show the binary and hexadecimal value for each encoding: (a) U+0040, (b) U+00A2, (c) U+20AC, and (d) U+1F6B2
1-27. (a) List the 6-bit binary number equivalents for 32 through 47 with a parity bit added in the rightmost position, giving odd parity to the overall 7-bit numbers. (b) Repeat for even parity.
1-28. Using the procedure given in Section 1-7, find the hexadecimal Gray code.
1-29. This problem concerns wind measurements made by the wireless weather station in Example 1-1. The wind direction is to be measured with a disk encoder like the one shown in Figure 1-6(b). (a) Assuming that the code 000 corresponds to N, list the Gray code values for each of the directions, S, E, W, NW, NE, SW, and SE. (b) Explain why the Gray code you have assigned avoids the reporting of major errors in wind direction.
1-30. +What is the percentage of power consumed for continuous counting (either up or down but not both) at the outputs of a binary Gray code counter (with all 2n code words used) compared to a binary counter as a function of the number of bits, n, in the two counters?
M01_MANO0637_05_SE_C01.indd 36 21/01/15 8:05 AM