Question: Your Memory Components will have the following interfaces / / The address bus is large enough that each module can contain a local address decode.

Your Memory Components will have the following interfaces
// The address bus is large enough that each module can contain a local address decode. This will save on multiple enables.
// for now have each module dedicated to an address line. A more generic solution would be to decode the upper bits and have a specific range. Use all 4 address bits [15:12] in decode.
// bits 15:12 are used to memory map each peripheral
//0= main memory
//1= Instruction memory
//2= Matrix ALU
//3= Integer ALU
//4= Internal Register
//5= execution engine
// bit 11-0 are for addressing inside each unit.
// nWrite =0 means databus is being written into on the falling edge of write
// nRead =0 means it is expected to drive the databus while this signal is low and the address is correct until the nRead goes high independent of address bus.
module InstructionMemory(Clk, Dataout, address, nRead, nReset);
input logic nRead, nReset, Clk;
input logic [15:0] address;
output logic [255:0] Dataout;
//////////////////////////////////////////
////////// instruction memory parameters. To be loaded into instruction memory at nreset =0;
parameter Instruct1=32'h 01_02_00_01;
//Add the number at memory location 8 to location 9 store in a temporary register ( register 1)
parameter Instruct2=32'h 10_80_08_09;
//Subtract the first matrix from the result in step 1 and store the result somewhere else in memory.
parameter Instruct3=32'h 02_03_03_00;
//Transpose the result from step 1 store in memory
parameter Instruct4=32'h 03_04_01_ff;
//Scale the result in step 3 by the result from step 2 store in a matrix register
parameter Instruct5=32'h 04_05_03_80;
//Multiply the result from step 4 by the result in step 3, store in memory.
parameter Instruct6=32'h 00_06_04_03;
//Multiply memory location 0 to location 1. Store it in memory location 0A
parameter Instruct7=32'h 12_0A_00_01;
//Subtract Memory 01 from memory location 0A and store it in a register
parameter Instruct8=32'h 11_0A_01_81;
//Divide Memory location 0A by the register in step 8 and store it in location B
parameter Instruct9=32'h 13_0B_0A_81;
//STOP
parameter Instruct10=32'h ff_ff_ff_ff;
//////////////////////////////////////////////////////////////////
module MainMemory(Clk, DataOut,DataIn, address, nRead, nWrite, nReset);
input logic nRead, nWrite, nReset, Clk;
input logic [15:0] address;
input logic [255:0] Datain;
output logic [255:0] Dataout;
//////////////////////////
// memory module top module
//
//
module top ();
logic [255:0] InstructDataOut;
logic [255:0] MemDataOut;
logic [255:0] TestDataOut;
logic nRead,nWrite,nReset,Clk;
logic [15:0] address;
InstructionMemory U1(Clk,InstructDataOut, address, nRead,nReset);
MainMemory U2(Clk,MemDataOut,TestDataOut, address, nRead,nWrite, nReset);
TestMem UTest(Clk,nRead,nWrite,nReset,address,TestDataOut, InstructDataOut, MemDataOut);
initial begin //. setup to allow waveforms for edaplayground
$dumpfile("dump.vcd");
$dumpvars(1);
end
endmodule
///////////////////////////////

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!