verilog code for elevator controller free download
#1
Heart 

I need document of dual elevator controller using verilog
Reply
#2

verilog code for elevator controller free download

/* program for the emulator device that connect the controller to the units */
module emulator(clk,floor,reset,motor,dir,ledup,leddn,dropen,drclose,doorstate, clk4,motion);
input clk;
input reset;
input motor;
input dir;
input [2:0] floor; /* input from the units/level sensor that shows where the elev is*/
input [2:0] doorstate; /* input from the units showing the door status. 1 = open & 0 = closed */
output ledup;
output leddn;
output dropen;
output drclose;
output [1:0] clk4; /*clock timer for the units 4Hz */
output motion;

reg ledup;
reg leddn;
reg drclose;
reg dropen;
reg [1:0] clk4;
reg motion;

/* function 'isclosed' checks to see if the doors are fully closed*/
function isclosed;
input [2:0] d;
isclosed = (|d == 0);
endfunction

always @(posedge clk)
begin
/* reset turns everything off but leaves the doors closed */
if (reset) begin
ledup <= 0;
leddn <= 0;
drclose <= 1;
dropen <= 0;
end

if (motor == 1 && dir == 1) begin ledup <= 1; motion <= 1; end

if (motor ==1 && dir == 0) begin leddn <= 1; motion <= 1; end

if (motor == 0)
begin
ledup <= 0;
leddn <=0;
end


/* The following section check whether the elevator has reached the
desired floor, with the doors closed and has turned of the motor
before opening the doors. */
begin
if (floor[0] == 0 || floor[1] == 0 || floor[2] == 0)
/* if the door is closed and the motor is off then open the door */
if (isclosed(doorstate) && motor == 0 && motion)
begin dropen <= 1; motion <= 0; end
end
/* once the doors are open stop opening i.e dropen =0 and then close them */
if(dropen && !isclosed(doorstate)) begin dropen <= 0; drclose <= 1; end

/* doors are closed stop closing i.e drclose =0 */
if(drclose && isclosed(doorstate)) drclose <= 0;

clk4 <= clk4 + 1;

end
endmodule


// Verilog program for the unit device
module unit(gndfloor,clk,reset,ledup,leddn,dropen,drclose,TC,bottom,top,position,door,doorstate);
input gndfloor;
input clk;
input reset;
input ledup;
input leddn;
input dropen,drclose;
input TC;
input bottom;
input top;

output doorstate;
output [4:0] position;
output [0:2] door;
reg doorstate;
reg [4:0] position;
reg [0:2] door;



always@(posedge clk)
begin
if (reset) begin
position[0] <= ~gndfloor;
position[1] <= 1;
position[2] <= 1;
position[3] <= 1;
position[4] <= 1;
door[0] <= 1;
door[1] <= 1;
door[2] <= 1;
end

if (ledup == 1) begin
//position <= ((position * 2) + ~bottom);
//position <= ({position,~bottom})*2;
position[4:1] <= position[3:0];
position[0] <= bottom;
end

if (leddn ==1)
//position <= 'b11111; //{position, top} << 1;
//position <= ((position/2) + top ? 'b10000: 0);
position <= ({top,position})/2;


if (position[0]==0 && dropen) begin door[0]<=0; door[1:2]<=door[0:1]; end

if (drclose) begin door[0:1] <= door[1:2]; door[2] <= 1; end

if (door[0] == 0 && door[1] ==0 && door[2] ==0)
doorstate <= 1; /* if the door leds are lit then the door isn't closed (open)*/

if (door[0] == 1 && door[1] == 1 && door[2] ==1)
doorstate <= 0; /* if the door leds are not lit then door is closed */

end
endmodule


// Verilog program for a three-level elevator controller
module lift3(floor,clk,reset,Ecall,motor,dir,Target,presentfloor);

input [2:0] floor;
input clk;
input reset;
input [2:0] Ecall;

output motor;
output dir;
output Target;
output presentfloor;

reg motor;
reg dir;
reg [3:1] Target;
reg [3:1] presentfloor;

always @(posedge clk)
begin

if (reset) begin
motor <= 0;
presentfloor <= 1;
Target <= 0;
end

if (Target==0)
begin
if (Ecall[0]==1) Target <= 'b001;
if (Ecall[1]==1) Target <= 'b010;
if (Ecall[2]==1) Target <= 'b100;
end



begin
if (floor[0]==0) presentfloor <='b001;
if (floor[1]==0) presentfloor <='b010;
if (floor[2]==0) presentfloor <='b100;
end

if (motor==1 && presentfloor==Target) begin
motor <= 0;
Target <= 0;
end


if (motor==0 && Target !=0)
begin
if (presentfloor < Target) begin
//dir up
motor <= 1;
dir <= 1;
end

if (presentfloor > Target) begin
//dir down
motor <= 1;
dir <= 0;
end
end

end


endmodule
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: implementation of elevator controller coding using vhdl, fsm lift controller verilog code, ppt on dual elevator controller, design of dual elevator controller pdf, elevator code in vhdl, elevator controller vhdl, dual elevator controller using verilog,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  power plant instrumentation by krishnaswamy pdf free download 3 24,057 10-02-2019, 07:00 PM
Last Post:
  karmakshetra epaper in bengali this week pdf free download 5 13,035 01-02-2019, 11:28 PM
Last Post:
  optical networks by rajiv ramaswami free download 3 11,345 20-11-2018, 07:25 AM
Last Post:
  free download machine design 2 jbk das book pdf 2 11,131 30-05-2018, 11:39 AM
Last Post: [email protected]
  free download internal combustion engine by mathur sharma pdf 3 9,556 26-12-2017, 10:41 AM
Last Post: jaseela123d
  design of machine elements by jbk das pdf free download 4 11,787 04-12-2017, 03:07 PM
Last Post: jaseela123d
  vlsi textbook pdf by bakshi free download 4 9,617 25-10-2017, 03:02 PM
Last Post: pinky
  veta spoken english books pdf free download 3 2,161 20-09-2017, 07:33 AM
Last Post: Guest
  free download source code for online movie ticket booking in java 2 18,765 15-08-2017, 03:21 PM
Last Post: Morshed
  jelet book pdf file free download 4 5,933 28-06-2017, 10:01 PM
Last Post: Guest

Forum Jump: