欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3847|回復(fù): 2
收起左側(cè)

VHDL實(shí)現(xiàn)16位計數(shù)器(帶源程序)

[復(fù)制鏈接]
ID:1030457 發(fā)表于 2022-5-30 21:00 | 顯示全部樓層 |閱讀模式
計數(shù)器簡介:
        計數(shù)器是數(shù)字系統(tǒng)中用得較多的基本邏輯器件。它不僅能記錄輸入時鐘脈沖的個數(shù),還可以實(shí)現(xiàn)分頻、定時、產(chǎn)生節(jié)拍脈沖和脈沖序列等。例如,計算機(jī)中的時序發(fā)生器、分頻器、指令計數(shù)器等都要使用計數(shù)器。 計數(shù)器的種類很多。按時鐘脈沖輸入方式的不同,可分為同步計數(shù)器和異步計數(shù)器;按進(jìn)位體制的不同,可分為二進(jìn)制計數(shù)器和非二進(jìn)制計數(shù)器;按計數(shù)過程中數(shù)字增減趨勢的不同,可分為加計數(shù)器、減計數(shù)器和可逆計數(shù)器。
       以下是VHDL代碼和仿真:
51hei1.png 51hei.png

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.std_logic_arith.all;
  4. use ieee.std_logic_unsigned.all;
  5. --------------------------------------------------------------------
  6. entity exp3 is
  7. port( clk,ret,en : in std_logic; --定義時鐘、異步復(fù)位、同步使能信號
  8. cq : out std_logic_vector(3 downto 0); --計數(shù)結(jié)果
  9. cout : out std_logic --進(jìn)位信號
  10. );
  11. end exp3;
  12. --------------------------------------------------------------------
  13. architecture behave of exp3 is
  14. begin
  15. process(clk,ret,en)
  16. variable cqi : std_logic_vector(3 downto 0);
  17. begin
  18. if ret='0' then cqi:=(others =>'0');-- 計數(shù)器異步復(fù)位
  19. elsif clk'event and clk='1' then--檢測時鐘上升沿
  20. if en='1' then--檢測是否允許計數(shù)(同步使能)
  21. if cqi<15 then cqi:=cqi+1;
  22. else cqi:=(others =>'0');
  23. end if;
  24. end if;
  25. end if;
  26. if cqi>9 then cout<='1';--輸出進(jìn)位信號
  27. else cout<='0';
  28. end if;
  29. cq<=cqi;--計數(shù)值向端口輸出
  30. end process;
  31. end behave;
復(fù)制代碼
51hei.png
代碼下載: 16位計數(shù)器.7z (188.25 KB, 下載次數(shù): 10)

評分

參與人數(shù) 1黑幣 +40 收起 理由
admin + 40 共享資料的黑幣獎勵!

查看全部評分

回復(fù)

使用道具 舉報

ID:228452 發(fā)表于 2022-7-29 22:57 | 顯示全部樓層
Do you have code for 32 bit counter...
Something like HCTL-2032-SC
(32 bit counter with digital filter but obsolete chip)

    Thank you   
回復(fù)

使用道具 舉報

ID:228452 發(fā)表于 2025-11-10 03:25 | 顯示全部樓層
given listing is 4 bit counter (out std_logic_vector(3 downto 0);) not 16 bit counter ...
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表