Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture 36
Control signals
Instruction cycle
Reading assignments
FL15
Textbook 5.6
Textbook Appendix C.1 - C.3
V. Kindratenko
ECE 120
Lecture 36
At the high level, LC-3 consists of a datapath, memory, and a control unit
LC-3 datapath includes functional units, registers, and busses
Datapath is controlled by 37 control signals generated by the control unit
o For now we will only consider a simplified version of LC-3 without interrupts and
exceptions support. This architecture requires only 25 control signals
o Put together, 25 control signals form a control word
The figure below shows the datapath and all the control signals necessary to control it
o 25 bits of control signals, No Interrupt or Exception Control signals
Control Signal
GateXX
LD.XX
xxMUX
ALUK
MIO.EN
R.W
FL15
# of Signals
4
7
6
1
1
1
V. Kindratenko
ECE 120
FL15
Lecture 36
V. Kindratenko
ECE 120
Lecture 36
then MIO.EN = 0 and R.W = x; i.e., if the memory is disabled, then the read/write signal
is ignored, and so it does not matter whether the read/write signal is 0 or 1.
1 ALU signal: ALUK (2 bits)
o If we need to perform an ADD, AND, or NOT operation, then the ALU will do it for us:
ALUK inputs need to be set to 00, 01, or 10, respectively. If we need to pass data
through the ALU then ALUK = 11. If the ALU is not being used, then ALUK = xx.
6 MUX select signals: MARMUX, PCMUX (2 bits), ADDR1MUX, ADDR2MUX (2 bits), DRMUX (2
bits), SR1MUX (2 bits)
o Specifying the mux select inputs corresponds to determining the path used for the given
microinstruction. Set the select lines so that the data follows the appropriate path. If the
microinstruction does not use a part of the datapath, then we don't care what those
mux select line values are.
Instruction cycle
MDR M[MAR]
FETCH
DECODE
ADD
FL15
State 33
IR MDR
State 35
[opcode]
State 32
LDR
JMP
Last state
to carry out ADD
instruction
Last state
to carry out
LDR instruction
PC <- Register
To state 1
18
To state 18
1
To state 1
18
State 18
1
Instruction FETCH and DECODE phase consists of shared states which are identical for all
instructions
Execute phase follows a sequence of states unique for each instruction
LC-3 state machine shows all the states implementing different instructions and transitions
between them
o States correspond to individual RTL statements necessary to implement an instruction
o Some states are shared between multiple instructions
o Other states are unique to individual instructions
o States are numbered with state #18 being the starting state for all the instructions
V. Kindratenko
ECE 120
FL15
Lecture 36
V. Kindratenko
ECE 120
FL15
Lecture 36
V. Kindratenko
ECE 120
Lecture 36
State 33: MDR M[MAR]
GateXX:
o GatePC=0
o GateMARMUX = 0
o GateMDR = 0
o GateALU = 0
LD.XX:
o LD.PC=0
o LD.BEN = 0
o LD.MAR = 0
o LD.MDR = 1
o LD.IR=0
o LD.REG =0
o LD.CC = 0
State 35: IR MDR
GateXX:
o GatePC=0
o GateMARMUX = 0
o GateMDR = 1
o GateALU = 0
LD.XX:
o LD.PC=0
o LD.BEN = 0
o LD.MAR = 0
o LD.MDR = 0
o LD.IR=1
o LD.REG =0
o LD.CC = 0
xxMUX:
o SR1MUX = xx
o DRMUX = xx
o MARMUX =x
o PCMUX =xx
o ADDR1MUX =x
o ADDR2MUX=xx
Other Control Signals
o ALUK = xx
o MIO.EN =1
o RW = 0
xxMUX:
o SR1MUX = xx
o DRMUX = xx
o MARMUX =x
o PCMUX =xx
o ADDR1MUX =x
o ADDR2MUX=xx
Other Control Signals
o ALUK = xx
o MIO.EN =0
o RW =x
LD.BEN
LD.MAR
LD.MDR
LD.IR
LD.PC
LD.REG
LD.CC
GateMARMUX
GateMDR
GateALU
GatePC
MARMUX
PCMUX
ADDR1MUX
ADDR2MUX
DRMUX
SR1MUX
ALUK
MIO.EN
R.W
state
010010
100001
100011
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
x
x
x
00
xx
xx
x
x
x
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
xx
0
1
0
x
1
x
FL15
V. Kindratenko
ECE 120
Lecture 36
o
o
o
o
o
FL15
V. Kindratenko