Assignment 2, Solutions
Part of
the homework for 22C:60, Fall 2009
|
NUL = #00 LF = #0A CR = #0D SI = #0E SO = #0F ASCII "This is a ",SO ASCII "Red Letter",SI ASCII "day!",CR, LF, NUL
1 0 1 1 0 1 0 0 0 1 0 0
0 1 0 1 1 1 1 0 1 0 0 1
a) Treat each group as a 12 bit integer and convert it to decimal. (you should check your work by conversion back to binary.) (0.4 points)
1 0 1 1 0 1 0 0 0 1 0 0 = 288410
0 1 0 1 1 1 1 0 1 0 0 1 = 151310
b) Show each binary number you created for the above problem in octal and in hexadecimal. (0.4 points)
1 0 1 1 0 1 0 0 0 1 0 0 = 55048 = B4416
0 1 0 1 1 1 1 0 1 0 0 1 = 27518 = 5EA16
c) Add the two 12-bit binary numbers you created, showing your work. (you should convert the sum to decimal so you can check the result.) (0.4 points)
1 1 1 1 1 1
1 0 1 1 0 1 0 0 0 1 0 0 = 288410
0 1 0 1 1 1 1 0 1 0 0 1 = 151310
_________________________ _____
1 0 0 0 1 0 0 1 0 1 1 0 1 = 439710
d) Take the two 12-bit binary numbers you created and interpret them as numbers in the 12-bit two's complement number system. Because they are random, each has a 50-50 chance of being negative. Give the signed decimal interpretation of each number, then take their two's complements and give the signed decimal interpretation of their complements. (0.4 points)
1 0 1 1 0 1 0 0 0 1 0 0 = -121210
0 1 0 0 1 0 1 1 1 1 0 0 = +1212100 1 0 1 1 1 1 0 1 0 0 1 = +151310
1 0 1 0 0 0 0 1 0 1 1 1 = -151310
W #E3882088 B #14, #51 H #4444 H #8A3E, #4442 W #E3810441Write down the results as 4 consecutive words in binary, with both rows and columns of bits neatly aligned in tabular form. If you get it right, a pattern will emerge that spells a message. (0.8 point)
000000: E3882088 111...111...1.....1.....1...1... 000004: 44445114 .1...1...1...1...1.1...1...1.1.. 000008: 44428A3E .1...1...1....1.1...1.1...11111. 00000C: E3810441 111...111......1.....1...1.....1
I deliberately used . instead of 0 above to make the IOWA stand out.
+000000: E3882088 1 W #E3882088 +000004: 14 51 2 B #14, #51 +000006: 4444 3 H #4444 +000008: 8A3E 4442 4 H #8A3E, #4442 +00000C: E3810441 5 W #E3810441