The Clean Petroleum Company (CPC) is interested in reducing pollution in the atm
ID: 2081745 • Letter: T
Question
The Clean Petroleum Company (CPC) is interested in reducing pollution in the atmosphere. When people overfill their gas tanks gas is spilled and evaporates causing air pollution. To minimize this problem, their pumps currently turn off when the back pressure from the gas tank gets too large while the nozzle handle switch is activated (i.e., compressed). They have asked you to design a controller that does the following: If the nozzle handle switch is depressed and the pump pressure sensor indicates low pressure, then allow gas to be pumped. If the pump pressure sensor indicates high pressure then turn-off the pump. (The system clock pulses every one second and you may assume that once the pump shuts off, the pump pressure returns to normal within one second.) Once the pressure returns to normal, allow the pump to be controlled again by the nozzle handle switch. If the pump pressure sensor indicates high pressure a second time, turn off the pump as your final warning to stop. Once the pressure again returns to normal, allow the pump to be controlled by the nozzle handle switch. When the pump pressure sensor detects high pressure for the third time, your design will permanently shut down the pump, no more gas will be dispense, and the pump must be reset by the gas station personnel. Should your pump shut down due to 3 consecutive pressure detections, a warning light must illuminate at your pump to call the attendant. (Note that there are two inputs to your synchronous machine: the nozzle handle switch position, and the pump pressure sensor indicator. Your synchronous machine also has two outputs that control the pump and alert for the attendant.) All information to complete this design may not be specified. Write down and report any assumptions that you make in your design. Be sure to use debounced "logic switches" for driving the clock input to the flip-flops.Explanation / Answer
The following challenge was presented as part of the Capstone Design Project for a course in Digital Logic Design: assume that a company selling gasoline would like to prevent customers from excessively ‘topping-off’ their gas tanks, thus risking a fire hazard from overflowing and spilled gasoline. To minimize this problem, their pumps currently turn off when the back pressure from the gas tank gets too large while the pump nozzle is activated (i.e., the pump will shut off when the tank is nearly full), but they would now like their pumps to shut down permanently if a customer attempts to pump again after this initial shut off, with a manual reset by gas station personnel required.
The secret to solving such a problem is by designing a finite-state machine (FSM). A state machine is a computational mathematical model frequently used in the design of computer programs and circuits using sequential logic. Because a series of steps are required to carry out the desired outcome, the machine resides in one state at a time; i.e., its current state. A triggering event or condition then causes it to change from its current state to the next state; i.e., a transition. Many modern devices perform predetermined actions depending on a sequence of events, such as vending machines which dispense products when a certain amount of money is inserted, elevators, traffic signals, combination locks, security systems and, in this case, gas pump controllers.
When designing a FSM, first, the various states are defined, with binary values arbitrarily assigned to them. Next, a state transition diagram and state transition table are created. From these, Karnaugh maps are generated and the particular logic functions needed for the circuit derived from them. Finally, the circuit design is created, having been derived from the logic provided in the previous steps–first, in simulation, and then ultimately built and tested using actual hardware. There are two primary types of FSMs: the so-called Mealy FSM and the Moore FSM. The design styles of both have relatives pros and cons. Because of this, both Mealy and Moore-style designs are developed, tested and evaluated, with a choice made on which one ultimately provides the best design for the project. Influential factors include: which design uses the fewest amount of parts, least amount of wiring, least amount of complexity, and least amount of cost.
As mentioned, Moore and Mealy machines have pros and cons associated with each: the output of Moore machines depends only on states, while Mealy machine outputs depend on both inputs as well as states. Thus, a Mealy machine can usually be designed with fewer states, which makes it simpler and more efficient. On the other hand, a Mealy machine is not inherently synchronous, while the Moore machine is. The synchronous operation of circuits is obviously critical when states, transitions, and triggering events are time-dependent. The fact that a Moore machine offers this benefit inherently without the need for additional logic gates and wiring, unlike the Mealy machine, makes it attractive, as well.