What is happening in this part of the LC3? [closed]

This is a diagram of the LC3 Computer

I am trying to understand what is happening in the parts I highlighted. The part I had highlighted had the instruction bit sign extended to 16 bits and then passed on to the SR2 Mux. Does anyone know what instruction is being carried out here or what the role of the mux(SR2) is here?

• more intro/ bkg on the LC3 would be helpful. MUX= multiplexer. it chooses 1 of n inputs controlled by a address. this might go better on Electrical Engineering – vzn Apr 23 '15 at 1:06
• You have to be able to formulate a question in your own terms, from start to finish. You seem to be asking for help in understanding your study material. I believe that's not our job. – André Souza Lemos Apr 23 '15 at 1:07
• The MUX selects either the sign-extended immediate from the instruction or the second register operand. An instruction like ADD r2, R3, #4 (not necessarily provided by LC-3) would select the immediate, while ADD r2, R3, R2 would select the register operand. – Paul A. Clayton Apr 23 '15 at 10:48
• @vsz I'm guessing it's talking about en.wikipedia.org/wiki/LC-3, but I'm not familiar with it. – Fizz Apr 23 '15 at 12:26

1 Answer

This would appear to be a picture of the LC-3 data path from the book Patt, Yale N; Patel, Sanjay J: Introduction to Computing Systems.

The IR is the instruction register, the register where the actual bits of the instruction are fetched in the beginning cycles of processing the instruction. The SEXT unit takes the immediate field out of the instruction. The SR2MUX is used by the control unit to control whether the second operand of the instruction comes from a register operand or the immediate operand.

• You might mention that SEXT (obvious from the name) sign extends the immediate ("takes ... out" kind of implies a simple extraction, i.e., extending with zero). – Paul A. Clayton Apr 24 '15 at 11:35