Assignment 1, Solutions
Part of
the homework for 22C:60 (CS:2630), Fall 2011
|
No solution offered.
000000000000 space 100000000000 + (sometimes) 000000100000 4 010000000000 - (sometimes) 000000010000 5 001000000000 0 000000001000 6 000100000000 1 000000000100 7 000010000000 2 000000000010 8 000001000000 3 000000000001 9
In 1928, IBM extended their code, supporting upper case letters encoded with 2 punches (they called these multipunch codes), one punch in positions +, - or 0 (the zone punch) positions, and one punch in the 1 through 9 positions (the numeric punch):
100100000000 A (+ 1) 010000000010 Q (- 8) 100010000000 B (+ 2) 010000000001 R (- 9) 100001000000 C (+ 3) 001010000000 S (0 2) - - - 001001000000 T (0 3) 100000000010 H (+ 8) - - - 100000000001 I (+ 9) 001000000010 Y (0 8) 010100000000 J (- 1) 001000000001 Z (0 9) 010010000000 K (- 2)
Question: Give the punched card encoding for "HELLO WORLD" (not including the quotes).
See left column below. The right column is the answer to the next question.
100000000010 H (+ 8) 011000 100000010000 E (+ 5) 010101 010001000000 L (- 3) 100011 010001000000 L (- 3) 100011 010000001000 O (- 6) 100110 000000000000 space 000000 001000001000 W (0 6) 110110 010000001000 O (- 6) 100110 010000000001 R (- 9) 101001 010001000000 L (- 3) 100011 100000100000 D (+ 4) 010100
000000000000 space coded as 000000 001000000000 0 110000 000100000000 1 000001 000000000001 9 001001 100100000000 A (+ 1) 010001 100000000001 I (+ 9) 011001 010000000010 Q (- 8) 101000 001001000000 T (0 3) 110011
Question: Give the 6-bit encoding for "HELLO WORLD" (not including the quotes).
See right column in answer to the previous question, but here are some notes on how this was derived, since several students had questions about this:
Take, for example, the letter E. The 12-bit punched card code is:
100000010000 E (+ 5)This can be broken into 2 fields, the zone and numeric fields:
100 000010000Bit 1 of the zone field is punched, and bit 5 of the numeric field is punched, so the 2 and 4 bit compact encodings of these two fields are:
01 0101Putting this together, we get the 6-bit code for E:
010101
0111101 = 0100000 space 1000011 C 1010011 S 0111010 : 0110010 2 0110110 6 0110011 3 0110000 0 0100000 space 0111101 =