We get this error set:
Line 23: Mismatch in number of elements assigned in conditional signal assignment
Line 23: Expression has 1 elements ; expected 7
With this code, line 23 is
Q_out <= "1111110" when Q_in = "0000" else
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity decoder is
Port (
Q_in : in UNSIGNED (3 downto 0);
Q_out : out UNSIGNED (6 downto 0)
);
end decoder;
architecture behavioral of decoder is
begin
Q_out <= "1111110" when Q_in = "0000" else
"0110000" when Q_in = "0001" else
"1101101" when Q_in = "0010" else
"1111001" when Q_in = "0011" else
"0110011" when Q_in = "0100" else
"1011011" when Q_in = "0101" else
"0011111" when Q_in = "0110" else
"1110000" when Q_in = "0111" else
"1111111" when Q_in = "1000" else
"1110011" when Q_in = "1001" else
"X";
end behavioral ;