Page 188 - 3-2
P. 188

fnd_data=8'b11111110;
                                            door_flag=0;
                                            yellow=0;
                                            green=1;
                                            if(~mid_idle & mid_cnt_max & mid_state==1) begin
                                    // 2 층 도달
                                                    mo=2'b00;
                                                    ns=twos;
                                            end
                                            else if(~three_idle & three_cnt_max & three_state) begin
                                    // 2 층 누르고 3   층도 누름
                                                    three_flag=1;
                                            end
                                            else begin mo=2'b10; ns=M1F_2F; end
                                            end


                    M2F_1F : begin // 2 층에서
                                            fnd_data=8'b11110111;
                                            one_flag=0;
                                            door_flag=0;
                                            yellow=1;
                                            green=0;
                                            if(~bot_idle & bot_cnt_max & bot_state==1) begin
                                    // 1 층 도달
                                                    mo=2'b00;
                                                    ns=ones;
                                            end
                                            else begin mo=2'b11; ns=M2F_1F; end
                                            end


                    M1F_3F : begin // 1 층에서
                                            fnd_data = 8'b11111110;
                                            door_flag = 0;
                                            yellow = 0;
                                            green = 1;
                                            if(~top_idle & top_cnt_max & top_state==1) begin
                                    // 3 층 도달
                                                    mo = 2'b00;
                                                    ns = threes;
                                            end
                                            else if((((red==0)&&
                                                    (~twou_idle & twou_cnt_max & twou_state))||
                                                    (~two_idle & two_cnt_max & two_state))==1) begin
                                    // 3 층 도달 전 2   층 누를 시
                                                    mo = mo;


                                                         - 188 -
   183   184   185   186   187   188   189   190   191   192   193