1. Perform the following conversions between bases:
a. Convert 0101 00102 to decimal:2. People are generally more comfortable using decimal rather than binary numbers, yet we often use binary numbers in computer science. There is a good reason for this, however. Very briefly explain why.0101 00102 = 64 + 16 + 2 = 8210b. Convert 0011 10112 to hexadecimal:00112 = 316, and 10112 = B16c. Convert 3A16 to decimal:
so 0011 10112= 3B163A16 = 3 * 16 + 10 = 5810d. Convert 19310 to binary:19310 = 128 + 64 + 1 = 1100 00012e. Convert 0x19FE to binary:
(hint: recall that "0x" indicates that the number is in hexadecimal)116 = 00012, and 916 = 10012, and F16 = 11112, and E16 = 11102,
so 19FE16 = 0001 1001 1111 11102
The reason is physical: computers use physical gates to compute their logic, and those gates physically represent only 1's (high voltage) and 0's (low voltage). Thus, all computation and storage in computers is really done using only 1's and 0's. Representing numbers in binary helps computer scientists understand what is really stored in each bit (each flip-flop) in the machine.3. Very briefly explain the key shortcoming of the 7-bit ASCII code which the 16-bit Unicode attempts to remedy.
The A in ASCII stands for American, and the 7-bit ASCII code holds at most 128 characters -- enough for American English (as it was designed for), but woefully inadequate for most of the world's languages. Unicode, with 216 characters, can represent not just English, but Japanese, Chinese, Cyrillic, Arabic, Hebrew, Greek, etc, etc, etc...4. Recalling that the ASCII code for A is 6510, B is 6610, C is 6710, etc, list all the letters between A and G (inclusive) whose ASCII code, when written in binary, has even parity. Be sure to show your work.
A = ASCII 0100 00012 --> even parity (2 1's)5. Write a circuit diagram for a 3-bit odd parity tester. This circuit takes 3 bits of input, and has 1 bit of output, the output being true precisely when the 3 input bits have odd parity. Be sure to label each gate.
B = ASCII 0100 00102 --> even parity (2 1's)
C = ASCII 0100 00112 --> odd parity (3 1's)
D = ASCII 0100 01002 --> even parity (2 1's)
E = ASCII 0100 01012 --> odd parity (3 1's)
F = ASCII 0100 01102 --> odd parity (3 1's)
G = ASCII 0100 01112 --> even parity (4 1's)So the answer is: A, B, D, G
6. An Error Correcting Code where every value has a Hamming Distance of at least 5 from every other value can detect 4-bit errors and correct 2-bit errors. Very briefly explain. (Hint: Recall that the Hamming Distance between two binary numbers is the number of bits which must flip to convert one number into the other.)
If the input has from 1 to 4 bits flipped, it still cannot transform from one valid value to another (since that requires at least 5 bits to flip here). So we can detect that it is not a valid value, and hence that an error occurred. If 5 bits flip, though, we may mistake the errors as another valid value in our code. Hence, 4-bit error detection.7. True or False:For correction, if 1 or 2 bits flip, then the input is still nearest to the original valid value, and so we can convert the erroneous input to the correct value. If 3 bits flip, however, then the input will be equally far from at least two valid values, and so we have no way to determine what the correct value is. Hence, 2-bit error correction.
a) It is easier to convert between binary and hexadecimal numbers than to convert between binary and decimal numbers (and this is why computer scientists use hexadecimal as a shorthand for binary numbers). TRUESee Course Home Page.b) A 16-digit binary number can always be represented with a 3-digit hexadecimal number. FALSE
c) Every binary number has either even or odd parity. TRUE
d) A better name for a "clock" in a digital circuit might be a "strobe" because its primary purpose is not to tell the time of day, like a wall clock, but rather to turn on and off repeatedly like a strobe light. TRUE