Added ROM file from MIPS Architecture Slide Part 1
This commit is contained in:
1 parent
179eb469c4
commit
3145dd6a21
1 file changed
+15
@@ -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
|
||||||
Reference in new issue
Block a user