HDL-Bits Solution: Gates100

This problem requires creating a combinational circuit with 100 inputs and three outputs: AND, OR, and XOR.

In this implementation, reduction operators are used to combine all 100 bits. The & operator performs a 100-input AND, | performs a 100-input OR, and ^ performs a 100-input XOR. Each result is directly assigned to its corresponding output.

 

Here is my code for this quiz.

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

Reference: https://hdlbits.01xz.net/wiki/Gates100

Leave a Reply

Your email address will not be published. Required fields are marked *