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

begin
                            if(screen)  //알람  스위치가  1일때
                            begin
                                    if(vpos==1)  //알람  시간  맞출때  분  스위치를  누르면
                                    begin
                                            if(plus_b==1)
                                            begin
                                                    if(min_a>=59)  min_a  <=  0;
                                                    else  min_a  <=  min_a  +  1;
                                            end
                                            else  min_a<=min_a;
                                    end
                                    else  if(vpos==0)  //알람  시간맞출때  시  스위치를  누르면
                                    begin
                                            if(plus_b==1)
                                            begin
                                                    if(hour_a>=12)hour_a  <=  1;
                                                    else  hour_a  <=  hour_a  +  1;
                                                    if(hour_a==11)a_apm<=~a_apm;
                                            end
                                            else  begin  hour_a<=hour_a;  a_apm<=a_apm;  end
                                    end
                                    else  //  아무것도  아닐  경우
                                    begin
                                            hour_a  <=  hour_a;
                                            min_a  <=  min_a;
                                    end
                            end


            always  @  (posedge  clk,negedge  rst)  //노래  선택  0-TT  1-뽀로로
            begin
                    if(!rst)  music_sel<=0;
                    else
                    begin
                            if(screen)
                            begin
                                    if(vpos==2)
                                    begin
                                            if(plus_b==1)  music_sel  <=  ~music_sel;
                                    end
                                    else  music_sel  <=  music_sel;




                                                         -  406  -
   408   409   410   411   412   413   414   415   416   417   418