-
Notifications
You must be signed in to change notification settings - Fork 0
/
PC.v
46 lines (41 loc) · 907 Bytes
/
PC.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2023/01/20 11:11:14
// Design Name:
// Module Name: PC
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module PC(
input clk,
input reset_n,
input PCWrite,
input [19:0] nextPC,
output reg [19:0] IF_PC
);
always @ (posedge clk or negedge reset_n) begin
if (!reset_n) begin
IF_PC <= 0;
end
else begin
if (PCWrite) begin
IF_PC <= nextPC;
end
else begin
IF_PC <= IF_PC;
end
end
end
endmodule