Код: Выделить всё
entity device is
generic (tailless : integer := 0);
Port ( clk : in STD_LOGIC;
anode : out STD_LOGIC_VECTOR (3 downto 0);
cathode : out STD_LOGIC_VECTOR (7 downto 0));
end device;
architecture Behavioral of device is
signal clk_div : std_logic_vector (9 downto 0) := (others => '0');
signal data : std_logic_vector (3 downto 0) := (others => '0');
constant digit_0:std_logic_vector := "0111111";
constant digit_1:std_logic_vector := "0000110";
constant digit_2:std_logic_vector := "1011011";
constant digit_3:std_logic_vector := "1001111";
constant digit_4:std_logic_vector := "1100110";
constant digit_5:std_logic_vector := "1101101";
constant digit_6:std_logic_vector := "1111101";
constant digit_7:std_logic_vector := "0000111";
объявить еще одну константу и дальше делать подмену, тоже как-то некузяво. Как тут вставить?
Код: Выделить всё
with data select
cathode(6 downto 0) <= digit_0 when "0000",
digit_1 when "0001",
digit_2 when "0010",
digit_3 when "0011",
digit_4 when "0100",
digit_5 when "0101",
digit_6 when "0110",
digit_7 when "0111",
digit_8 when "1000",
digit_9 when "1001",
