zoukankan      html  css  js  c++  java
  • clk_3

    // date : 2013,3,18

    //designer : pengxiaoen

    // function:the T  of  the output_clk  is three times of clk

    module  clock_3 (                        

              clk,reset,                         

              clk_temp,output_clk                        

                              ) ;

    input clk,reset;

    output clk_temp,output_clk ;

    reg output_clk;

    reg [31:0]  temp;

    //-----------------------------------------------

    always @ (posedge clk or negedge reset)

    if (!reset) 

       temp <= 32'd0;

    else if (temp[25] == 1) 

        temp <= 32'd0;   

      else temp = temp+1;

    reg clock_temp;

    //----------------------------------------------- 随便进行了一个分频,因为我的基准时钟要绑定在一个led上,当然就不可以把50M当成基准了

    always @ (posedge clk or negedge reset)

    if (!reset)  clock_temp <= 1'b0;

    else if (temp[25])  clock_temp <= ~clock_temp;      

    reg [1:0] a,b; //--------------------------------------------------

    always @ (posedge clock_temp  or negedge reset )

    if (!reset)     a <= 2'd0;

    else if (a==2'd2)  a<=2'd0;   

      else  a = a+1;

    always @ (negedge clock_temp  or negedge reset)

    if (!reset)     b <= 2'd0;

    else if (b == 2'd2) b <= 2'd0;   

       else b <= b+1;

    always @ (a or b)

    if ((a== 2'd0) && (b == 2'd2))  output_clk <= 1'b1;   

    else if ((a ==2'd1) &&(b == 2'd1))  output_clk <= 1'b0;   

        else;      

    assign clk_temp = clock_temp;

    endmodule 

  • 相关阅读:
    ES6的Iterator,jquery Fn
    html4,xhtml,html5发展历史
    浏览器Range,Selection等选中文本对象
    高效的插入子节点DocumentFragment
    Vue 性能优化track-by
    JS中先有Object还是先有Function?
    Unicode 与(UTF-8,UTF-16,UTF-32,UCS-2)
    FormData、Blob、File、ArrayBuffer数据类型
    jQuery 2.0.3 源码分析 事件绑定
    记录:springmvc + mybatis + maven 搭建配置流程
  • 原文地址:https://www.cnblogs.com/sepeng/p/3001198.html
Copyright © 2011-2022 走看看