instruction_memory.v

来自「Use the verilog language write a MIPS CP」· Verilog 代码 · 共 19 行

V
19
字号
//=============================================================================
//Instruction memory Module: Memory size is 167 words of 8 bits ( 1 bite ) each
//	input [31:0] Read_address;
//	output [31:0] instruction;
//=============================================================================

module Instruction_memory( Read_address, instruction );
	input [31:0] Read_address;	//read address
	output [31:0] instruction;	//read data
	reg [31:0] instruction;
	reg [7:0] Mem [0:169];	//167 * 8 memory

	always @( Read_address )	
		begin
			instruction[31:0] = {Mem[Read_address+3],Mem[Read_address+2],Mem[Read_address+1],Mem[Read_address]};
		end
endmodule

⌨️ 快捷键说明

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