1. Design a counter that can count either in mod-8 pure binary or in mod-8 Gray code, depending on a control signal being 1 or 0, respectively.
2. Implement a self-correcting counter that repeatedly generates the sequence 001, 110, 101, 010, 011. Use D flip-flops as memory elements.