Assignment 1, Solutions
Part of
the homework for 22C:60, Fall 2009
|
No solution offered
Question: The Flex-O-Writer did not have an obvious "best" size for characters. Briefly discuss how you would go about supporting this character set on a computer with a 6-bit character code. (1 point)
86 characters is greater than 26, so if character codes are constrained to be 6 bits, we will need to reserve 2 codes, one for shift in, and one for shift out. For example, we might divide the 86 characters into 43 lower and 43 upper case characters, with shift in and shift out used to switch between lower and upper case.
If the 86 characters include alll 26 upper case and 26 lower case characters of the Roman alphabet, that implies that there are 24 other printable characters, probably 10 numerals plus 14 punctuation marks. If we make the shift codes apply only to characters in the Roman alphabet, while all punctuation and digits appear identically in upper and lower case, that means that we have 50 printable characters in each case. Given that a 6-bit code allows 64 characters, total, this means we have room for 14 control characters, including space, shift-in and shift-out.
F/S |OOo OO| 2 | o O | 2 | o O | L/S |O oO | C |OOoO O| F/S |OOo OO| : |OOoO O| 6 | oOO | 0 | o | , |O oO O| |OOoOOO| 1 | o O| 0 | o | : |OOoO O| 3 | o OO| 0 | o | |OOoOOO| L/S |O oO | M |OOo O | W | o O | F | OoOO | F/S |OOo OO| , |O oO O| |OOoOOO| 2 | o O | 2 | o O | 1 | o O| |OOoOOO| L/S |O oO | M |OOo O | L | OoOOO| H |OOoO |
2 011 0010 2 011 0010 C 100 0011 : 011 1010 6 011 0110 0 011 0000 , 010 1100 010 0000 1 011 0001 0 011 0000 : 011 1010 3 011 0011 0 011 0000 010 0000 M 100 1101 W 101 0111 F 100 0110 , 010 1100 010 0000 2 011 0010 2 011 0010 1 011 0001 010 0000 M 100 1101 L 100 1100 H 100 1000