<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 基于CPLD的驅(qū)動(dòng)數(shù)碼顯示電路設(shè)計(jì)案例

          基于CPLD的驅(qū)動(dòng)數(shù)碼顯示電路設(shè)計(jì)案例

          作者: 時(shí)間:2012-03-17 來源:網(wǎng)絡(luò) 收藏

          when 101=>q=11011111;
          when 110=>q=10111111;
          when others=>q=01111111;
          end case;
          end process;
          end rtl;

          1.3.3 八選一數(shù)據(jù)選擇模塊
          八選一數(shù)據(jù)選擇模塊 SEL81 如圖1.7 所示。SEL81 模塊輸入信號(hào)一個(gè)是數(shù)據(jù)選擇器SEL81的地址碼SEL[2..0],另一部分是數(shù)據(jù)信息A[3..0] ~H[3..0]。地址碼SEL[2..0]來自時(shí)鐘脈沖計(jì)數(shù)器CN8,由地址碼SEL[2..0]決定輸出哪個(gè)輸入數(shù)據(jù)。輸出信號(hào)是Q[3..0]。

          圖 1.7 八選一數(shù)據(jù)選擇模塊SEL81

          本文引用地址:http://www.ex-cimer.com/article/149396.htm

          library ieee;
          use ieee.std_logic_1164.all;
          entity sel81 is
          port(sel:in std_logic_vector(2 downto 0);
          a,b,c,d,e,f,g,h:in std_logic_vector(3 downto 0);
          q:out std_logic_vector(3 downto 0));
          end sel81;
          architecture rtl of sel81 is
          begin
          process(a,b,c,d,e,f,g,h,sel)
          variable cout: std_logic_vector(3 downto 0);
          begin
          case (sel) is
          when 000=>cout:=a;
          when 001=>cout:=b;
          when 010=>cout:=c;
          when 011=>cout:=d;
          when 100=>cout:=e;
          when 101=>cout:=f;
          when 110=>cout:=g;
          when others=>cout:=h;
          end case;
          q=cout;
          end process;
          end rtl;

          1.3.4 七段譯碼器模塊
          七段譯碼器模塊 DISP 如圖1.8 所示。DISP 模塊是七段譯碼器,將輸入的4 位二進(jìn)制數(shù)轉(zhuǎn)換為管所對(duì)應(yīng)的數(shù)字。例如輸入為4 位二進(jìn)制數(shù)0000 的時(shí)候,使0,則要七段譯碼器輸出為0111111,即g 段為0,g 段發(fā)光二極管不亮,其他發(fā)光二極管被點(diǎn)亮,顯示效果為0。DISP 模塊輸入信號(hào)D[3..0]接到八選一數(shù)據(jù)選擇模塊的輸出信號(hào)Q[3..0];七段譯碼器輸出信號(hào)Q[6..0]接管的a~g 管腳。

          圖 1.8 七段譯碼器模塊DISP

          library ieee;
          use ieee.std_logic_1164.all;
          entity disp is
          port(d:in std_logic_vector(3 downto 0);
          q:out std_logic_vector(6 downto 0));
          end disp;
          architecture rtl of disp is
          begin
          process(d)
          begin
          case d is
          when0000=>q=0111111;
          when0001=>q=0000110;
          when0010=>q=1011011;
          when0011=>q=1001111;
          when0100=>q=1100110;
          when0101=>q=1101101;
          when0110=>q=1111101;
          when0111=>q=0100111;
          when1000=>q=1111111;
          when others=>q=1101111;
          end case;
          end process;
          end rtl;

          1.3.5 八位數(shù)碼管顯示的整體電路
          將各個(gè)模塊連接起來構(gòu)成整體電路圖如圖 1.9 所示,可以實(shí)現(xiàn)用 設(shè)計(jì)一個(gè)八位數(shù)碼管顯示電路的功能。clk 是時(shí)鐘脈沖輸入信號(hào),經(jīng)過時(shí)鐘脈沖計(jì)數(shù)器CN8 模塊,將信號(hào)以3 位2 進(jìn)制數(shù)的形式輸出,輸出信號(hào)是COUT[2..0]。時(shí)鐘脈沖計(jì)數(shù)器CN8 的輸出同時(shí)作為3 線—8 線譯碼器DECODER3_8 和八選一數(shù)據(jù)選擇器SEL81 地址碼SEL[2..0]的輸入。時(shí)鐘脈沖計(jì)數(shù)器CN8 的輸出經(jīng)過3 線—8 線譯碼器DECODER3_8 譯碼其輸出信號(hào)Vss[7..0]接到八位數(shù)碼管的陰極Vss7、Vss6、Vss5、Vss4、Vss3、Vss2、Vss1、Vss0 端,決定點(diǎn)亮哪位數(shù)碼管。同時(shí)時(shí)鐘脈沖計(jì)數(shù)器CN8 模塊輸出的信號(hào)也進(jìn)入數(shù)據(jù)選擇器SEL81 地址碼SEL[2..0]的輸入,進(jìn)行輸出數(shù)據(jù)的選擇,其輸出是Q[3..0]。八選一數(shù)據(jù)選擇器SEL81 模塊的輸出是Q[3..0]再經(jīng)過七段譯碼器DISP 模塊,將其翻譯成可以用數(shù)碼顯示管的數(shù)據(jù)。七段譯碼器DISP 模塊的輸出Q[6..0]分別經(jīng)300 歐電阻接數(shù)碼顯示管的a~g 管腳。八選一數(shù)據(jù)選擇器模塊的輸入端,可根據(jù)具體需要進(jìn)行設(shè)計(jì)。

          圖 1.9 八位數(shù)碼管顯示的整體電路


          上一頁(yè) 1 2 下一頁(yè)

          評(píng)論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();