Implement a 3-bit counter that counts in two different orders. Your circuit should have a Button named CLK, a Button named RESET, and an input pin named Gray (for Gray code). It should have 3 LED displays, named L0, L1, and L2. The first thing the Test option does it ensure you have the correct inputs and outputs. The inputs and outputs are identical to those for the previous 3-bit counter except for the addition of the extra pin named Gray. The names are case sensitive.
When G is false, the counter is an up counter, counting in steps of 1. Each clock pulse increases the count by one: 0, 1, 2, 3, 4, 5, 6, 7, 0, etc.
When G is true, the counter is a gray code counter counting in gray code order: 0, 1, 3, 2, 6, 7, 5, 4, then back to 0. In binary, that is (000, 001, 011, 010, 110, 111, 101, 100, then back to 000).
Example: Suppose the current output is 101. If G=1, the value after the next clock will be the next value in the gray code sequence, 100. If G=0, the value after the next clock will be the next value sequentially, 110.
Draw the Karnaugh map and truth table and complete the circuit diagram using D flip-flop SR