⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readmemh.v

📁 一些自己编写的verilog代码
💻 V
字号:
// Illustrates how to initialize a memory array from data
// stored as hexadecimal values in a data file
//
// Simulate this file directly to see the results
//
// Note: The data file must reside in the same directory
// as the .v file for the module

module readmemh_demo;

// Declare memory array that is twelve words of 32-bits each
reg [31:0] Mem [0:11];

// Fill the memory with values taken from a data file
initial $readmemh("data.txt",Mem);

// Display the contents of memory
integer k;
initial begin
	$display("Contents of Mem after reading data file:");
	for (k=0; k<12; k=k+1) $display("%d:%h",k,Mem[k]);
end

endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -