module taxi_top (reset, pulse, clk,
		price_seg1, price_seg2, price_seg3,
		wait_time_seg1, wait_time_seg2,
		mileage_seg1, mileage_seg2, mileage_seg3);
input reset;
input pulse,clk;
output [6:0] price_seg1, price_seg2, price_seg3,
		wait_time_seg1, wait_time_seg2,
		mileage_seg1, mileage_seg2, mileage_seg3;
//8 segments

wire [15:0] wait_time_BCD;           //decimal values in BCD
wire [15:0] price_BCD;
wire [15:0] mileage_BCD;

wire [11:0] price;
wire [11:0] wait_time;           //binary 
wire [11:0] mileage;

wire clk_1;
wire clk_10000;
wire [11:0] number_of_halfkm;
wire work;

BCD_decode BCD_inst1(
	.binary(wait_time),
	.bcd(wait_time_BCD)
);

BCD_decode BCD_inst2(
	.binary(price),
	.bcd(price_BCD)
);

BCD_decode BCD_inst3(
	.binary(mileage),
	.bcd(mileage_BCD)
); 

clk_1Hz M1(
	.clk(clk),
	.clk_1(clk_1)
);

clk_10000Hz M2(
	.clk(clk),
	.clk_10000(clk_10000)
);

round_counter_module rcm1(
	.reset(reset),
	.work(work),
	.pulse(pulse),
	.mileage(mileage),
	.clk(clk_10000),
	.number_of_halfkm(number_of_halfkm),
	.clk_1(clk_1)
);

price_module price_inst(
	.reset(reset),
	.wait_time(wait_time),
	.number_of_halfkm(number_of_halfkm),
	.price(price)
);

wait_time_module wt(
	.reset(reset),
	.work(work),
	.clk(clk_1),
	.wait_time(wait_time)
);



decode hex1 (.data(price_BCD [3:0]),.hex(price_seg1));
decode hex2 (.data(price_BCD [7:4]),.hex(price_seg2));
decode hex3 (.data(price_BCD [11:8]),.hex(price_seg3));

decode hex4 (.data(mileage_BCD [3:0]),.hex(mileage_seg1));
decode hex5 (.data(mileage_BCD [7:4]),.hex(mileage_seg2));
decode hex6 (.data(mileage_BCD [11:8]),.hex(mileage_seg3));

decode hex7 (.data(wait_time_BCD [3:0]),.hex(wait_time_seg1));
decode hex8 (.data(wait_time_BCD [7:4]),.hex(wait_time_seg2));

endmodule 


/*
LED dispay descriptions

left wait_time 
middle mileage 
right price
*/
