Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. module TripleInputNand01(sw,led);
  2. input [8:0] sw; // "[8:0]" means bus. The sw[0] to sw[2] is for input0. The sw[3] to sw[5] is for input1. The sw[6] to sw[8] is for input2.
  3. output [2:0] led; // From led[0] to led[2] is defined.
  4. wire w_and,w_or,w_not,w_xor; // To define the wire for inner crossline.
  5.  
  6. // "assign" is "WARIATERU" in Japanese.
  7. assign led[0]=sw[0] & sw[1] & sw[2]; // & means AND.
  8. assign led[1]=sw[3] & sw[4] & sw[5];
  9. assign led[2]=sw[6] & sw[7] & sw[8];
  10.  
  11. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement