-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPC.sv
39 lines (37 loc) · 978 Bytes
/
PC.sv
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 08/01/2024 09:23:10 AM
// Design Name:
// Module Name: PC
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module PC(
input PC_RST,
input PC_WE,
input [31:0] PC_DIN,
input CLK,
output logic[31:0] PC_COUNT
);
always_ff @(posedge CLK) begin
if(PC_RST) begin //PC_Rst resets count to 0
PC_COUNT<=0;
end else if(PC_WE) begin //otherwise move to next instruction specified by mux
PC_COUNT<=PC_DIN;
end else begin
PC_COUNT<=PC_COUNT; //if write not enabled, and not reseting stay at same instruction
end
end
endmodule