reduction:even wider gates

Build a combinational circuit with 100 inputs, in[99:0].

There are 3 outputs:

out_and: output of a 100-input AND gate.
out_or: output of a 100-input OR gate.
out_xor: output of a 100-input XOR gate.

Gates100 - HDLBits (01xz.net)

 1 module top_module( 
 2     input [99:0] in,
 3     output out_and,
 4     output out_or,
 5     output out_xor 
 6 );
 7     assign out_and=&in[99:0];
 8     assign out_or=|in[99:0];
 9     assign out_xor=^in[99:0];
10 endmodule

 

posted @ 2023-04-20 10:44  江左子固  阅读(9)  评论(0)    收藏  举报