The shift register

Simulation
  results