A ring (Johnson) counter would do what you ask, I
think.
You can look at "pulse swallowing" too, if you're up
against the technology's speed limits (see this on
PLL prescalers, like a 4/5 prescaler front end where
no way will you get 6GHz through a complex inter-
stage carry logic).
Getting initialization (or better yet, "self-righting"
count behavior is a chore for you. Get your mind
right, about what indicates proper phase and then
you can implement it logically. There may be in fact
no difference between "0" and "180" as far as the
circuit's function goes, but such ambiguity does
pose a real headache for test development and
production test execution. You may need to have
a reset (POR?) just to make things consistent enough
to test repeatably, even if there is no application
purpose or benefit (and it's sure to add an increment
of slowness, by making nand2 into nand3 somewhere).