-1

I have a question about the Store Word function in assembly. I know that the store word writes values to memory locations. But the question in my assignment asks me what the ALU does during these SW operations.

When I simulated it first we add a 0 value to an value we called a. And the ALU shows 0 bit 1 during this operation. But when I assigned another 0 to an value b the ALU shows 4. And in the end when i added a and b with an add and put the result with an sw into the register the ALU showed 8.

here are the operations:

SW      $1     , a      , $0
SW      $1     , b      , $0
SW      $1     , result , $0

My question is: What does the ALU do during these store word functions?

Hazin C.
  • 43
  • 7
  • The MIPS `sw` instruction only takes two operands, not sure what you are talking about. – Jester Sep 13 '15 at 22:57
  • Your homework assignment was designed to make you think. Storing a word to memory doesn't require the ALU, there's no math involved. Pretty wasteful to have a chunk of silicon doing nothing useful, isn't it? Hmm, could it be doing something else? Well, yes. – Hans Passant Sep 13 '15 at 23:04
  • it returns the values 0 4 and 8. Could it be that the ALU sends the memory adresses to the CPU during these functions? – Hazin C. Sep 13 '15 at 23:13

1 Answers1

1

For load word and store word instructions, the ALU is used to compute the memory address by addition.

Hu7
  • 28
  • 1
  • 5