【题干】
【代码】
module top_module(
input a,
input b,
output out
);
assign out = a&b;
endmodule
【与或非门等】
module top_module(
input a,
input b,
output [5:0]out
);
assign out[0] = a&b; //与
assign out[1] = a|b; //或
assign out[2] = ~(a&b); //与非
assign out[3] = ~(a|b); //与或
assign out[4] = a ^ b; //异或
assign out[5] = a ~^b; //同或 endmodule