Advertisement
Guest User

Untitled

a guest
Feb 27th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. module test(
  2. input wire d,
  3. output reg q,
  4. input wire clk,
  5. input wire rst
  6. );
  7.  
  8. always @(posedge clk or posedge rst)
  9. begin
  10. if (rst)
  11. q <= 1'b0;
  12. else
  13. case (d)
  14. 1'b0: q<= 1'b0;
  15. 1'b1: q<= 1'b1;
  16. default: q <= 1'b0;
  17. endcase
  18. end
  19.  
  20. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement