CS计算机代考程序代写 CSU22022, 7th Lecture, Dr. M. Manzke, Page: 1

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 1

Shift Operations

By controlling IR and IL with multiplexers it
is straightforward to adapt this circuit to
perform arithmetic shifts, constructive and
destructive shifts, Rotates and rotate-then-
carry operation

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 2

4-Bit Barrel Shifter

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 3

Multiple Shifts

If multiple shifts are required we wire them into multiplexers that
have an input for every bit on the bus to obtain a Barrel shifter
(Previous slide).

S1 S2 Y3 Y2 Y1 Y0 Micro-ops
0 0 D3 D2 D1 D0 No Rotate
0 1 D2 D1 D0 D3 Rotate One
1 0 D1 D0 D3 D2 Rotate Two
1 1 D0 D3 D2 D1 Rotate Three

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 4

Controlling a Datapath
The Control Word

The figure on the next slide is an updated version of
our introductory datapath (4th Lecture, Page 12) where
the register file has been expanded to a more realistic
eight n-bit registers.
Consequently the destination decoder and A and B
bus MUX require three-bit select input.
The Function Unit still requires five bits to select
ALU/Shift micro-ops.
Three more bits are required to control:

Writing to the registers (RW)
MUX B (MB)
MUX D (MD)

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 5

4th Lecture – Page 12

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 6

Updated Datapath

m = 5, n = 32

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 7

Control Word

The schematic on the next slide
identifies all these control inputs
and arranges them in a 23-bit vector
called the Control Word.

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 8

Datapath and the
Control Word

We have 5 bits for DA, AA, and BA. Also n = 32 bits

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 9

The Control Word Specifies
One Micro-ops

DA

22 18

AA

17 13

BA

12 8

MB

7

FS

6 2

MD

1

RW

0

Note that for the function select FS we need to
make explicit the relationship between its
value and the micro-ops.

See next slide for details.

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 10

G Select, H Select and MF Select
determine the FS code

FS MF G H Output
Select Select Select

00000 0 0000 XX G = A TRANSFER
00001 0 0001 XX G = A + 1 INCREMENT
00010 0 0010 XX G = A + B ADD
00011 0 0011 XX G = A + B +1 ADD WITH C
00100 0 0100 XX G = A + B A plus 1’s C.B
00101 0 0101 XX G = A + B +1 SUBTRACT
00110 0 0110 XX G = A – 1 DECREMENT
00111 0 0111 XX G = A TRANSFER
01000 0 1000 XX G = A  B AND
01010 0 1010 XX G = A  B OR
01100 0 1100 XX G = A  B XOR
01110 0 1110 XX G = A NOT
10000 1 XXXX 00 G = B TRANSFER
10100 1 XXXX 01 G = sr B SHIFT RIGTH
11000 1 XXXX 10 G = sl B SHIFT LEFT

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 11

FS[2]= Cin

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 12

FS[34]=S0S1

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 13

FS[5]=S2

CSU22022, 7th Lecture, Dr. M. Manzke, Page: 14

FS[6]=MF select