Escolar Documentos
Profissional Documentos
Cultura Documentos
Fall 2002
Example: FIFO
inbus
Ld0 R0 Ld1 R1 Ld2 R2 Ld3 R3
Sel 2
outbus
//sequential part always @(posedge clk or negedge rst_n) if(!rst_n) current_sate <= #1 STATE0; else current_state <= #1 next_sate;
ASM Implementation
0/0
s0
out = 1
1/0
s1
0/0
out = 0 0 out =
1/0
s2
1/0
s1 s3
out = 0
01
0/0
out = 0 0
out = 0
s2
Hardwired:
composed of combinatorial and sequential circuits that generate complete timing that corresponds with execution of each instruction. time-consuming and expensive to design difficult to modify but fast
i n
s1
1
out =
s2
i n
1
out =
s3
i n
1
out =
s4
Shortcut to VERIWELL.lnk
i n
1
out = 1
Substitution of combinational networks of FSM with Programmable Read Only Memory (PROM) The values of all control signals are read from an appropriate address location in PROM. During each clock period, the appropriate level control signals are read from ROM instead of being generated by logic circuitry.
A0 A1 Q A2 A3 A4 A5
OUTPUTS D0 D1 D2 D3 D4
Z1 Z2 Z3 Z4 Z5 0
00 out = 0
0
D
S0
D
State variable
S1
Q Q
S2
register
D D
S3
clk
D5 D6 D7 D8
out = 0
out =
s1 s3
out = 0
01
out = 0 0
Mealy machine: ROM address bits A0-A5 are function of Input x1 and x2 and current states S0-S3
Adv. Digital Design By Dr. Shoab A. Khan
out = 0
00 00 01 01 10 10 11 11
0 1 0 1 0 1 0 1
0 0 0 1 1 1 0 0
0 1 1 0 0 1 0 1
0 0 0 0 0 0 0 1
clk
COUNTER
CLR
Qk
Ak
Machine useful only in generating sequence of control Signals without any input
out current_state
Shortcut to VERIWELL.lnk
Address Lines
out = 0
s2
To Architecture
Design
h0 h1 h2 h3
MUX
xn (shift register)
Load (Shift x)
h
MUX
xn
sel
load_x
X
clk
Data path
rst_n
sel
+
clk
rst_n
yn
clk
COUNTER
Mechanism for changing count sequence begin another sequence under control of microprogram memory
Pk-0 ing eed r res tor nte c Cou put v e in RST_N CLK CLR
Q0 Q1 Qk
A0 A1 Ak
LOAD
To Architecture
SYSCLK
COUNTER
MICROPROGRAM MEMORY
2
K+1
Ak
LOAD
Dm-0
BRANCH ADDRESS OTHER
Pk-0
To Architecture
COUNTER
CLR
Q0 Q1 Qk
A0 A1
MICROPROGRAM MEMORY
2
K+1
Ak
LOAD
Dm-0
BRANCH ADDRESS LOAD SEL OTHER
COND 0 1 COND1
2 3
TRUE
SEL
To Architecture
Conditional load
Pipelined Register
sel
00 01 10 11
load
FALSE
(never load branch address)
COND0
(load branch address if COND0 is TRUE)
COND1
(load branch address if COND1 is TRUE)
Often counters are replaced with an ALU based program counter register The critical path of the design is long as it goes from the counter to ROM to architecture to functional units generating COND0 and COND1 to conditional MUX. The critical path can be broken by inserting a pipeline register in the design
TRUE
(unconditional jump: always load branch address)
CLR
COUNTER
Q0 Q1 Qk
A0 A1
MICROPROGRAM MEMORY
2
K+1
Ak
LOAD
Dm-0
BRANCH ADDRESS LOAD SEL OTHER
COUNTER
Qk
REGISTER
r t e nt u n me Co ace pl re
To Architecture CLR Q0 Q1 1
MUX sel LOAD
D0 D1 Dk
Q0 Q1 Qk
Faster as long propagation delay loop through counter and architecture is broken by registers Drawback: conditional branches require elaborated control logic to get right timing
LOAD P k-0
CLR
FULL ADDER k+1 bits
SYSCLK
words
ADDRESS
PC register replaces state variables used to determine the next state (next address to read from microprogram memory
condition 1 condition 1
3 2 0
DATA Out
COND SEL BRANCH ADDRESS
1MUX
COND
OTHER
To Architecture
MUX added on path between next microprogram addresses coming form PC register and Branch
Elimination of problems with clocking scheme of branching
Path between output of PC register and it input (coming from incrementer) similar to parallel counter structure in counter-based
Value applied address lines microprogram memory always incremented and placed in PC register at the end of each clock cycle of
Adv. Digital Design By Dr. Shoab A. Khan
CCMUX controlled by COND SEL field of microinstruction determines which address source to use for the next address of microprogram memory (similarly to Load input to counter in counter-based controllers)
SYSCLK
words
ADDRESS
DATA Out
COND SEL
BRANCH ADDRESS ADDR OTHER SEL
Benefits: possibility of inputting beginning branching address from external source as well as from the internal instructions in microprogram memory
Adv. Digital Design By Dr. Shoab A. Khan
1 condition 1 condition
COND
1MUX
To Architecture
Or pipelined register
Adv. Digital Design By Dr. Shoab A. Khan
Next Address Select field added to microprogram instruction field Determination of the next microprogram address among mPC register, branch address, second address register and next address select
Selection performed by modified NA and COND MUXEs Next address logic combinational circuit transforming codes from Next Address Select field of microinstruction and data from COND MUX into NA MUX select line
Adv. Digital Design By Dr. Shoab A. Khan Adv. Digital Design By Dr. Shoab A. Khan
words
ADDRESS
0 0 1 cond 1 cond
3 2 0
DATA Out
NEXT ADDRESS LOGIC NEXT ADDRESS SELECT BRANCH BRANCH COND OTHER ADDRESS SELECT
Address kept in register allows on returning to next address of microprogram execution after complete subroutine call
COND
1MUX
To Architecture
Adv. Digital Design By Dr. Shoab A. Khan Adv. Digital Design By Dr. Shoab A. Khan
Subroutine Return Address Register replaced by Subroutine Return Address Memory of stack structure
Possibility to store more than one return address necessity in implementing nested subroutine calls
10
Conclusions Conclusions
Various ways of implementing controllers Memory introduced to allow for microcode base controllers Counter-based microprogrammed controllers simplest but least versatile Register-based microprogrammed controllers allow on branching and subroutines implementations
Solutions to some problems introduced by counterbased controllers
11