// CD4023B: triple 3-input NAND gate.
//
// Ports in pin order, named as in the datasheet.  The power pins, VSS (7)
// and VDD (14), are left out.  Synthesizable.
//
// Gate J takes two inputs from one side of the chip (pins 1 and 2) and one
// from the other (pin 8).

module cd4023
(
    input  logic a,  // Pin 1
    input  logic b,  // Pin 2
    input  logic d,  // Pin 3
    input  logic e,  // Pin 4
    input  logic f,  // Pin 5
    output logic k,  // Pin 6:  k = ~ (d & e & f)
                     // Pin 7:  VSS
    input  logic c,  // Pin 8
    output logic j,  // Pin 9:  j = ~ (a & b & c)
    output logic l,  // Pin 10: l = ~ (g & h & i)
    input  logic i,  // Pin 11
    input  logic h,  // Pin 12
    input  logic g   // Pin 13
                     // Pin 14: VDD
);

    assign j = ~ (a & b & c);
    assign k = ~ (d & e & f);
    assign l = ~ (g & h & i);

endmodule
