// Exercise B1: the basic gates AND, OR, XOR and NOT.
//
// Generic version that matches schematic 1: five gates, not tied to any
// chip.  Synthesizable.

module basic_gates
(
    input  logic a,
    input  logic b,

    output logic a_and_b,  // 1 when both inputs are 1
    output logic a_or_b,   // 1 when at least one input is 1
    output logic a_xor_b,  // 1 when the inputs differ
    output logic not_a,    // 1 when a is 0
    output logic not_b     // 1 when b is 0
);

    assign a_and_b = a & b;
    assign a_or_b  = a | b;
    assign a_xor_b = a ^ b;
    assign not_a   = ~ a;
    assign not_b   = ~ b;

endmodule
