



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




^
^
^
Another Implementation of LC3 Filled arrow
= info to be processed.
Unfilled arrow
= control signal.
Some Implementation detail : Common Bus ^
This style of implementation uses a common bus^ ■
Shared by memory, ALU, Register File, I/O ■ Same set of wires carry address and data information To have only one component’s address/data on the bus
■^
Use device called Tristate
¾^
E = 1, D = Q ¾^
E = 0, no connection between D & Q
■^
Tristate is an alternative to mux ^
In hardwired implementation we had point-to-point connection between components
■^
Buses can be of various kinds ■^
More on Bus Architectures later
D^
Q E
Some Implementation detail : Memory ^
Unified Memory for instruction and data ^
Before Address or Data is given to memory, there is temporary register to receive the data from the common bus
■^
MAR = Memory Address Register ■^
MDR = Memory Data Register ^
This is done as the bus is used for both address and data^ ■
E.g. STR you need to provide address and data ^
The register can be Read or Written by control signals^ ■
LD.MAR for (MAR) and LD.MDR for (MDR) ^
Similarly when instruction is fetched from Memory, the content is placed in register called IR and it controlled by LD.IR
LC3 Implemention using Microprogram ControlCIT 595
^ The behavior of LC-3 during a given clockcycle is completely described by the 49 bitmicroinstruction
■^
39 bits for control signals ■^
10 bits for possible next state of themachine ^
Each phase of instruction cycle may require more than one microinstruction
■^
E.g. Fetch stage takes 3 microinstructions ^ 6-bit address is used to lookup memory
■^
There are 52 possible microinstructions(states) that can describe LC3’s behavior ■^
Memory size 2
6 x 49
Active Signals for State 18
Filled arrow
= info to be processed.
Unfilled arrow
= control signal.
LC3 Microprogram Implementation: Next State^
10 bits of current microinstruction^ ■
J (6-bits): encodes the mostly likely next state ■ COND (3-bits): field indicates special tests that must occur tocompute the true next state
0 – Unconditional (no test to be performed - then next state is J)
1 – Memory Ready
2 – Branch
3 – Addressing Mode
4 – Privilege Mode
5 – Interrupt
■^
IRD (1-bit) : If IRD = 1, ignore J and COND
Next state is based on opcode field(15:12)
This only happens in state 32
LC3 Microprogram: Next State (contd..) 9 other signals (what actual event took place) ^
INT: To indicate interrupt from I/0 device^ ■
Only tested if in state 18 (because that is before the start of aninstruction cycle) ^
R: indicate the end of memory operation ^
IR[15:12]: current opcode (instruction bits 15:12) ^
IR[11]: Addressing mode (user subroutine) ^
PSR[15]: processor executing in supervisor or user mode ^
BEN: indicates whether or not a branch should be taken
Logic for Microsequencer
LC3 Next State Example
0-
1
0
0
32
18
0
0
18
1
33,
0
5
33
18
POSSIBLENEXT STATE
IRD
COND
J
CURRSTATE ^
State 18: Most likely next state is 33 but need to check for INT (COND = 5). If INT = 1, Next State = 49 ^
State 1: Next State is just 18 (this because you are done finishing ADD instr and want to start a new instr.cycle ^
State 32: J and COND ignored as IRD = 1, 0 – 15 are your next possible states
PC<–BaseR
To 18
PC<–BaseRR7<–PC[IR[11]]^1
PC<–PC+off
To 18
To 18
To 18 To 18To 18
To 8 (See Figure C.7)
RTI
set CC DR<–SR1&OP2*
set CC
[BEN]PC<–PC+off
MAR<–PC+off9MDR<–M[MAR ]
MAR<–PC+off9MDR<–M[MAR]MAR<–MDR
MAR<–B+off
MAR<–PC+off
MAR<–B+off
MAR<–PC+off MDR<–SR
DR<–MDRset CC
To 18To 18
To 18
To 18
To 18
To 49 (See Figure C.7)
B+off6 : Base + SEXT[offset6]PC+off9 : PC + SEXT{offset9]PC+off11 : PC + SEXT[offset11]*OP2 may be SR2 or SEXT[imm5]
set CC
NOT 14
DR<–PC+off9set CC
LEA^
LD^ LDR
LDI^
STI^
STR^
ST
JSR
ADDAND
BRJMP
1101
To 13
TRAP
State 18
State 1
State 32
Hardwired vs. Microprogrammed
^
Complexity^ ■
There is an extra level of instruction interpretation inmicroprogrammed control, which makes it slower thanhardwired control Flexibility
■^
Instruction and Control Logic are tied together inhardwired control, which makes it difficult to modify ■^
New instructions can be easily added by only makingchanges to the microprogram in microprogrammedcontrol implementation