Abstract
/MIPS/assets/mips_data_memory.png)
- Accepts a memory address with
Address - Both
MemWriteandMemReadcannot be1at the same time. WhenMemWriteis1,Write Datais active and data is written to theAddress. WhenMemReadis1,Read Datais active and data is read from theAddress
Important
The result from the ALU is connected to
Address. However, some instructions, like theaddinstruction, donβt involve the data element and would like the ALU result to be written back to a register. That is why we add a multiplexerMemToRegafter theRead Dataand theALU result.
Read Data
/MIPS/assets/mips_memory_load_data.png)
RegDstis set to0, so theWRis registerrtALUSrcis set to1, so theImmediatevalue is sent to ALU, instead ofRD2MemWriteis set to0, andMemReadis set to1, so the memory is read-only
Write Data
/MIPS/assets/mips_memory_write_data.png)
RegDstis set to0, so theWRis registerrtALUSrcis set to1, so theImmediatevalue is sent to ALU, instead ofRD2MemWriteis set to1, andMemReadis set to0, so the memory is write-only
Important
There is a wire between the
RD2andWrite Data, so the data inside registerrtcan be written back to the memory.

/MIPS/assets/mips_memory_or_register.png)