verilog-apple-one/rtl/rom_basic.v
2018-01-28 20:18:56 +01:00

18 lines
300 B
Verilog

module rom_basic(
input clk,
input [11:0] address,
output reg [7:0] dout
);
parameter ROM_FILENAME = "../roms/basic.hex";
reg [11:0] rom[0:4095];
initial
$readmemh(ROM_FILENAME, rom, 0, 4095);
always @(posedge clk)
dout <= rom[address];
endmodule