// Exercise BB4c, chip-level version: the chips and wires of schematic 2 and
// of the breadboard.  Same ports as mux_2_triple.sv.
//
// Generated by tools/bb_lib.py from the checked breadboard wire list;
// change the layout in tools/bb_bb4.py, not this file.  Synthesizable.

module mux_2_triple_chips
(
    input  logic [2:0] x_ch,
    input  logic [2:0] y_ch,
    input  logic [2:0] sel,
    input  logic       inh,
    output logic [2:0] com
);



    //------------------------------------------------------------------------

    // U1: CD4053 triple 2-channel analog multiplexer, pin 1 in column 8

    cd4053 i_u1
    (
        .by    ( y_ch [1] ),  // Pin 1 <- BY wire, at GND on the breadboard
        .bx    ( x_ch [1] ),  // Pin 2 <- BX wire, at +5V on the breadboard
        .cy    ( y_ch [2] ),  // Pin 3 <- CY wire, at +5V on the breadboard
        .c_com ( com [2]  ),  // Pin 4 -> C COM
        .cx    ( x_ch [2] ),  // Pin 5 <- CX wire, at GND on the breadboard
        .inh   ( inh      ),  // Pin 6 <- button INH
        .c     ( sel [2]  ),  // Pin 9 <- button C
        .b     ( sel [1]  ),  // Pin 10 <- button B
        .a     ( sel [0]  ),  // Pin 11 <- button A
        .ax    ( x_ch [0] ),  // Pin 12 <- AX wire, at GND on the breadboard
        .ay    ( y_ch [0] ),  // Pin 13 <- AY wire, at +5V on the breadboard
        .a_com ( com [0]  ),  // Pin 14 -> A COM
        .b_com ( com [1]  )   // Pin 15 -> B COM
    );

endmodule
