RISC CPU-程序计数器
module counter ( pc_addr, ir_addr, load, clock, rst);3 output pc_addr;
4 input ir_addr;
5 input load, clock, rst;
6 reg pc_addr;
7
8 always @( posedge clock or posedge rst )
9 begin
10 if(rst)
11 pc_addr<=13'b0_0000_0000_0000;
12 else
13 if(load)
14 pc_addr<=ir_addr;
15 else
16 pc_addr <= pc_addr + 1;
17 end
18 endmodule RISC CPU-程序计数器 RISC CPU-程序计数器
页:
[1]