CHEM 131 Midterm: Exam 2 No Solutions Spring 2002

44 views7 pages

Document Summary

Problem 1: consider a misc (minimal instruction set computer) processor which implements only the following 8 instructions: Load ra,rb: use the contents of register rb as the address of a data word in memory and copy the memory data into register ra. Save ra,rb: use the contents of register rb as the address of a data word in memory and copy the contents of register ra to that location. Lodi ra,imm: replace the lower 3 bits of register ra with the speci ed 3 bit immediate. Addi ra,imm: add a constant speci ed by the 3 bit immediate to register ra. Roti ra,imm: rotate the contents of register ra according to the value of the 3 bit immediate. Subr ra,rb: register ra gets (ra - rb). Btop ra,rb: register ra gets bitwise ((not ra) or rb). Mask ra,rb: register ra gets 000000000 if register rb is non-zero, otherwise ra gets 111111111. The word size for this processor is 9 bits.