1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00
myhdl/example/manual/ram_1.v

41 lines
440 B
Coq
Raw Normal View History

2008-11-22 22:40:25 +01:00
// File: ram_1.v
2010-07-02 13:24:04 +02:00
// Generated by MyHDL 0.7dev
// Date: Fri Oct 8 21:53:32 2010
2010-07-02 13:24:04 +02:00
2008-11-22 22:40:25 +01:00
`timescale 1ns/10ps
module ram_1 (
dout,
din,
addr,
we,
clk
);
2010-07-02 13:24:04 +02:00
// Ram model
2008-11-22 22:40:25 +01:00
output [7:0] dout;
wire [7:0] dout;
input [7:0] din;
input [6:0] addr;
input we;
input clk;
reg [7:0] mem [0:128-1];
2010-07-02 13:24:04 +02:00
2008-11-22 22:40:25 +01:00
always @(posedge clk) begin: RAM_1_WRITE
if (we) begin
mem[addr] <= din;
end
end
2010-07-02 13:24:04 +02:00
2008-11-22 22:40:25 +01:00
assign dout = mem[addr];
endmodule