From HDLBits


Build a combinational circuit with four inputs, in[3:0].

There are 3 outputs:

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

To review the AND, OR, and XOR operators, see andgate, norgate, and xnorgate.

See also: Even wider gates.

Module Declaration

module top_module( 
    input [3:0] in,
    output out_and,
    output out_or,
    output out_xor

Write your solution here

Upload a source file...