2-20. How many bits are required to represent the decimal numbers in the range from 0 to 999 using
(a) straight binary code? (b) Using BCD code?
2-21. The following numbers are in BCD. Convert them to decimal.
(a) 1001011101010010 (d) 0111011101110101
(b) 000110000100 (e) 010010010010
(c) 011010010101 (f) 010101010101
2-22.*(a) How many bits are contained in eight bytes?
(b) What is the largest hex number that can be represented in four bytes?
(c) What is the largest BCD-encoded decimal value that can be represented in three bytes?
2-23. (a) What is the most significant nibble of the ASCII code for the letter X?
(b) How many nibbles can be stored in a 16-bit word?
(c) How many bytes does it take to make up a 24-bit word?
2-24. Represent the statement “ ” in ASCII code. Attach an odd parity bit.
2-25.*Attach an even-parity bit to each of the ASCII codes for Problem 2-24, and give the results in hex.
2-26. The following bytes (shown in hex) represent a person’s name as it would be stored in a computer’s memory. Each byte is a padded ASCII code. Determine the name of each person.
(a) 42 45 4E 20 53 4D 49 54 48
(b) 4A 6F 65 20 47 72 65 65 6E
2-27. Convert the following decimal numbers to BCD code and then attach an odd parity bit.
(a) 74 (c) 8884 (e)* 65
(b) 38 (d) 275 (f) 9201
2-28.*In a certain digital system, the decimal numbers from 000 through 999 are represented in BCD code. An odd-parity bit is also included at the end of each code group. Examine each of the code groups below, and assume that each one has just been transferred from one location to another. Some of the groups contain errors. Assume that no more than two errors have occurred for each group. Determine which of the code groups have a single error and which of them definitely have a double error. (Hint: Remember that this is a BCD code. And the Parity bit is the LSB coded RED )
(a) 100101011000 0 parity bit
(b) 010001110110 0
(c) 011111000001 1
(d) 100001100010 1
2-37.*In a microcomputer, the addresses of memory locations are binary numbers that identify each memory circuit where a byte is stored.The number of bits that make up an address depends on how many memorylocations there are. Since the number of bits can be very large, the addresses are often specified in hex instead of binary.
(a) If a microcomputer uses a 20-bit address, how many different memory locations are there?
(b) How many hex digits are needed to represent the address of a memory location?
(c) What is the hex address of the 256th memory location? (Note: The first address is always 0.)
2-38. In an audio CD, the audio voltage signal is typically sampled about 44,000 times per second, and the value of each sample is recorded on the CD surface as a binary number. In other words, each recorded binary number represents a single voltage point on the audio signal waveform.
(a) If the binary numbers are six bits in length, how many different voltage values can be represented by a single binary number?
Repeat for eight bits and ten bits.
(b) If ten-bit numbers are used, how many bits will be recorded on the CD in 1 second?
(c) If a CD can typically store 5 billion bits, how many seconds of audio can be recorded when ten-bit numbers are used?
2-39. A black-and-white digital camera lays a fine grid over an image and then measures and records a binary number representing the level of gray it sees in each cell of the grid. For example, if four-bit numbers are used, the value of black is set to 0000 and the value of white to 1111, and any level of gray is somewhere between 0000 and 1111. If six-bit numbers are used, black is 000000, white is 111111, and all grays are between the two. Suppose we wanted to distinguish among 254 different levels of gray within each cell of the grid. How many bits would we need to use to represent these levels?
2-40. A 3-Megapixel digital camera stores an eight-bit number for the brightness of each of the primary colors (red, green, blue) found in
each picture element (pixel). If every bit is stored (no data compression), how many pictures can be stored on a 128-Megabyte memory
card? (Note: In digital systems, Mega means 220.)
SOLUTIONS: