// Copyright (C) 1991-2004 Altera Corporation
// Any  megafunction  design,  and related netlist (encrypted  or  decrypted),
// support information,  device programming or simulation file,  and any other
// associated  documentation or information  provided by  Altera  or a partner
// under  Altera's   Megafunction   Partnership   Program  may  be  used  only
// to program  PLD  devices (but not masked  PLD  devices) from  Altera.   Any
// other  use  of such  megafunction  design,  netlist,  support  information,
// device programming or simulation file,  or any other  related documentation
// or information  is prohibited  for  any  other purpose,  including, but not
// limited to  modification,  reverse engineering,  de-compiling, or use  with
// any other  silicon devices,  unless such use is  explicitly  licensed under
// a separate agreement with  Altera  or a megafunction partner.  Title to the
// intellectual property,  including patents,  copyrights,  trademarks,  trade
// secrets,  or maskworks,  embodied in any such megafunction design, netlist,
// support  information,  device programming or simulation file,  or any other
// related documentation or information provided by  Altera  or a megafunction
// partner, remains with Altera, the megafunction partner, or their respective
// licensors. No other licenses, including any licenses needed under any third
// party's intellectual property, are provided herein.

module Master_Control_Main(
	Master_Floor9,
	Master_Floor8,
	Master_Floor7,
	Master_Floor6,
	Master_Floor5,
	Master_Floor4,
	Master_Floor3,
	Master_Floor2,
	Master_Floor1,
	Reset,
	En,
	Clock_1Hz,
	Slave_Request_Arrive,
	Ahead_Request,
	Delay_Request,
	Floor_Time,
	Slave_Floor1,
	Slave_Floor2,
	Slave_Floor3,
	Slave_Floor4,
	Slave_Floor5,
	Slave_Floor6,
	Slave_Floor7,
	Slave_Floor8,
	Slave_Floor9,
	Door_On_Off,
	Motor_Data,
	Now_Direction,
	Now_Floor
);

input	Master_Floor9;
input	Master_Floor8;
input	Master_Floor7;
input	Master_Floor6;
input	Master_Floor5;
input	Master_Floor4;
input	Master_Floor3;
input	Master_Floor2;
input	Master_Floor1;
input	Reset;
input	En;
input	Clock_1Hz;
input	Slave_Request_Arrive;
input	Ahead_Request;
input	Delay_Request;
input	Floor_Time;
input	[4:0] Slave_Floor1;
input	[4:0] Slave_Floor2;
input	[4:0] Slave_Floor3;
input	[4:0] Slave_Floor4;
input	[4:0] Slave_Floor5;
input	[4:0] Slave_Floor6;
input	[4:0] Slave_Floor7;
input	[4:0] Slave_Floor8;
input	[4:0] Slave_Floor9;
output	Door_On_Off;
output	[1:0] Motor_Data;
output	[1:0] Now_Direction;
output	[3:0] Now_Floor;

wire	SYNTHESIZED_WIRE_0;
wire	[3:0] SYNTHESIZED_WIRE_6;
wire	[1:0] SYNTHESIZED_WIRE_2;
wire	SYNTHESIZED_WIRE_4;
wire	SYNTHESIZED_WIRE_5;

assign	Now_Direction = SYNTHESIZED_WIRE_2;
assign	Now_Floor = SYNTHESIZED_WIRE_6;




Door_Control	b2v_inst(.Reset(Reset),
.En(En),.Clock_1Hz(Clock_1Hz),.Floor_Arrive(SYNTHESIZED_WIRE_0),.Slave_Request_Arrive(Slave_Request_Arrive),.Ahead_Request(Ahead_Request),.Delay_Request(Delay_Request),.Door_on_off(Door_On_Off));

Floor_Select	b2v_inst1(.Reset(Reset),
.En(En),.num1(Master_Floor1),.num2(Master_Floor2),.num3(Master_Floor3),.num4(Master_Floor4),.num5(Master_Floor5),.num6(Master_Floor6),.num7(Master_Floor7),.num8(Master_Floor8),.num9(Master_Floor9),.now_floor(SYNTHESIZED_WIRE_6),.floor_arrive(SYNTHESIZED_WIRE_0));

Lift_Run_Manage	b2v_inst2(.Reset(Reset),
.En(En),.Master_Floor1(Master_Floor1),.Master_Floor2(Master_Floor2),.Master_Floor3(Master_Floor3),.Master_Floor4(Master_Floor4),.Master_Floor5(Master_Floor5),.Master_Floor6(Master_Floor6),.Master_Floor7(Master_Floor7),.Master_Floor8(Master_Floor8),.Master_Floor9(Master_Floor9),.Now_Direction(SYNTHESIZED_WIRE_2),.Now_Floor(SYNTHESIZED_WIRE_6),.Slave_Floor1(Slave_Floor1),.Slave_Floor2(Slave_Floor2),.Slave_Floor3(Slave_Floor3),.Slave_Floor4(Slave_Floor4),.Slave_Floor5(Slave_Floor5),.Slave_Floor6(Slave_Floor6),.Slave_Floor7(Slave_Floor7),.Slave_Floor8(Slave_Floor8),.Slave_Floor9(Slave_Floor9),.Up_En(SYNTHESIZED_WIRE_4),.Down_En(SYNTHESIZED_WIRE_5));

Motor_Control	b2v_inst3(.Reset(Reset),
.En(En),.Up_En(SYNTHESIZED_WIRE_4),.Down_En(SYNTHESIZED_WIRE_5),.Floor_Time(Floor_Time),.Motor_Data(Motor_Data),.Now_Direction(SYNTHESIZED_WIRE_2),.Now_Floor(SYNTHESIZED_WIRE_6));


endmodule
