drive.vhd

来自「《CPLDFPGA嵌入式应用开发技术白金手册》源代码」· VHDL 代码 · 共 30 行

VHD
30
字号
--drive
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_arith.all;
entity drive is
  port(din:in std_logic_vector(3 downto 0);
       dout:out std_logic_vector(6 downto 0));
end drive;
architecture rtl of drive is
begin
 process(din)
  begin
   case din is
    when"0000"=>dout<="0000001";
    when"0001"=>dout<="1001111";
    when"0010"=>dout<="0010010";
    when"0011"=>dout<="0000110";
    when"0100"=>dout<="1001100";
    when"0101"=>dout<="0100100";
    when"0110"=>dout<="0100000";
    when"0111"=>dout<="0001111";
    when"1000"=>dout<="0000000";
    when"1001"=>dout<="0000100";
    when others=>dout<="0001000";
end case;
end process;
end rtl;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?