Question: In a classic problem, a farmer, a fox, a chicken and a sack of corn are on the left bank of a river. There is
In a classic problem, a farmer, a fox, a chicken and a sack of corn are on the left bank of a river. There is a small boat that will hold the farmer and at most one of the other three. Using as many trips as needed, the farmer must transfer the other three and himself to the right bank of the river. However, if he leaves the fox and chicken on one bank of the river while he is on the other bank, the fox will eat the chicken. Likewise, if he is on one bank and the chicken and corn are on the other bank, the chicken will cat the corn. Design a finite state machine using combinatorial logic to simulate this situation. Each state value has four bits A, B, C, D representing the farmer, fox, chicken and corn, respectively. Each bit is o if its item is on the left bank and 1 if it is on the right bank. Two input bits, YZ, encode the action YZ Action Farmer crosses the river alone Farmer crosses the river with the fox 01 Farmer crosses the river with the chicken 10 Farmer crosses the river with the corn There are two outputs. Output L is set to 1 whenever the fox eats the chicken or the chicken eats the corn. Output W is set to 1 when all four reach the right bank of the river. Otherwise the outputs are zero. When either L-1 or W the machine resets to the state 0000 on the next clock cycle. Unused states are "Don't Cares". Only show equations do not draw circuit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
