正文

〖004〗模60计数器BCD码输出 [AHDL]2006-10-02 10:22:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/wentao/19007.html

分享到:

qh[3..0]、ql[3..0]分别输出高位和低位的BCD码。 subdesign bcd_m60(    clk, cr, en               : input;    qh[3..0], ql[3..0], c0    : output;)variable    counth[3..0], countl[3..0]: dff; begin    counth[].clk = clk;    countl[].clk = clk;    counth[].clrn = cr;    countl[].clrn = cr;    qh[] = counth[];    ql[] = countl[];        if en then        if countl[] < 9 then            countl[] = countl[] + 1;            counth[] = counth[];            c0 = gnd;        elsif counth[] < 5 then            counth[] = counth[] + 1;            countl[] = 0;            c0 = gnd;        else             counth[] = 0;            countl[] = 0;            c0 = vcc;        end if;    else        counth[] = counth[];        countl[] = countl[];    end if; end;

阅读(13504) | 评论(1)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

loading...
您需要登录后才能评论,请 登录 或者 注册