文件名称:vhdl
介绍说明--下载内容均来自于网络,请自行研究使用
single-port RAM in write-first mode.
module raminfr (clk, we, en, addr, di, do)
input clk
input we
input en
input [4:0] addr
input [3:0] di
output [3:0] do
reg [3:0] RAM [31:0]
reg [4:0] read_addr
always @(posedge clk)
begin
if (en) begin
if (we)
RAM[addr] <= di
read_addr <= addr
end
end
assign do = RAM[read_addr]
endmodule
-single-port RAM in write-first mode.
module raminfr (clk, we, en, addr, di, do)
input clk
input we
input en
input [4:0] addr
input [3:0] di
output [3:0] do
reg [3:0] RAM [31:0]
reg [4:0] read_addr
always @(posedge clk)
begin
if (en) begin
if (we)
RAM[addr] <= di
read_addr <= addr
end
end
assign do = RAM[read_addr]
endmodule
module raminfr (clk, we, en, addr, di, do)
input clk
input we
input en
input [4:0] addr
input [3:0] di
output [3:0] do
reg [3:0] RAM [31:0]
reg [4:0] read_addr
always @(posedge clk)
begin
if (en) begin
if (we)
RAM[addr] <= di
read_addr <= addr
end
end
assign do = RAM[read_addr]
endmodule
-single-port RAM in write-first mode.
module raminfr (clk, we, en, addr, di, do)
input clk
input we
input en
input [4:0] addr
input [3:0] di
output [3:0] do
reg [3:0] RAM [31:0]
reg [4:0] read_addr
always @(posedge clk)
begin
if (en) begin
if (we)
RAM[addr] <= di
read_addr <= addr
end
end
assign do = RAM[read_addr]
endmodule
(系统自动生成,下载前可以参看下载内容)
下载文件列表
New Microsoft Office Word Document (2).docx
New Microsoft Office Word Document.docx
codes.txt
New Text Document.txt
New Microsoft Office Word Document.docx
codes.txt
New Text Document.txt