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

module decoder_chips
(
    input  logic [3:0] code,
    output logic [9:0] q
);



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

    // U1: CD4028 BCD-to-decimal decoder, pin 1 in column 12

    cd4028 i_u1
    (
        .q4 ( q [4]    ),  // Pin 1 -> Q4
        .q2 ( q [2]    ),  // Pin 2 -> Q2
        .q0 ( q [0]    ),  // Pin 3 -> Q0
        .q7 ( q [7]    ),  // Pin 4 -> Q7
        .q9 ( q [9]    ),  // Pin 5 -> Q9
        .q5 ( q [5]    ),  // Pin 6 -> Q5
        .q6 ( q [6]    ),  // Pin 7 -> Q6
        .q8 ( q [8]    ),  // Pin 9 -> Q8
        .a  ( code [0] ),  // Pin 10 <- button A
        .d  ( code [3] ),  // Pin 11 <- button D
        .c  ( code [2] ),  // Pin 12 <- button C
        .b  ( code [1] ),  // Pin 13 <- button B
        .q1 ( q [1]    ),  // Pin 14 -> Q1
        .q3 ( q [3]    )   // Pin 15 -> Q3
    );

endmodule
