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

end
                            else  music_sel<=0;
                    end
            end


            always  @  (posedge  clk,negedge  rst)//알람시간과  현재시간이  같아졌을때  신호
            begin
                    if(!rst)  begin  a_flag<=0;  end
                    else
                    begin
                            if(screen)
                            begin
                                  if  (sw_off==1)  a_flag<=0;  //  alarm  off
                                else
                                    begin
                                     if(hour_a==hour && min_a==min && a_apm==apm && vpos==5) a_flag<=1; // alarm on

                                  end
                            end
                            else  a_flag  <=  a_flag;
                    end
            end


            always @(posedge clk,  negedge  rst)
            begin
                    if(!rst)  sw_off<=0;
                    else
                            begin
                                    if(off_b==1)  sw_off<=~sw_off;
                                    else  sw_off<=sw_off;
                            end
            end

            endmodule




             B) LCD 모듈


             module  alarm_pro(clk,  rst,  hour,  min, A_hour, A_min,  pos,  sw_off,screen,  song_sw,  apm,
             a_apm,  lcd_rs,  lcd_rw,  lcd_en,  lcd_data,  music_sel);






                                                         -  407  -
   409   410   411   412   413   414   415   416   417   418   419