Beruflich Dokumente
Kultur Dokumente
Dr DC Hendry
1 RTL Notation
RTL Notation
Remember: this is not a computer language, but a pen and paper notation!
1. For a register capture, i.e., when a register captures a result at the end of
the clock cycle use:
Rtarget expression
where expression is any Boolean or other expression indicating the com-
putation involved.
2. For a signal S to be computed during the clock cycle (often the output of
an FSM), use the notation:
S =< expression >
Clock Cycles
1. During different clock cycles different register transfers will generally oc-
cur.
2. All transfers that occur during one clock cycle are grouped together under
one name.
3. Such clock cycles will proceed in a sequence that is indicated using a right
arrow, thus each clock cycle description will end with a statement such as
cyclename.
4. Conditional statements allow choice between alternative succeeding clock
cycles.
Data Paths
2 Example
Max/Min Circuit
cycle_reset {
min <- (others => 1);
max <- (others => 0);
-> cycle_1
}
2. Where VHDL notation is appropriate use this, it will ease the later con-
version of the design to synthesisable VHDL.
Cycles 1, 2 and 3
1. For the first three numbers read from the input (assume that the input is
available via a register called din), the same procedure is followed.
2. So the RTL for these cycles is:
cycle_1 {
if din > max then
max <- din;
if din < min then
min <- din;
-> cycle_2;
}
3. Cycles 2 and 3 are identical except of course for the succeeding cycle.
Cycle 4
1. The final cycle must update the output registers and reset the min and
max so far.
2. cycle_4 {
if din > max then
out_max <- din;
else
out_max <- max;
end if;
if din < min then
out_min <- din;
else
out_min <- min;
end if;
min <- (others => 1); max <- (others => 0);
}
Status Signals
1. Status lines from the datapath to the controller will be the outputs of the
two comparators implied by the expressions in the if statements. Call
these dmax and dmin.
din din
dmax dmin
2.
max min
1. For this design, internal control signals are required for register load en-
ables, and for multiplexor select signals.
2. Register load enables are required whenever a register conditionally loads
data within any clock cycle.
3. So register load enable lines are required for each of the four registers, call
these lmin, lmax, lomin and lomax.
4. To reset/set the min and max registers add a set line to the min register
and a reset line to the max register, these are also then internal control
signals.
Multiplexors
din
1
> dmax out_
max
0
max
smax
din
1
> dmin out_
min
0
min
smin
The Controller
1. The FSM constituting the controller has five states, cycle reset, cycle 1,
cycle 2, cycle 3 and cycle 4.
2. The inputs are dmin and dmax.
3. The outputs are smin, smax, lmin, lmax, lomin, lomax, setmin and
rstmax.
4. Note that the outputs depend upon the inputs (a consequence of how the
RTL was written) so a Mealy machine is needed.
1. The complete table is simplified by the fact that the next state does not in
this case depend upon any inputs, only the outputs in fact depend upon
the inputs.
2. Since we have two inputs, four columns would be needed per output using
the textbook format. This would mean 24 columns.
3. An alternative format is useful in which each current state is repeated
with different values of the inputs as needed.
4. For this example it may be easier to skip the state table and go straight
to VHDL.
Current Next
lomax
lomin
dmax
smax
dmin
lmax
smin
lmin
State State
cycle reset cycle 1 - - 0 0 0 0 - -
cycle 1 cycle 2 0 0 0 0 0 0 - -
0 1 0 1 0 0 - -
1 0 1 0 0 0 - -
1 1 1 1 0 0 - -
State Diagram
VHDL Code
1. The controller code is constructed using typical finite state machine meth-
ods. Two processes are used, one for the the state register, the second for
the next state logic and the output logic.
2. The controller is then instantiated as a subcomponent within the over-
all design. Data registers, comparators and muxes are constructed using
concurrent assignement statements (or processes) within the single archi-
tecture body.