📄 decoder7.vhd
字号:
--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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -