Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module TripleInputNand01(sw,led);
- 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.
- output [2:0] led; // From led[0] to led[2] is defined.
- wire w_and,w_or,w_not,w_xor; // To define the wire for inner crossline.
- // "assign" is "WARIATERU" in Japanese.
- assign led[0]=sw[0] & sw[1] & sw[2]; // & means AND.
- assign led[1]=sw[3] & sw[4] & sw[5];
- assign led[2]=sw[6] & sw[7] & sw[8];
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement