60 likes | 244 Views
CDA 3100. Recitation Week 13. Design a processor:. Design a processor that only supports the ‘ lwrj ’ instruction.
E N D
CDA 3100 Recitation Week 13
Design a processor: • Design a processor that only supports the ‘lwrj’ instruction. • lwrjrs, rt, rd will read the values in rs and rt, use the value of rs + the value of rtas the memory address, read from the memory a value, set rd to be that value, and go to the instruction whose address is the value of rs • Here are the components you will use (you may or may not use all of them):
Design a processor: • Read the value from the PC register and use it as an index to the Instruction memory
Design a processor: • R Type instruction • First 6 bits are opcode (doesn’t matter yet) • Second 5 bits are first read register (rs) • Third 5 bits are second read register (rt) • Fourth 5 bits are write register (rd) • Rest don’t matter
Design a processor: • Pipe your read registers into the ALU • Use value from rs as the new PC value
Design a processor: • Use result from ALU as a memory address • Send the data fetched from memory to be written to the rd register