Solve the following problem:
Consider a device with two control inputs k1 and k2 specified as follows
If K1k1 = 00, it works as a Gray code up-counter,
If k1k2 = 01, it works as a Gray code down-counter,
If k1k2 = 10, it works as a Gray code counter by two,
If k1k2 = 11, counter hold his present state.
Figure shows the state diagram for this machine. Determine the state table and the minimized next state functions.