Advertisement
kekellner

instr_reg.v

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