regzarr

reg

Oct 31st, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module rgst # (
  2.   parameter w = 8,
  3.   parameter iv = { w { 1'b0} } )
  4.   ( input [w-1 : 0] d,
  5.     input clk, rst_b, clr, ld,
  6.     output reg [w-1 : 0] q );
  7.    
  8. always @ (posedge clk, negedge rst_b) begin
  9.   if (!rst_b || clr)
  10.     q <= iv;
  11.   else if (ld)
  12.     q <= d;
  13.   end
  14. endmodule
Add Comment
Please, Sign In to add comment