Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2003/functional-programming-data-structures-and-algorithms-procedural-programming-and-digital-hardware/9/c/solution

The finite-state machine retains its state on input 00 or 11, moves to Lt on 01, and moves to Gt on 10. Here each input label is the pair ab, not a pair of outputs. The following state-transition diagram shows every valid-state transition; a diagonal input is stronger than all previous comparison history because it arrives at a more significant position.
Figure 1.
Least-significant-first comparator transitions and Karnaugh maps
. Details.
Equivalently the complete transition rule is
The state-transition diagram starts at Eq, representing the comparison of two empty, hence zero-valued, bit strings.

New to topics? Read the docs here!