Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module shiftA(q,clock,d);
  2. output [1:0] q;
  3. input clock,d;
  4.  
  5. reg [1:0] q;
  6.  
  7. always @(posedge clock)
  8. begin
  9.     q[0]=d;
  10.     q[1]=q[0];
  11. end
  12. endmodule
  13.  
  14. module shiftB(q,clock,d);
  15. output [1:0] q;
  16. input clock,d;
  17.  
  18. reg [1:0] q;
  19.  
  20. always @(posedge clock)
  21. begin
  22.     q[0]<=d;
  23.     q[1]<=q[0];
  24. end
  25. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement