8位数控分频器的设计_8位数控分频器

数控分频器的功能就是当在输入端给定不同输入数据时,将对输入的时钟信号实现不同的分频比,即可实现设置数的分频计数器。

程序:

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

entity dvf is

port(

clk:in std_logic;

d:in std_logic_vector(7 downto 0);

four:out std_logic

);

end;

architecture one of dvf is

signal full:std_logic;

begin

p_reg:process(clk)

variable cnt8:std_logic_vector(7 downto 0);

begin

if clk‘event and clk=‘1‘ then

if cnt8="11111111" then

cnt8:=d;

full<=‘1‘;

else cnt8:=cnt8+1;

full<=‘0‘;

end if;

end if;

end process p_reg;

p_div:process(full)

variable cnt2:std_logic;

begin

if full‘event and full=‘1‘ then

cnt2:=not cnt2;

if cnt2=‘1‘then four<=‘1‘;

else four<=‘0‘;

end if;

end if;

end process p_div;

end;

RTL原图:

其仿真图:

原文:https://www.cnblogs.com/lhkhhk/p/11962570.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值