The Result of the Computation Debugging - Engineering Assignment Help

Download Solution Order New Solution
Assignment Task:

Task:

Stage II

The next step is to write a module idexwb_pipe that accepts the following ports, in this order:

 

idexwb_pipe ports

Name

Direction

Type

Width

Comment

res

out

wire

WIDTH

The result of the computation. Needed for debugging

Rdout

out

wire

5

The register that res will be saved in. Needed for debugging

opcode

in

wire

3

 There are four of them but the opcode is three bits wide

Rs1, Rs2

in

wire

5

 The two source registers

Rd

in

wire

5

 The destination register

imm

in

wire

12

 The immediate. Used by the addi


 

As the name implies, this stage does instruction decode, execute and write back. This computer has just four instructions: nopaddmul and addi. The binary opcodes are provided on the top of the file proc.v. This module instantiates about 9 yMux modules to redirect signas an add_pipe to execute add and addi and a mul_pipe to execute mul. It also instantiates an rfile register file to sote and retrieve results. Name the instance of rfile  "regs", othewise the testbench will not work.

Hints

At every clock cycle this module updates register Rdout in rfile. Since it gets an Rdout from the add_pipe and one from mult_pipe it only saves the one that is non zero. When a mul instruction is executed the add_pipe module gets a 5-bit zero as Rdin and the mul_pipe gets Rd. The opposite happens for an add or an addi instruction. When the instruction is mul or add the contents of Rs2 is used as a second input to the respective module, whereas if it is an addi the immediate imm is given as a second input. Submit file proc.v. To test your code use the testbench provided and compile with iverilog -o test testidexwb.v proc.v. Make sure that your program works for at least the testbench provided.

 

 

Stage III

Create a module if_pipe that has the following ports:

if_pipe ports

Port

Direction

Type

Width

Comments

 ins

 out

 reg

 32

 The instruction just fetched.

start, clk, rst

in

wire

1 each

The start, clock and reset

Use module predecode in the file provided to do the decoding. This module handles the ugly details of the instruction formats. In the module if_pipe define an array imem of at least 64 32-bit registers to serve as instruction memory and a WIDTH-bit resgister PC. During the reset the following command should be executed: $readmemb("compmem.dat", imem, 6'd0, 6'd22); to load the memory with data. You have to download compmem.datin the directory you are working so that the testbench can find it.

Hints

To test your code use this testbench. Compile with iverilog -o test testifidexwb.v proc.v. The datafile compmem.dat corresponds to this "assembly" file.

 

This Engineering  Assignment has been solved by our Engineering Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
    

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.