hdlbits-Gates100

Gates100

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.

Hint

The reduction operators will be useful here.

solution

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

hdlbits-Gates100
http://456-xiao.github.io/2024/08/25/hdlbits-Gates100/
作者
xyh
发布于
2024年8月25日
许可协议