TOY EXERCISES READING ------- TOY notes. Lecture notes for TOY. King, 20.1 (bitwise operators) EXERCISES --------- For each of the following TOY programs, suppose that TOY is started at 10 with the given hex numbers loaded into memory. For each problem, give the contents of R1 and R2 when the machine halts. 1. 10: B111 11: B210 12: 2112 13: 0000 2. 10: 9111 11: 9210 12: 2112 13: 0000 3. 10: B101 11: B20C 12: B301 13: 1111 14: 2223 15: 7213 16: 0000 4. 10: B100 11: B201 12: B304 13: B405 14: 1112 15: 7414 16: 7313 17: 0000 5. Suppose one wanted to increase the TOY machine memory to 2048 16-bit words, instead of 256. What is the major problem that would need to be addressed? . . . . ANSWERS TO TOY EXERCISES 1. R1 = 0001, R2 = 0010 2. R1 = 00FF, R2 = 9111 3. R1 = 0040, R2 = 0000 4. R1 = 0014, R2 = 0001 5. Need 11 bits to address the 2^11 = 2048 words, so "load" and "store" instructions (for example) have to be redesigned, since they need 4 bits for the opcode, 3 bits for the register, and 11 bits for the address, 2 bits too many to fit into a 16-bit word.