-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcreg.v
41 lines (36 loc) · 872 Bytes
/
pcreg.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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2018/06/14 22:20:53
// Design Name:
// Module Name: pcreg
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module pcreg(
input clk,
input rst,
input ena,
input [31:0] data_in,
output [31:0] data_out
);
reg [31:0] data=32'b0;
always @(posedge clk or posedge rst) begin
if(rst) data<=32'h00400000; //reset key
else begin
if(ena) data<=data_in; //enable ,input
end
end
assign data_out = data;
endmodule