decoder7.vhd
来自「可以显示六个BCD码的动态扫描七段数码管显示电路。有缓存」· VHDL 代码 · 共 27 行
VHD
27 行
--bcd_7seg.vhd bcd to 7 segment encoder
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity decoder7 is
Port (
bcd: in STD_LOGIC_VECTOR(3 downto 0); --input bcd
dout : out STD_LOGIC_VECTOR(6 downto 0)); --output to 7 segment
end decoder7;
architecture Behavioral of decoder7 is
begin
with bcd select
dout<="0111111" when "0000", --0
"0000110" when "0001", --1
"1011011" when "0010", --2
"1001111" when "0011", --3
"1100110" when "0100", --4
"1101101" when "0101", --5
"1111101" when "0110", --6
"0100111" when "0111", --7
"1111111" when "1000", --8
"1101111" when "1001", --9
"1000000" when "1110", --minus
"0000000" when others;
end Behavioral;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?