module Main_Ctrl(
				  Reset,
				  Position_SW,
				  Rate_SW,
				  Current_SW,
				  Position_En,
				  Rate_En,
				  Current_En,
				  Position_Adjust_En,
				  Rate_Adjust_En,
				  Current_Adjust_En
				  );
input  Reset;
input  Position_SW;
input  Rate_SW;
input  Current_SW;

output Position_En;
output Position_Adjust_En;

output Rate_En;
output Rate_Adjust_En;

output Current_En;
output Current_Adjust_En;

reg Position_En;
reg Rate_En;
reg Current_En;
reg Position_Adjust_En;
reg Rate_Adjust_En;
reg Current_Adjust_En;

always @(Reset or Position_SW or Rate_SW or Current_SW)
begin
  if(Reset == 1'b1)
  begin
    Position_En        <= 1'b1;
    Position_Adjust_En <= 1'b0;
    Rate_En            <= 1'b1;
    Rate_Adjust_En     <= 1'b0;
    Current_En         <= 1'b1;
    Current_Adjust_En  <= 1'b0;
  end
  else
  begin
    case({Position_SW,Rate_SW,Current_SW})
      3'b100: begin
                Position_En        <= 1'b0;
                Position_Adjust_En <= 1'b1;
                Rate_En            <= 1'b1;
                Rate_Adjust_En     <= 1'b0;
                Current_En         <= 1'b1;
                Current_Adjust_En  <= 1'b0;
              end
	  3'b010: begin
                Position_En        <= 1'b1;
                Position_Adjust_En <= 1'b0;
                Rate_En            <= 1'b0;
                Rate_Adjust_En     <= 1'b1;
                Current_En         <= 1'b1;
                Current_Adjust_En  <= 1'b0;
              end
	  3'b001: begin
                Position_En        <= 1'b1;
                Position_Adjust_En <= 1'b0;
                Rate_En            <= 1'b1;
                Rate_Adjust_En     <= 1'b0;
                Current_En         <= 1'b0;
                Current_Adjust_En  <= 1'b1;
              end
      3'b110: begin
                Position_En        <= 1'b0;
                Position_Adjust_En <= 1'b1;
                Rate_En            <= 1'b0;
                Rate_Adjust_En     <= 1'b1;
                Current_En         <= 1'b1;
                Current_Adjust_En  <= 1'b0;
              end
      3'b101: begin
                Position_En        <= 1'b0;
                Position_Adjust_En <= 1'b1;
                Rate_En            <= 1'b1;
                Rate_Adjust_En     <= 1'b0;
                Current_En         <= 1'b0;
                Current_Adjust_En  <= 1'b1;
              end
      3'b011: begin
                Position_En        <= 1'b1;
                Position_Adjust_En <= 1'b0;
                Rate_En            <= 1'b0;
                Rate_Adjust_En     <= 1'b1;
                Current_En         <= 1'b0;
                Current_Adjust_En  <= 1'b1;
              end
      3'b111: begin
                Position_En        <= 1'b0;
                Position_Adjust_En <= 1'b1;
                Rate_En            <= 1'b0;
                Rate_Adjust_En     <= 1'b1;
                Current_En         <= 1'b0;
                Current_Adjust_En  <= 1'b1;
              end
	  default:begin
                Position_En        <= 1'b1;
                Position_Adjust_En <= 1'b0;
                Rate_En            <= 1'b1;
                Rate_Adjust_En     <= 1'b0;
                Current_En         <= 1'b1;
                Current_Adjust_En  <= 1'b0;
              end
    endcase
  end
end

endmodule