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

標(biāo)題: VHDL實(shí)現(xiàn)16位計(jì)數(shù)器(帶源程序) [打印本頁(yè)]

作者: 1873006931    時(shí)間: 2022-5-30 21:00
標(biāo)題: VHDL實(shí)現(xiàn)16位計(jì)數(shù)器(帶源程序)
計(jì)數(shù)器簡(jiǎn)介:
        計(jì)數(shù)器是數(shù)字系統(tǒng)中用得較多的基本邏輯器件。它不僅能記錄輸入時(shí)鐘脈沖的個(gè)數(shù),還可以實(shí)現(xiàn)分頻、定時(shí)、產(chǎn)生節(jié)拍脈沖和脈沖序列等。例如,計(jì)算機(jī)中的時(shí)序發(fā)生器、分頻器、指令計(jì)數(shù)器等都要使用計(jì)數(shù)器。 計(jì)數(shù)器的種類(lèi)很多。按時(shí)鐘脈沖輸入方式的不同,可分為同步計(jì)數(shù)器和異步計(jì)數(shù)器;按進(jìn)位體制的不同,可分為二進(jìn)制計(jì)數(shù)器和非二進(jìn)制計(jì)數(shù)器;按計(jì)數(shù)過(guò)程中數(shù)字增減趨勢(shì)的不同,可分為加計(jì)數(shù)器、減計(jì)數(shù)器和可逆計(jì)數(shù)器。
       以下是VHDL代碼和仿真:


  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; --定義時(shí)鐘、異步復(fù)位、同步使能信號(hào)
  8. cq : out std_logic_vector(3 downto 0); --計(jì)數(shù)結(jié)果
  9. cout : out std_logic --進(jìn)位信號(hào)
  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');-- 計(jì)數(shù)器異步復(fù)位
  19. elsif clk'event and clk='1' then--檢測(cè)時(shí)鐘上升沿
  20. if en='1' then--檢測(cè)是否允許計(jì)數(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)位信號(hào)
  27. else cout<='0';
  28. end if;
  29. cq<=cqi;--計(jì)數(shù)值向端口輸出
  30. end process;
  31. end behave;
復(fù)制代碼

代碼下載: 16位計(jì)數(shù)器.7z (188.25 KB, 下載次數(shù): 10)


作者: mick32    時(shí)間: 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   
作者: mick32    時(shí)間: 2025-11-10 03:25
given listing is 4 bit counter (out std_logic_vector(3 downto 0);) not 16 bit counter ...




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1