19Counters Divide-by-8 Counter Behavioral Counter in Verilog Counter using One-Hot State Machine
20One-Hot State Machines Q0Q1Q2D0D1D2Instead of using the minimum number of flip-flops (3) to implement the state machine, one-hot encoding uses one flip-flop per state (8) to implement the state machine.
21Why use One-Hot State Machines? Using one-hot encoding or one flip-flop per state (8) will normally simplify the combinational logic at the expense of more flip-flops.Let's see how for the 3-bit counter
22One-Hot Encoding Think of each state as a flip-flop s0 0 0 0 s1 Present state Next stateState Q2 Q1 Q D[0:7]Think of each state as a flip-flops s1s s2s s3s s4s s5s s6s s7s s0D[i] = s[i-1]This is just a ring counter!