衡阳派盒市场营销有限公司

您好,歡迎來電子發燒友網! ,新用戶?[免費注冊]

您的位置:電子發燒友網>電子元器件>數碼管>

7段數碼管顯示的VHDL設計(兩款設計方案)

2018年01月29日 15:48 電子發燒友整理 作者: 用戶評論(0

數碼管的一種是半導體發光器件,數碼管可分為七段數碼管和八段數碼管,區別在于八段數碼管比七段數碼管多一個用于顯示小數點的發光二極管單元DP(decimal point),其基本單元是發光二極管。

7段數碼管顯示的VHDL設計一:7段數碼顯示譯碼器

LIBRARY IEEE;

USE IEEE.STD_LOGIC_1164.ALL; ENTITY DecL7S IS

PORT(A :IN STD_LOGIC_VECTOR(3 DOWNTO 0);

LED7S:OUT STD_LOGIC_VECTOR(6 DOWNTO 0) ); END;

ARCHITECTURE one OF DecL7S IS BEGIN

PROCESS(A) BEGIN

CASE A(3 DOWNTO 0) IS

WHEN “0000”=》LED7S《=”0111111”;

WHEN “0001”=》LED7S《=”0000110”;

WHEN “0010”=》LED7S《=”1011011”;

WHEN “0011”=》LED7S《=”1001111”;

WHEN “0100”=》LED7S《=”1100110”;

WHEN “0101”=》LED7S《=”1101101”;

WHEN “0110”=》LED7S《=”1111101”;

WHEN “0111”=》LED7S《=”0000111”;

WHEN “1000”=》LED7S《=”1111111”;

WHEN “1001”=》LED7S《=”1101111”;

WHEN “1010”=》LED7S《=”1110111”;

WHEN “1011”=》LED7S《=”1111100”;

WHEN “1100”=》LED7S《=”0111001”;

WHEN “1101”=》LED7S《=”1011110”;

WHEN “1110”=》LED7S《=”1111001”;

WHEN “1111”=》LED7S《=”1110001”;

WHEN OTHERS=》 NULL;

END CASE; END PROCESS;

END;

波形仿真

7段數碼管顯示的VHDL設計(兩款設計方案)

調出VHDL描述產生的2選1多路選擇器的原理圖。點擊TOOLS-》NELIST VIEWERS-》RTL VIEWERS,即調出VHDL描述產生的2選1多路選擇器的RTL電路圖,如下所示:

7段數碼管顯示的VHDL設計(兩款設計方案)

7段數碼管顯示譯碼器的VHDL設計二:基于vhdl 實現的4位七段數碼管顯示

顯示內容為4位16進制數,數碼管共陰極連接。 有置數及自加一功能。

LIBRARY IEEE;

USE IEEE.STD_LOGIC_1164.ALL;

USE ieee.std_logic_unsigned.all;

ENTITY counter0000_ffff IS PORT ( clk, en :in STD_LOGIC;

set_ch:in std_logic_vector( 1 downto 0);

set_num :in std_logic_vector( 3 downto 0);

data : out STD_LOGIC_VECTOR(6 DOWNTO 0);

sel : out STD_LOGIC_VECTOR(2 DOWNTO 0) );

END counter0000_ffff;

architecture behave of counter0000_ffff is

signal num,num1,num2,num3,num4: std_logic_vector (3 downto 0);

signal num_counter:std_logic;

begin

a:process( clk )

variable cc: integer range 0 to 3:=0;

begin

if( clk = ‘0’ ) then

case cc is

when 0 =》 num 《= num2;sel 《= “011”;cc:=1;

when 1 =》 num 《= num3;sel 《= “010”;cc:=2;

when 2 =》 num 《= num4;sel 《= “001”;cc:=3;

when 3 =》 num 《= num1;sel 《= “000”;cc:=0;

end case;

case num is

when “0000” =》 data 《= “0111111”;

when “0001” =》 data 《= “0000110”;

when “0010” =》 data 《= “1011011”;

when “0011” =》 data 《= “1001111”;

when “0100” =》 data 《= “1100110”;

when “0101” =》 data 《= “1101101”;

when “0110” =》 data 《= “1111101”;

when “0111” =》 data 《= “0000111”;

when “1000” =》 data 《= “1111111”;

when “1001” =》 data 《= “1101111”;

when “1010” =》 data 《= “1110111”;

when “1011” =》 data 《= “1111100”;

when “1100” =》 data 《= “0111001”;

when “1101” =》 data 《= “1011110”;

when “1110” =》 data 《= “1111001”;

when “1111” =》 data 《= “1110001”;

end case;

end if;

end process;

b:process( clk ) –自加一

begin

if( clk = ‘0’) then

if( en = ‘1’) then

CASE set_ch IS

when “00” =》 num1《=set_num;

when “01” =》 num2《=set_num;

when “10” =》 num3《=set_num;

when “11” =》 num4《=set_num;

end case; else if num_counter = ‘0’ then

if num1 = “1111” then num1 《= “0000”;

num2 《= num2 + 1;

else num1 《= num1 +1;

end if;

if num2 = “1111” then num2 《= “0000”;

num3 《= num3 + 1;

end if;

if num3 = “1111” then

num3 《= “0000”;

num4 《= num4 + 1;

end if;

if num4 = “1111” then

num4 《= “0000”;

end if;

end if;

END IF;

end if;

end process;

c:process( clk ) –分頻

variable a:integer range 0 to 9999:=0;

begin if( clk = ‘1’) then

if( a = 9999 ) then

num_counter 《= not num_counter;

a := 0;

else a := a + 1;

end if;

end if;

end process;

end behave;

非常好我支持^.^

(6) 85.7%

不好我反對

(1) 14.3%

( 發表人:李建兵 )

      發表評論

      用戶評論
      評價:好評中評差評

      發表評論,獲取積分! 請遵守相關規定!

      ?
      百家乐赌博博彩赌博网| 去澳门百家乐官网的玩法技巧和规则| 澳门赌场娱乐城| 百家乐足球投注网哪个平台网址测速最好 | 宝龙百家乐的玩法技巧和规则| 历史| 大发888倾家荡产| 百家乐官网衬衣| bet365体育开户| 大发888娱乐场 下载| 百家乐水晶筹码| 现场百家乐官网机| 博狗百家乐官网现场| 大发888游戏平台 送1688元现金礼金领取| 百家乐官网扑克桌| 广州市| bet365最稳定网址| 威尼斯人娱乐城优惠| 网上百家乐赌场| 百家乐官网vshow| 百家乐官网太阳城球讯网| 南木林县| 百家乐赌博筹| 至尊百家乐官网于波| 实战百家乐官网的玩法技巧和规则 | 博狗博彩网站,| 大发888娱乐城 真钱下载| 菲彩百家乐的玩法技巧和规则| 有24天星名的罗盘| 百家乐官网在线洗码| 百家乐官网最新的投注方法| 百家乐官网稳一点的押法| 体球网| 云龙县| 太阳神网上娱乐| 888真人| 博九娱乐城| 百家乐官网园游戏庄闲| 环球百家乐官网现金网| 百家乐官网代理占成| 新澳门百家乐官网娱乐城|