In the datapath, there are several places where a mux (multiplexor) is
used to select which of two sources should provide a value. When you
modify the datapath to add the
jal instruction, you may find yourself
wanting to change one or more of these two-way choices to a three-way
choice. There are two options for how you can do this; either is
fine. One option is to add a second two-way mux, with the output from
one of the two-way muxes feeding into one of the inputs of the other.
Then you will have a new control signal controlling the new mux. The
other option is to modifying the existing two-way mux to be a
three-way mux, with a new input labeled 2 (in addition to the existing
inputs 0 and 1). If you do this, you'll need to widen the mux's
control signal from a one-bit control (capable of selecting 0 or 1) to
a two-bit control (capable of selecting 0 (binary 00), 1 (binary 01),
or 2 (binary 10). The fourth possibility, binary 11, wouldn't be
In the datapath, you may find yourself wanting to inject a constant value in at some point. You can do this just by writing the constant with an arrow leading from it, as in the example of the 4 that feeds into the adder that computes PC+4.
In the control table from page 361, you will definitely need to add a
row, for the
jal instruction. However, you may also need to add one
or more more columns, for any newly added or widened control signals
that you introduce in the datapath. If so, you will need to show the
values of these new control signals in the existing rows as well as in
the new row.
Instructor: Max Hailperin