Need help with elevator controller vhdl code

Discussion in 'Homework Help' started by Mirotvorez113, Nov 30, 2011.

  1. Mirotvorez113

    Thread Starter New Member

    Nov 30, 2011
    1
    0
    Hello.

    As the topic states, need help with vhdl part of the assignment. The controller itself is what I cannot figure out, also need to emplement a 7 segment display and be uble to update the display but I do have the display code done. I got the debouncer and timer as well.

    In particular, it is a 11 story building(basement, loby, 0, 1, ..., 9)
    Inputs:
    4-bit dip switches for floor section
    Push button for detecting the doors
    Outputs:
    Left seven segment display
    Right seven segment display
    1 LED light to determine if the doors are open or not

    I was trying to use only 4 states thats the basic stuff I got so far:

    // elevator code
    module detectorcode(detect, clk, in, w, x, y, z, a, b, c, d, e, f, g, LED);

    input clk, in, w, x, y, x, A[], B[];
    output detect, a, b, c, d, e, f, g, LED;
    reg [2:0] state;
    reg detect;
    parameter A=3'b0000, B=3'b0001, C=3'b0010, D=3'b0011;
    always@(posedge clk)
    case(state)
    A:begin
    detect=1;
    if(in==1)
    state<=B;
    else
    state<=A;
    end
    B:begin
    if A[]-B[]>1;
    state<=C
    else
    state<=D;
    end
    C:begin
    ...

    D:begin
    ...

    endcase

    endmodule

    The rest I dunno:(, cause I'm clueless with vhld, let me know what other info I need to provide.
    Please really need help. Thank you.
     
Loading...