manipulation on clock output
I think what you're asking is for a method to build an reversible/bidirectional circular/ring shift-register. 

The main concept behind the shift-register is to shift all bits in a direction. You may accomplish it by using some flip-flops as here:



You may see that the data in is shifted to the right each time the clock ticks. The main concept is that the flip-flop keeps its status while the clock is down and transfers it to its output when the clock is up. In order to make it reversible you need to insert some digital circuitry that choose if the input (D) of the flip-flop will be: 1) the output of the flip-flop before itself or 2) the output of the flip-flop after itself.

One example of bidirectional shift register is presented in this site

http://eelab.usyd.edu.au/digital_tutorial/part2/register06.html


In order to make any shift-register circular you just need to connect the output wire to the input.

If the pattern to be shifted needs to be pre-set to an specif value you may act in the R/S lines, resetting or setting each flip flop to the desired value.