// Exercise B3b: the triple 3-input gate chips 4023 (NAND), 4025 (NOR),
// 4073 (AND) and 4075 (OR), one gate of each.
//
// Generic version that matches schematic 1: four gates on the same three
// inputs, not tied to any chip.  Synthesizable.

module gates_3_input
(
    input  logic a,
    input  logic b,
    input  logic c,

    output logic y_nand,  // 0 only when all three inputs are 1
    output logic y_nor,   // 1 only when all three inputs are 0
    output logic y_and,   // 1 only when all three inputs are 1
    output logic y_or     // 0 only when all three inputs are 0
);

    assign y_nand = ~ (a & b & c);
    assign y_nor  = ~ (a | b | c);
    assign y_and  =    a & b & c;
    assign y_or   =    a | b | c;

endmodule
