Answered step by step
Verified Expert Solution
Link Copied!

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:
Add/subtract immediate (addi/subi) The datapath changes are the same for these two new
operations, so we will discuss them together. The normal add/sub 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 (i.e., 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 register-based 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 2. That is,
MUX Previously, the second 4-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 4-bit 2-to-1 MUX
(mux_2_to_1.v) 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 16-bit or 32-bit.1 Through
this MUX, DataOut from the RF is connected to the second operand of Adder if Iout is 0. On
the other hand, when Iout is 1, Imm is the second operand that Adder gets.
Latch DP For the display latch, you can reuse the latch code (A.v) that was used for latch A
and latch G in Lab 2. 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 2, we used a 2-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 3-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 3-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 l3_SM.v):
3b000: load
3b001: move
3b010: subtract
3b011: add
3b100: display
3b101: (reserved, i.e., not used for now)
3b110: subi
3b111: addi
With this extended opcode, we have an 11-bit instruction format for this datapath as illustrated below:
II. PRE-LAB
(i) Based on the updated block diagram (Figure 2) and instruction format (Figure 3) which show
the datapath support for the new operations, properly modify the module interface of l3_SM.v

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Should valuable lease options of lessees be capitalized?

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago