Microcode - Introduction to Computer Engineering - Notes | ECE 2030, Study notes of Electrical and Electronics Engineering

Material Type: Notes; Class: Intro to Computer Engr; Subject: Electrical & Computer Engr; University: Georgia Institute of Technology-Main Campus; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 08/04/2009

koofers-user-yr7-1
koofers-user-yr7-1 🇺🇸

8 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Microcode
The datapath below incorporates an adder/subtractor and a one bit shifter. The arithmetic operation
is specied by the
add=sub
control line. The subtraction 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. On each cycle, one add/sub
or
shift operation
can occur in the datapath.
222
32
32
32
Register
File
X
Z
+/-
shifter
WE
+/- en shift en
add/sub
XYZ
right/left
Y
Part A
Write microcode for this datapath to compute the average of the four initial values in the register
le, leaving the result in register zero. You may modify other any register once its value has been summed.
Put your answers in decimal (i.e., to select register two on the X bus, put a 2 in the X column).
cycle
X Y Z WE add=sub
+
=
;
enable right=lef t shift enable
1
2
3
4
5
pf3
pf4
pf5

Partial preview of the text

Download Microcode - Introduction to Computer Engineering - Notes | ECE 2030 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Micro co de

The datapath b elow incorp orates an adder/subtractor and a one bit shifter. The arithmetic op eration is sp eci ed by the add=sub control line. The subtraction is X - Y. The shift direction is controlled by the r ig ht=l ef t control line. The enable signals determine which functional unit drives the Z bus. The datapath also contains a register le with four registers. On each cycle, one add/sub or shift op eration can o ccur in the datapath.

Register

File

X

Z

shifter

WE

+/- en shift en

add/sub

X Y Z

right/left

Y

Part A Write micro co de for this datapath to compute the average of the four initial values in the register le, leaving the result in register zero. You may mo dify other any register once its value has b een summed. Put your answers in decimal (i.e., to select register two on the X bus, put a 2 in the X column).

cycle X Y Z W E add=sub += enabl e r ig ht=l ef t shif t enabl e 1

2

Part B Write micro co de for this datapath to compute the function:

R 0 = (R 1 + R 3 )= 2 + 4(R 2 R 0 )

You may mo dify any register once its initial value has b een used. Put your answers in decimal.

cycle X Y Z W E add=sub += enabl e r ig ht=l ef t shif t enabl e 1 2 3 4 5 6 7 8

Part C The datapath b elow incorp orates an adder/subtractor, multiply/divider, and a one bit shifter. An arithmetic op eration is sp eci 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 r ig ht=l ef t 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

Add/Sub Mul/Div shift en

Shifter

right/left

Register File

Write micro co de for this datapath to compute the function b elow. The initial values of the registers should b e used in the equation. Any register may b e mo di ed once its initial value has b een used for the last time. Express all signals in o ctal notation (i.e., to select register two on the X bus, put a \2" in the X column).

Part E For the datapath ab ove, write micro co de for this datapath to compute the function b elow. The initial values of the registers should b e used in the equation. Mo dify only R 0. All other registers should b e unchanged by this pro cedure. Use only registers R 0 , R 1 , R 2 , and R 3.

R 0 =

(R 1 12 R 2 )^2 R 3

cycle X Y Z R W E add=sub + en mul =div */ en r ig ht=l ef t shif t en 1 2 3 4 5 6 7 8 9

Part F Write micro co de for this datapath to compute the value (5R 3 ) leaving the result in R 0.

cycle X Y Z R W E add=sub + en mul =div */ en r ig ht=l ef t shif t en 1

Part G Write micro co de for this datapath to exchange the contents of R 1 and R 2. Use only registers R 1 and R 2. Don't worry ab out over ows.

cycle X Y Z R W E add=sub + en mul =div */ en r ig ht=l ef t shif t en 1

2

3

Part H Write micro co de for this datapath to compute the function b elow. For this part, use only R 0 ; R 1 ; R 2.

R 0 =

(3R 0 R 1 )(R 2 +R 1 R 0 ) 2

cycle X Y Z R W E add=sub + en mul =div */ en r ig ht=l ef t shif t en 1 2 3 4 5 6 7 8

Part I For the datapath ab ove, describ e each micro co de instruction b elow using register transfer notation (e.g., R 0 R 1 + R 2 ). Then deduce the expression computed by the microsequence.

add + mul = r ig ht shif t cycle X Y Z R W E sub en div en l ef t en description 1 3 2 2 1 0 0 0 1 0 0

2 2 0 2 1 0 0 0 0 0 1

R 0 =