this is a question from computer organization and design boo
this is a question from computer organization and design book 4th edition. i need solution please
Solution
1. Shift left 2 is used in the data path for beq instruction (conditional branch). The offset in the immediate part of the instruction tells how many instructions to be jumped. To convert this number of instructions to jump to bytes to jump we need left shift by 2 (which is multiplying by 4). This would give the relative number of bytes to jump from relative number of instructions.
2. The MUX between data memory and register file is needed to decide the register destination number for the write register from the instruction bits. When the RegDst signal is asserted, register destination number for the write register is taken from bits 20-16 of the instruction, else it is taken from bits 15-11 of the instruction.
3. The MUX between register file and ALU decides if the second operand of the ALU should be taken from the second register, or the sign-extended, lower 16 bits of the instruction. When the ALUSrc signal is asserted, then the sign-extended, lower 16 bits of the instruction is taken as the second operand, else it is taken from the second register.
