one line of code at a time
MIPS Read and Write in Register file 본문
RegFile은 Register 32개로 이루어진 파일이다. 각 Register는 32 bit을 가진다.



ReadReg1, ReadReg2, WriteReg는 5 bit, WriteData는 32 bit, RegWrite과 Clock 은 1 bit
RegWrite (rwrite)는 write 할 때는 1이고, 그렇지 않으면 0이다.
WriteReg는 write 할 Register이다. 32개의 Register를 나타내야하므로 5 bit이다.
Reading from the Register File
For example, if you want to read the value stored inside $10, you can sest Read Register 1 to 10. The value $10 will appear on the Read Data 1 output.

Writing to the Register File
To write to a register inside of the register file, set the following signals
- Write register: the number of the register you're writing to
- Write data: The data you want to store inside the register
- RegWrite: This is a control signal whose value needs to be 1 to write to a register
- When we're not writing to a register, this value should be 0

wreg에 해당되는 register가 enabled 되어야 한다.


'컴퓨터공부' 카테고리의 다른 글
| Review COMP 211: Systems Fundamentals (0) | 2024.08.25 |
|---|---|
| Bits, Nibbles, and Bytes in Memory (0) | 2024.08.24 |
| nMos, pMos 트랜지스터 (0) | 2024.08.24 |