I thought before that the hot-one encoding for FSM was used to decrease the critical path of the combinational logic and hence increase the design speed but I tried a FSM once with binary encoding and once with hot-one encoding and the hot-one encoding was worse in terms of both speed and area . Can somebody explain to me please ?
One-hot should be better for speed at the cost of area - one flip-flop for each state. Some basic state diagrams will perform better as binary-encoded machine - a simple counter.
I thought before that the hot-one encoding for FSM was used to decrease the critical path of the combinational logic and hence increase the design speed but I tried a FSM once with binary encoding and once with hot-one encoding and the hot-one encoding was worse in terms of both speed and area . Can somebody explain to me please ?
Like a lot of design implementation options, the real answer is 'it depends'. In this case, it depends on the specific state machine logic. Generally speaking one-hot will take a bit more area because but be faster because the critical path is typically shorter. However, this is not guaranteed behavior, it's not uncommon for the exact opposite to occur. Also, since these metrics are a function of what the logic of the FSM is, changes to that logic might cause the metrics to flip as well (i.e. for your FSM, down the road if the logic changes, you might find one-hot to be better)