0

I am trying to convert lw $t3, 12($t0) to binary but I am stuck.

I am not very familiar with base register addressing. I know that lw is opcode 100011 and that $t3 is rt, and that the 12 represents the 16 bit number. The structure is also:

Opcode = 6 bits, rs = 5 bits, rt = 5 bits, immediate = 16 bits

If anyone can help be transform this into binary it would be of great help!

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 1
    You need to look up the register numbers, e.g. that `$t0` is register #8 and `$t3` is #11. I trust you can now fill in the bits :) – Jester Feb 18 '22 at 16:23
  • https://inst.eecs.berkeley.edu/~cs61c/resources/MIPS_Green_Sheet.pdf The information you need for that is well documented, so please clarify where you're stuck. – Erik Eidt Feb 18 '22 at 16:27
  • I guess im confused on getting the binary numbers from the registers, when the binary is 5/16 bits. – user17442276 Feb 18 '22 at 16:53
  • $t0 would be 01000, but then would $t3 be 01011? The 12 is where I have no idea. What I have so far (unsure if correct) is: 100011 01000 01011 (16 bit?) – user17442276 Feb 18 '22 at 17:02
  • 1
    100011 01000 01011 0000 0000 0000 1100 ? – user17442276 Feb 18 '22 at 17:38
  • Yes that looks correct. You can test with a disassembler yourself. – Jester Feb 18 '22 at 19:08

0 Answers0