`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
//	Tony Kim
//	6.111 Lab2
//
// Module name: FuelPumpLogic
// Description: Implements a very simple FSM for turning off/on the fuel pump.
//
//////////////////////////////////////////////////////////////////////////////////

module FuelPumpLogic(clk_27mhz, brake_switch, hidden_switch, ignition, fuel_pump_power);
	 input clk_27mhz;
    input brake_switch;
    input hidden_switch;
    input ignition;
    output fuel_pump_power;

	parameter FUEL_PUMP_OFF = 1'b0;
	parameter FUEL_PUMP_ON  = 1'b1;
	
	reg fuel_pump_power = FUEL_PUMP_ON;
	
	always @ (posedge clk_27mhz)
	begin
		if(ignition)
		begin
			if(brake_switch && hidden_switch)
				fuel_pump_power = FUEL_PUMP_ON;
		end
		else
			fuel_pump_power = FUEL_PUMP_OFF;
	end
	
endmodule
