本专栏的目的是分享可以通过HDLBits仿真的Verilog代码 以提供参考 各位可同时参考我的代码和官方题解代码 或许会有所收益
题目链接:
Gates4 - HDLBits
module top_module(
input [3:0] in,
output out_and,
output out_or,
output out_xor
);
assign out_and = in[0] & in[1] & in[2] & in[3] ;
assign out_or = in[0] | in[1] | in[2] | in[3] ;
assign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3] ;
endmodule