Assignment 1 Solutions
Part of
the homework for 22C:60, Fall 2010
|
No Solution Provided
Question: The Flex-O-Writer did not have an obvious "best" size for characters. Briefly suggest how you could support this character set on a computer with a 6-bit character code. Both the Illiac code and Unicode's UTF-8 encoding offer hints about how this could be done. (1 point)
Warning: There is, if you search hard enough, documentation on the real Flex-O-Writer on the Internet. The actual character code of the Flex-O-Writer was bizarre enough that it is unlikely to help you answer this question, but it might be fun to look at after you think you have a decent answer.
Borrowing from the Illiac I character set's F/S (Figure Shift) and L/S (Letter Shift) codes, we could reserve 2 of the 64 6-bit codes for shift-in and shift-out, allowing the remaining 62 code to have two meanings each, one shifted in, and one shifted out. This is the basis of the solution used by the real Flex-O-Writer.
Or, borrowing from UTF-8, we could invent a 6-bit code where a leading zero allowed for the 32 most common characters (probably the lower case letters, space, and the most common punctuation marks), while a leading one indicated a multi-byte sequence, for example, 10xxxx could be the lead-in on a 2-byte sequence, while 11xxxx could be the second byte of a 2-byte sequence, allowing encoding of 256 codes.
See below
Suggestion: Your answers to this problem and the next can be arranged as parallel vertical columns, although because of differences in coding, the columns will not be the same length, even though they encode the same characters.
Illiac ASCII |O oO | Letter-Shift C |OOoO O| 1000011 O | Oo O| 1001111 M |OOo O | 1001101 P | o | 1010000 |OOoOOO| 0100000 space O | Oo O| 1001111 R | oO | 1010010 G |OOo O| 1000111 |OOo OO| Figure-Shift . |OOo O | 0101110 , |O oO O| 0101100 |OOoOOO| 0100000 space |O oO | Letter-Shift F | OoOO | 1000110 A |O oOO | 1000001 L | OoOOO| 1001100 L | OoOOO| 1001100 |OOoOOO| 0100000 space |OOo OO| Figure-Shift 2 | o O | 0110010 0 | o | 0110000 1 | o O| 0110001 0 | o | 0110000