// Exercise B3a: the quad 2-input gate chips 4001 (NOR), 4011 (NAND) and
// 4077 (XNOR), one gate of each.
//
// Generic version that matches schematic 1: three gates on the same two
// inputs, not tied to any chip.  Synthesizable.

module gates_2_input
(
    input  logic a,
    input  logic b,

    output logic y_nor,   // 1 only when both inputs are 0
    output logic y_nand,  // 0 only when both inputs are 1
    output logic y_xnor   // 1 when the inputs are equal
);

    assign y_nor  = ~ (a | b);
    assign y_nand = ~ (a & b);
    assign y_xnor = ~ (a ^ b);

endmodule
