module Floor_Select(
					 Reset,
					 En,
					 num1,
					 num2,
					 num3,
					 num4,
					 num5,
					 num6,
					 num7,
					 num8,
					 num9,
					 now_floor,
					 floor_arrive					 
					 );
input  Reset;
input  En;					
input  num1,num2,num3,num4,num5,num6,num7,num8,num9;
input  [3:0] now_floor;
output floor_arrive;

reg floor_arrive;

always @(num1 or num2 or num3 or num4 or num5 or num6 or num7 or num8 or num9 
         or now_floor or En or Reset)
begin
  if((Reset == 1'b1) || (En == 1'b1))
	floor_arrive <= 1'b0;
  else
  begin
	if( ((num1 == 1'b1) && (now_floor == 4'b0001)) ||
	    ((num2 == 1'b1) && (now_floor == 4'b0010)) ||
	    ((num3 == 1'b1) && (now_floor == 4'b0011)) ||
	    ((num4 == 1'b1) && (now_floor == 4'b0100)) ||
	    ((num5 == 1'b1) && (now_floor == 4'b0101)) ||
	    ((num6 == 1'b1) && (now_floor == 4'b0110)) ||
	    ((num7 == 1'b1) && (now_floor == 4'b0111)) ||
	    ((num8 == 1'b1) && (now_floor == 4'b1000)) ||
	    ((num9 == 1'b1) && (now_floor == 4'b1001)) )
	  floor_arrive <= 1'b1;  //电梯运行到所选楼层，则开门
	else
	  floor_arrive <= 1'b0;
  end
end

endmodule