Question: write me a code that gives this output / / memory data file ( do not edit the following line - required for mem load

write me a code that gives this output // memory data file (do not edit the following line - required for mem load use)// instance=/DA_VINCI_TB/da_vinci_inst/memory_inst/sram_32x64m // format=hex addressradix=h dataradix=h version=1.0 wordsperline=1 noaddress 00000020000000200000001000000010000000090000000800000008000000050000000400000002// memory data file (do not edit the following line - required for mem load use)// instance=/DA_VINCI_TB/da_vinci_inst/memory_inst/sram_32x64m // format=hex addressradix=h dataradix=h version=1.0 wordsperline=1 noaddress 000000010000000400000004000000100000001000000000// memory data file (do not edit the following line - required for mem load use)// instance=/DA_VINCI_TB/da_vinci_inst/memory_inst/sram_32x64m // format=hex addressradix=h dataradix=h version=1.0 wordsperline=1 noaddress 000000000000002000000008000000080000000200000002// memory data file (do not edit the following line - required for mem load use)// instance=/DA_VINCI_TB/da_vinci_inst/memory_inst/sram_32x64m // format=hex addressradix=h dataradix=h version=1.0 wordsperline=1 noaddress 0000001500000017000000190000001b 0000001d 0000001f 0000002100000023000000250000002500000000// memory data file (do not edit the following line - required for mem load use)// instance=/DA_VINCI_TB/da_vinci_inst/memory_inst/sram_32x64m // format=hex addressradix=h dataradix=h version=1.0 wordsperline=1 noaddress 000000000000000100000001000000020000000300000005000000080000000d 0000001500000022000000370000005900000090000000e90000017900000262// memory data file (do not edit the following line - required for mem load use)// instance=/DA_VINCI_TB/da_vinci_inst/memory_inst/sram_32x64m // format=hex addressradix=h dataradix=h version=1.0 wordsperline=1 noaddress ffffffc900000022 ffffffeb 0000000d fffffff800000005 fffffffd 00000002 ffffffff 00000001000000000000000100000001000000020000000300000005
`include "prj_definition.v"
module CONTROL_UNIT(MEM_DATA, RF_DATA_W, RF_ADDR_W, RF_ADDR_R1, RF_ADDR_R2, RF_READ, RF_WRITE,
ALU_OP1, ALU_OP2, ALU_OPRN, MEM_ADDR, MEM_READ, MEM_WRITE,
RF_DATA_R1, RF_DATA_R2, ALU_RESULT, ZERO, CLK, RST);
// Output signals
// Outputs for register file
output [`DATA_INDEX_LIMIT:0] RF_DATA_W;
output [`ADDRESS_INDEX_LIMIT:0] RF_ADDR_W, RF_ADDR_R1, RF_ADDR_R2;
output RF_READ, RF_WRITE;
// Outputs for ALU
output [`DATA_INDEX_LIMIT:0] ALU_OP1, ALU_OP2;
output [`ALU_OPRN_INDEX_LIMIT:0] ALU_OPRN;
// Outputs for memory
output [`ADDRESS_INDEX_LIMIT:0] MEM_ADDR;
output MEM_READ, MEM_WRITE;
// Input signals
input [`DATA_INDEX_LIMIT:0] RF_DATA_R1, RF_DATA_R2, ALU_RESULT;
input ZERO, CLK, RST;
// Inout signal
inout [`DATA_INDEX_LIMIT:0] MEM_DATA;
// State nets
wire [2:0] proc_state;
PROC_SM state_machine(.STATE(proc_state),.CLK(CLK),.RST(RST));
always @ (proc_state)
begin
// TBD: Code for the control unit model
end
task print_instruction;
input [`DATA_INDEX_LIMIT:0] inst;
reg [5:0] opcode;
reg [4:0] rs;
reg [4:0] rt;
reg [4:0] rd;
reg [4:0] shamt;
reg [5:0] funct;
reg [15:0] immediate;
reg [25:0] address;
begin
// parse the instruction
// R-type
{opcode, rs, rt, rd, shamt, funct}= inst;
// I-type
{opcode, rs, rt, immediate }= inst;
// J-type
{opcode, address}= inst;
$write("@ %6dns ->[0X%08h]", $time, inst);
case(opcode)
// R-Type
6'h00 : begin
case(funct)
6'h20: $write("add r%02d, r%02d, r%02d;", rd, rs, rt);
6'h22: $write("sub r%02d, r%02d, r%02d;", rd, rs, rt);
6'h2c: $write("mul r%02d, r%02d, r%02d;", rd, rs, rt);
6'h24: $write("and r%02d, r%02d, r%02d;", rd, rs, rt);
6'h25: $write("or r%02d, r%02d, r%02d;", rd, rs, rt);
6'h27: $write("nor r%02d, r%02d, r%02d;", rd, rs, rt);
6'h2a: $write("slt r%02d, r%02d, r%02d;", rd, rs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!