RISC-V_Verilog/rtl/program_counter.v

13 lines
337 B
Coq
Raw Normal View History

2023-10-23 05:15:21 +00:00
module program_counter (input clock, reset,
input [31:0] new_addr,
2023-10-23 05:15:21 +00:00
output reg [31:0] pc_addr);
2023-10-22 13:41:39 +00:00
always @ (posedge clock, posedge reset) begin
if (reset == 1'b1)
2023-10-23 02:24:09 +00:00
pc_addr <= 32'b0;
else
pc_addr <= new_addr;
end
endmodule