initial
This commit is contained in:
19
chapter4/pc.v
Normal file
19
chapter4/pc.v
Normal file
@@ -0,0 +1,19 @@
|
||||
module pc (
|
||||
input rst,
|
||||
input clk,
|
||||
output reg [31:0] pc,
|
||||
output reg [31:0] next_pc
|
||||
);
|
||||
|
||||
|
||||
always @(posedge clk) begin
|
||||
if(rst) begin
|
||||
pc <= 0;
|
||||
end
|
||||
else begin
|
||||
next_pc <= pc;
|
||||
pc <= pc + 1;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
Reference in New Issue
Block a user