Advertisement
kekellner

PC.v

Nov 15th, 2024
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module PC (
  2.     input clock,
  3.     input reset,
  4.     input load,
  5.     input [6:0] loadValue,
  6.     output reg [6:0] count
  7. );
  8.  
  9.     reg delay;
  10.  
  11.     always @(posedge clock, posedge reset) begin
  12.         if (reset) begin
  13.             count <= 7'b0;
  14.             delay <= 0;
  15.         end else if (delay) begin
  16.             count <= count + 1;
  17.             delay <= 0;
  18.         end else if (load) begin
  19.             count <= loadValue;
  20.             delay <= 1;
  21.         end else count <= count + 1;
  22.     end
  23. endmodule
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement