2023-10-23 05:15:21 +00:00
|
|
|
module program_counter (input clock, reset,
|
2023-12-04 02:34:39 +00:00
|
|
|
input [31:0] new_addr,
|
2023-10-23 05:15:21 +00:00
|
|
|
output reg [31:0] pc_addr);
|
2023-10-20 09:48:18 +00:00
|
|
|
|
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;
|
2023-10-20 09:48:18 +00:00
|
|
|
else
|
2023-12-04 02:34:39 +00:00
|
|
|
pc_addr <= new_addr;
|
2023-10-20 09:48:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
endmodule
|