Answered step by step
Verified Expert Solution
Question
1 Approved Answer
shows the datapath that you had to work with in the last lab. Let us discuss the new operations and what changes need to happen
shows the datapath that you had to work with in the last lab. Let us discuss the new operations
and what changes need to happen to support them:
Addsubtract immediate addisubi The datapath changes are the same for these two new
operations, so we will discuss them together. The normal addsub operations the ones you
implemented in the last lab read a value from the RF and capture it into staging latch A and
then read a second operand from the RF that is used by the secondary input of the adder. In
the case of this new operation, the first operand is still read from the RF and captured in staging
latch A But the data for the secondary input to the adder needs to be the data coming from
the immediate Imm field of the instruction ie addi causes X X Imm while subi causes
X X Imm. So we will need a pathway for that data to reach the secondary input to the
adder, without breaking the support for the registerbased add or the support for the load
operation.
Display You need to implement a holding latch not unlike latch A and latch G in the diagram
above that gets loaded by the display operation with the contents of whatever register is
specified by AddrX as part of the operation. Again, the idea is that the value in this memory
would be displayed on a screen not really, but conceptually If you want to display a different
value, you will need to execute another display operation. Relative to the diagram above, you
will need to define where this new latch will be added and how data from the RF can be loaded
into it
Changes to the datapath
Given the new operations that we are looking to implement, it needs to change. To support the newly
added instructions, we need to add two more Verilog modules as depicted in Figure That is
MUX Previously, the second bit operand of the adder always came from the RF On the
other hand, we now must selectively feed the data from the Imm field of the instruction for
addi and subi or from the RFs DataOut for the other instructions A bit to MUX
muxtov in added in the datapath for this purpose. While the source code of this MUX
is given in a completed form, take the time to look at the source code; it is worth having a look
as it is written in a generic way to support any bit lengths. I.e the same implementation can
be reused without any modification for different big lengths such as bit or bit Through
this MUX, DataOut from the RF is connected to the second operand of Adder if Iout is On
the other hand, when Iout is Imm is the second operand that Adder gets.
Latch DP For the display latch, you can reuse the latch code Av that was used for latch A
and latch G in Lab The enable input DPin of this latch should be properly controlled by
the control logic.
Control logic The control state machine needs to be modified properly with two additional
control output signals Iout and DPin
Extending Opcode
In Lab we used a bit opcode to specify which operation to perform. Now that we are adding three
new operations, we need to add another bit to our opcode. This will give us a bit value for the
purposes of specifying the operation to perform, which in turn means that you will need to extend the
specification of your encodings for all the possible operations, so that each is now a unique bit
value. And your state machine, which is dependent on properly decoding the specified operation, will
need to account for the new encoding specification. We assume the following extended encoding for
opcode operation in lSMv:
b: load
b: move
b: subtract
b: add
b: display
b: reserved ie not used for now
b: subi
b: addi
With this extended opcode, we have an bit instruction format for this datapath as illustrated below:
II PRELAB
i Based on the updated block diagram Figure and instruction format Figure which show
the datapath support for the new operations, properly modify the module interface of lSMv
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started