Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Consider all the unsigned binary numbers with fewer than 14 bits a) How many

ID: 2267147 • Letter: 1

Question

1. Consider all the unsigned binary numbers with fewer than 14 bits a) How many unique numbers are possible? b) How many of these values have the same number of 1's to the left and right of a single 0 (disregarding leading zeros) c) Are any of these numbers prime? 2. How many bits are required to represent five million unique values? Without a calculator, use the approximations log(2)-0.3 and log(5)-0.7 and show each of the steps in the solution by hand 3. Let's say you want to impress your friends* by making a watch that displays the number of seconds since midnight in hexadecimal. (Do not consider leap seconds.) a) What is the minimum number of hexadecimal digits required given that the watch resets to zero every day at midnight? b) Let's say you make the watch and then go to a coffee shop. You enter at exactly 2:26pm and 6 seconds and look at your watch. What value does the watch display? Type of impression may vary depending on the friend 4. Using finite summation notation, write a general formula for a binary integer, B, in 2's complement with b number of bits 5. Sign extension means that any given signed number can be represented with more bits by simply repeating the sign bit. For example, 0005 = +5 and 00005 = +5. This holds true for negative numbers as well. For example, 1011-5 and 11011-5. Also, 111110115 Using finite summation notation, prove that sign extension can be applied to any 2's complement binary integer, B, with b number of bits 6. In class we took a quiz using Plickers cards. Forty of these cards are posted with the homework. Look at these cards and determine how many unique card patterns are possible (disregarding rotation) given the apparent pattern? What problems might a camera encounter distinguishing some patterns? Why? 7. Show the conversion (or conversions) for each of the characters shown -For S, convert 0x506DE1 to decimal -For M, convert-11.4375 to the IEEE 754 hex value -For H, convert 3L9 to decimal. The radix is not given. What is the minimum radix, if you assume the alphabet represents numbers as is true for hexadecimal? Pick a reasonable radix and convert the number -For A, what can 0101010 represent? (List at least 5 representations.) What is interesting about this number?

Explanation / Answer

1.a) considering maximum 14 bits, the maximum number of unique binary numbers possible = 2^14 = 16384

b) this is possible where number of digits are odd (1,3,5,7,9,11 and 13) such that middlemost digit (Eg 4th digit in 7 digit diplay or 7th digit in 13 digit display) is 0 and all other digits are same. Thus 7 such numbers are possible.

c) yes many such number will be prime.

2. Let N be number of numbers and b be number of digits required to represnt N unique numbers. The relation is given as: b >= log2 N.

Here N = 5million = 5000000 = 5 *106

Thus b >= log 2(5*106) =log 10(5*106) / log10(2) = [log 10(5*) + 6] / log10(2) = 6.7/0.3 = 22.33

Thus b is next integer bigger than 22.33.

Thus b = 23

3. a)Total number of seconds in a day = 60s * 60 min * 24 hrs = 86400

Thus number of hexa-decimal digits needed: b>=log16(86400)

b shall be a integer. thus b = total number of hexa-decimal digits = 5

b) total number of seconds passed after 2:26:06 pm = 14hrs *3600 + 6 sec = 50406

Thus hexadecimal eqivalent of 50406 = C4E6