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

module shift_register_chips
(
    input  logic       clk,
    input  logic       rst,
    input  logic       d,
    output logic [7:0] q
);



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

    // U1: CD4015 dual 4-stage shift register, serial in, parallel out, pin 1 in column 18

    cd4015 i_u1
    (
        .clock_b ( clk   ),  // Pin 1 <- 555 clock module
        .q4b     ( q [7] ),  // Pin 2 -> Q8
        .q3a     ( q [2] ),  // Pin 3 -> Q3
        .q2a     ( q [1] ),  // Pin 4 -> Q2
        .q1a     ( q [0] ),  // Pin 5 -> Q1
        .reset_a ( rst   ),  // Pin 6 <- reset button
        .data_a  ( d     ),  // Pin 7 <- button D
        .clock_a ( clk   ),  // Pin 9 <- 555 clock module
        .q4a     ( q [3] ),  // Pin 10 -> Q4
        .q3b     ( q [6] ),  // Pin 11 -> Q7
        .q2b     ( q [5] ),  // Pin 12 -> Q6
        .q1b     ( q [4] ),  // Pin 13 -> Q5
        .reset_b ( rst   ),  // Pin 14 <- reset button
        .data_b  ( q [3] )   // Pin 15 <- U1 pin 10 (Q4A)
    );

endmodule
