Assignment 2
, Microprocessor-based Systems – Assignment 2
1. Consider a subtraction instruction with flexible second operand Operand2:
SUB Rd, Rn, Rm, LSL #n
It is desired to modify this instruction to the following new syntax:
SUB Rd, Rm, LSL #n, Rn
This new syntax can be called subtraction instruction with flexible first operand
Operand1. What minimum change in the hardware architecture is required for the
implementation of this instruction? Please draw hardware modifications. (10 points)
Write reg
Solution 1: Read reg2
Read reg1
A shifter must be added between the first operand
and the ALU input. The first operand is given to the
shift unit before passing to the ALU as an input. Register Bank
Operand 1 Operand 2
Shifter
ALU