Re: Why Gray and Johnson state encoding avoid metastable sta
The idea is that with that code only 1 bit change each time and so also you're sure that when one change the other still be the same and so you don't have problem about the 2 commutations.
Example
only 4 state = stateA, stateB, stateC, stateD
stateA = "00"
stateB = "01"
stateC = "11"
stateD = "10"
In this example you can see that if the state are coded in that way and you allow only transition by one state to the only one near it only 1 bit change, so if your flip flop of hte state change in 1 clk or in the next you remain in the old state till you go in the new one.
If you code the state as
stateA = "00"
stateB = "01"
stateC = "10"
stateD = "11"
You can see that on the transition from stateB to stateC change 2 bit, but if you've metastability problem on theese flip flop they can change in different time and so you can have that from 01 you go in 11 or 00 and not in the state you wanna.