数码管的一种是半导体发光器件,数码管可分为七段数码管和八段数码管,区别在于八段数码管比七段数码管多一个用于显示小数点的发光二极管单元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;
波形仿真
调出vhdl描述产生的2选1多路选择器的原理图。点击tools-》nelist viewers-》rtl viewers,即调出vhdl描述产生的2选1多路选择器的rtl电路图,如下所示:
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;
回调函数是什么?为什么要使用回调函数?
新唐科技音乐合成系列介绍
RF-DG-52PAS CC2652P Zigbee 3.0 USB Dongle烧录指南
低压配电柜的电流电压、无功补偿方式和电表读数
1OkV变压器油绝缘试验 变压器油试验的意义
7段数码管显示的VHDL设计(两款设计方案)
曝小米10系列将于2月初发布 起售价预计超过3500元
亚太6号卫星参数表
PC5529宽压输入异步升压芯片ESOP8封装
空调遥控器上的eco是什么意思
工业物联网如何助力制造业实现碳达峰和碳中和目标?
华为海尔欧派都在跨界,物联网时代企业重定边界
CEVA和共同开发全面3D空间音频解决方案
游戏PC一哥AlienWare发布Area51:最近能买到的综合性能最强的台式主机
信号完整性的信号带宽对上升边的影响
加热工艺发展趋势
Ameya360指纹识别器解决方案
安泰维修首台TTI TGP110脉冲发生器修复成功
lisp语言有什么特点_lisp语言总结详细分析
NXP短距离无线通信蓝牙模块QN9021的原理