Using the FSM to compute the result, add the overflow logic