-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPC.v
More file actions
41 lines (37 loc) · 871 Bytes
/
Copy pathPC.v
File metadata and controls
41 lines (37 loc) · 871 Bytes
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: 22:59:33 06/03/2018
// Design Name:
// Module Name: PC
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module PC(rst, inc, clk, to_PC, from_IR, out
);
input rst, inc, to_PC, clk;
input [7:0] from_IR;
output [7:0] out;
reg [7:0] data=8'b0;
always @ (negedge clk)
if (rst)
data <= 8'b0;
else if (to_PC)
data <= from_IR;
else if (inc)
data <= data + 1; // Incrementing FF will result in 0
else
data <= data;
assign out=data;
endmodule