

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(a) Load R 11 with the contents of the memory location stored in R 12. (Di- rect addressing) (b) Load R 11 with the contents of the memory location stored in the mem- ory location stored R 12. (Indirect addressing) (c) Copy the contents of the memory location stored in R 11 to the memory location stored in R 12. (Memory move) (d) Copy the contents of R 10 words of memory starting with the address stored in R 11 to the memory location starting with R 12. (Block mem- ory move) (e) Increment R 15 by 2. (f) Branch to the address P C + 8 if the contents of R 11 are less than 0. (g) Branch to the address P C + 8 if the contents of R 11 are greater than 1. (h) Simulate a stack push by treating the contents of R 12 as data to be pushed on a stack in memory whose top is pointed to by R 15. Your stack should grown down in memory. (Set up for a function call.) (i) Simulate a stack pop by moving the top element of a stack pointed to by R 15 into R 12. (Return from a function call.)
(j) Simulate a state add by popping two elements of a stack pointed to by R 15 into registers, adding the registers, and storing the result on the top of the stack. (Stack-based mathematical operations.)
On the stack-based problems, remember to update the stack pointer after all operations.
architecture beh of cpu is begin CPU: process M : array of word; R11,R12,R13 : word; PC : word; begin ... end process CPU; end architecture beh;
Using VHDL statements, define behaviors for the following operators and memory addressing modes: (Note that you need to indicate only the VHDL needed to implement the function. You may assume that word addition and comparison functions exist. These are not necessarily instructions that are defined for KURM.)
(a) LW R11 #99 - Load R11 with the value 99. (b) LW R11 R12 - Load R11 from the address stored in R (c) LW R11 (R12) - Load R11 from the address stored in the memory location at the address in R (d) SW R11 R13(R12) - Store R11 using register indirect addressing with an offset stored in R13. (e) ADD R12 R13 R11 - Add contents of R12 and R13 storing the re- sult in R (f) INC R11 - Increment R11 by 1 (g) MOV R11 R12 - Move the contents of R11 into R