asked 93.1k views
3 votes
The future is here. We can now buy miniature tacos from a vending machine, and they only cost $.15. Design a controller for this vending machine under these specifications:

Only one type of taco is available (no user choice)
Only nickels ($.05) and dimes ($.10) are accepted
Only one coin can be entered at a time
Use a Mealy design, with J-K flip-flops
If the user pays extra, add that as credit for the next purchase (e.g. two dimes would provide one taco and $.05 in memory)
Go through all five steps of the finite state machine design algorithm:
1. State diagram
2. Transition table (for J-K flip-flop)
3. Next-state table
4. Derive Boolean equations (make these simple by taking advantage of don’t care conditions)
5. Implement and test circuit (do this twice: once with LogicWorks chip schematics and once on the breadboard)
Do not forget to include the strobed D flip-flop at the output. Do you need a Not gate on its clock input? It depends on the edge behavior of your state memory (J-K flip-flops) and output signal (D flip-flop). They need to change half a clock cycle apart. Are the lab ICs positive- or negative-edge triggered?

asked
User Alpay
by
8.1k points

1 Answer

2 votes

Final answer:

The process of designing a controller for a vending machine with given specifications using a Mealy design with J-K flip-flops is explained step by step. This includes creating a state diagram, transition table, next-state table, deriving Boolean equations, and implementing and testing the circuit. It also addresses the requirement for a Not gate on the clock input of the strobed D flip-flop based on the edge behavior of the state memory and output signal.

Step-by-step explanation:

Step 1: State Diagram

In this vending machine design, we have the following states:

  • S0: Idle state
  • S1: Waiting for a nickel
  • S2: Waiting for a dime
  • S3: Dispensing taco and change

The state diagram would look like:

Step 2: Transition Table

To design the transition table, we need to determine the next state based on the current state and input. In this case, the inputs are 'nickel' and 'dime'. The transition table would look like:

Current StateInputNext StateS0nickelS1S0dimeS2S1nickelS2S1dimeS3S2nickelS1S2dimeS3S3nickelS3S3dimeS3

Step 3: Next-State Table

In this step, we determine the next state outputs based on the current state and input. The next-state table would look like:

Current StateInputNext StateOutputS0nickelS1No outputS0dimeS2No outputS1nickelS2No outputS1dimeS3No outputS2nickelS1No outputS2dimeS3No outputS3nickelS3Dispense taco and changeS3dimeS3Dispense taco and change

Step 4: Derive Boolean equations

From the next-state table, we can derive Boolean equations for each flip-flop. Let's assume Q0, Q1, and Q2 are the outputs of J-K flip-flops connected to S0, S1, and S2 states respectively. The Boolean equations would be:

  • J0 = Q1' + Q2
  • K0 = Q0
  • J1 = Q0' + Q2
  • K1 = Q1
  • J2 = Q0' + Q1'
  • K2 = Q2

Step 5: Implement and test circuit

Implement the circuit using LogicWorks chip schematics or on a breadboard according to the derived Boolean equations and the given specifications. Test the circuit to ensure it functions correctly.

Regarding the Not gate on the clock input of the strobed D flip-flop, it depends on the edge behavior of the state memory and output signal. If they are positive-edge triggered, you will need a Not gate on the clock input. If they are negative-edge triggered, a Not gate is not required.

answered
User MNY
by
8.5k points