help with a sequence using gate?


    Jun 27 2013 | 8:52 pm
    Hi,
    I would like to rotate 0s and 1s like so (counting from 0 to 15)
    e.g.
    1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
    etc.
    However, my code messes up on the last digit. Im also using 2 gates and think its a bit messy. Would be very grateful if anyone has any ideas how to fix the last digit (when it gets to 15) and also if there are any cleaner ways of doing it.
    Cheers

    • Jun 27 2013 | 9:31 pm
      No worries I figured how to do it with ifs and pack,
      cheers
    • Jun 27 2013 | 10:12 pm
      this may also work with what you wanted.
    • Jun 27 2013 | 10:41 pm
      zl.rot pretty much does this.