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

if(ss_buff==1)
                                             begin
                                                    timer_flag <= 1;
                                                    enable <= 0;
                                            end
                                    if(up_buff == 1)
                                            begin
                                                    if(select==1) thour <= (thour+1)%24;
                                                    else if(select==2) tmin <= (tmin+1)%60;
                                            end
                            end
                            else
                               begin
                                    thour <= 0;
                                    tmin <= 0;
                                    tsec <= 0;
                                    timer_flag <= 0;
                          enable <= 0;
                         end
                end


             endmodule
             //////////////////////////////////////////////////////////////////////////////
             // d_sw output timing -> 50[Mhz]기준 BOUNCING DELAY뒤에 출력
             // BOUNCING_DELAY 값 조절가능
             module sw_debouncing (clk, rst, b_sw, d_sw);


             input clk, rst, b_sw;


             output reg d_sw;


             reg [25:0] cnt;
             reg     key_state;


             parameter BOUNCING_DELAY = 12500000;   // boungcing count num
             parameter ACTIVE_HIGH    = 1'b1;       // active_high switch
             parameter ACTIVE_LOW     = 1'b0;       // active_low  switch
             parameter KEY_ON                        = 0;
             parameter KEY_OFF                       = 1;


                    always @(posedge clk, negedge rst) begin




                                                         -  376  -
   378   379   380   381   382   383   384   385   386   387   388