Microcode Programming
The datapath below incorporates an adder/subtractor, multiply/divider, and a one bit shifter. An arith-
metic operation is specied by the add=sub and mul=div control lines. Subtraction is (X  Y ); division
is (X=Y ). The shift direction is controlled by the right=left control line. The enable signals determine
which functional unit drives the Z bus. The datapath also contains a register le with four registers.
32
32
Z
add/sub mul/div
*/ en +- en
Y
X
2 2 2
32
X Y Z
RWE
Mul/Div Add/Sub
shift en
Shifter right/left
Register
File
Write microcode for this datapath to compute the function below. The initial values of the registers
should be used in the equation. Any register may be modied once its initial value has been used for the
last time. Express all signals in octal notation (i.e., to select register two on the X bus, put a \2" in the
X column).
R0 =
3R0R1+9R2
R0R3
cycle X Y Z RWE add=sub +  en mul=div */ en right=left shift en
1
2
3
4
5
6
7
8
9
10
Name: __________________