流水线CPU的Verilog代码.rar

源代码在线查看: instruction_memory.v

软件大小: 17 K
上传用户: yhb71181491615
关键词: Verilog CPU 流水线
下载地址: 免注册下载 普通下载 VIP

相关代码

				module instruction_memory(clk, instruction, addr, read, enable); //it's a rom, output 4 sequential bytes beginning at address of addr
					input clk;
					input[31:0] addr;
					input read, enable;
					output reg [31:0] instruction;
					reg [7:0] memory[8'b11111111-1:0];
					
					initial
					   begin
					       {memory[3],memory[2],memory[1],memory[0]} = 32'b00000010010100111000100000100000;  //the instruction means: add $17, $18, $19 #$17 = $ 18 + $19
					   end
					
					always @(posedge clk)
						begin
							instruction[7:0] 							instruction[15:8] 							instruction[23:16] 							instruction[31:24] 						end
					
				endmodule			

相关资源