Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. module AND(x,y,z);
  2. input x,y;
  3. output z;
  4. reg z;
  5.  
  6. always @(x,y,z) begin
  7. z = x & y;
  8. end
  9. endmodule
  10.  
  11. module NAND(x,y,z);
  12. input x,y;
  13. output z;
  14. reg z;
  15.  
  16. always @(x,y,z) begin
  17. z = !(x & y);
  18. end
  19. endmodule
  20.  
  21. module SHIFT_LEFT(shift, in, out);
  22. input[4:0] shift;
  23. input[15:0] in;
  24. output[15:0] out;
  25. reg[15:0] out;
  26.  
  27. always @(shift, in, out) begin
  28. out = in << shift;
  29. end
  30. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement