// Exercise BB4a, chip-level version: the chips and wires of schematic 2 and
// of the breadboard.  Same ports as mux_8.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_8_chips
(
    input  logic [7:0] ch,
    input  logic [2:0] sel,
    input  logic       inh,
    output logic       com
);



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

    // U1: CD4051 8-channel analog multiplexer, pin 1 in column 10

    cd4051 i_u1
    (
        .ch4 ( ch [4]  ),  // Pin 1 <- CH4 wire, at GND on the breadboard
        .ch6 ( ch [6]  ),  // Pin 2 <- CH6 wire, at +5V on the breadboard
        .com ( com     ),  // Pin 3 -> COM
        .ch7 ( ch [7]  ),  // Pin 4 <- CH7 wire, at GND on the breadboard
        .ch5 ( ch [5]  ),  // Pin 5 <- CH5 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
        .ch3 ( ch [3]  ),  // Pin 12 <- CH3 wire, at +5V on the breadboard
        .ch0 ( ch [0]  ),  // Pin 13 <- CH0 wire, at +5V on the breadboard
        .ch1 ( ch [1]  ),  // Pin 14 <- CH1 wire, at GND on the breadboard
        .ch2 ( ch [2]  )   // Pin 15 <- CH2 wire, at +5V on the breadboard
    );

endmodule
