Take a look at the datasheet for the 74HC595 IC. It is a serial-in/parallel-out 8-bit shift register. The timing diagram will help you understand how you need to interface to the device. The shift register also has a serial output. The serial output of the first shift register is daisy-chained into the serial input of the second shift register.