Page 503 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 503

인천전자마이스터고                                                                            전자회로설계과



                                                            if(!close_stop_limit) in_sw_buff[4]<=0;

                                                      end

                                            else if(state_c==OPEN)


                                                      begin

                                                            if(!open_stop_limit) in_sw_buff[3]<=0;

                                                      end


                                            else in_sw_buff <= in_sw_buff;

                                    end

                            end

                    end








                    // 외부스위치 값 기억

                    always @(posedge clk_div, negedge reset)   //sw_buf[0]=1층


                    begin

                            if(!reset) sw_buf <= 0;

                            else

                            begin

                                    if(!u1) sw_buf[0] <= 1;      // 1층 up 버튼


                                    else if(!u2) sw_buf[1] <= 1; // 2층 up 버튼

                                    else if(!d2) sw_buf[2] <= 1; // 2층 down 버튼

                                    else if(!d3) sw_buf[3] <= 1; // 3층 down 버튼


                                    else

                                    begin

                                            if(state_c==STOP)         // STOP상태일때






                                                         -  496  -
   498   499   500   501   502   503   504   505   506   507   508