-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPC.v
43 lines (39 loc) · 867 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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2023/05/05 16:03:07
// 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 rst,
input ena,
input [31:0]pc_in,
output reg [31:0]pc_next//新的pc
);
//使用下降沿,确保原先的pc先给出去
always @(negedge clk or posedge rst) begin
if(rst)begin
pc_next<=32'h0040_0000;
end
else begin
if(ena)begin
pc_next<=pc_in;
end
end
end
endmodule