From 3145dd6a216ff0a6e3d9160dbc0e970507260c5c Mon Sep 17 00:00:00 2001 From: TroubleElectrical Date: Tue, 6 Oct 2026 16:03:03 +1100 Subject: [PATCH] Added ROM file from MIPS Architecture Slide Part 1 --- modules/rom.sv | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 modules/rom.sv diff --git a/modules/rom.sv b/modules/rom.sv new file mode 100644 index 0000000..d04f726 --- /dev/null +++ b/modules/rom.sv @@ -0,0 +1,15 @@ + +module ROM #(parameter m=7,p=4) ( + input logic [m-1:0] Ad, + output logic [p-1:0] Dout + ); + + logic [p-1:0] mem[2**m-1:0]; + assign Dout = mem[Ad]; + + //Load the program in memory + // The machine code stored in text file program.dat written in Hex format + initial begin + $readmemh("program.dat",mem); //$readmemb for binary + end +endmodule // end ROM module