summaryrefslogtreecommitdiff
path: root/verilog/pc.v
blob: a7c6b6d9c06f7159aa2ede9714c26fa22edfd9aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
`default_nettype none
`timescale 1ns/1ps

module pc
(
	input wire we, clk, rst,
	input wire [31:0] pc_new,
	output reg [31:0] pc
);

always @ (posedge clk or posedge rst) begin
	if (rst) begin
		pc <= 0;
	end
	else if (we) begin
		pc <= pc_new;
	end
end

endmodule