R
Rob Granger
Guest
Hi
I have just written a simple mux module, which selects one of 4 signals.
So I have a 2 bit select signal. But strangely the compiler gives me the
following message:
# ** Error: mux.vhd(18): Case statement covers only 4 out of 81 cases.
# ** Error: mux.vhd(25): VHDL Compiler exiting
# C:/Modeltech_pe_edu_6.3c/win32pe_edu/vcom failed.
Why 81 cases? I just have 4 different ones for the sel?
Thanks!
library ieee;
use ieee.std_logic_1164.all;
entity MUX is
port( I0 : in std_logic_vector(3 downto 0);
I1 : in std_logic_vector(3 downto 0);
I2 : in std_logic_vector(3 downto 0);
I3 : in std_logic_vector(3 downto 0);
sel : in std_logic_vector(1 downto 0);
dout: out std_logic_vector(3 downto 0)
);
end MUX;
architecture behave of MUX is
begin
process(I0, I1, I2, I3, sel)
begin
case sel is
when "00" => dout <= I0;
when "01" => dout <= I1;
when "10" => dout <= I2;
when "11" => dout <= I3;
end case;
end process;
end behave;
I have just written a simple mux module, which selects one of 4 signals.
So I have a 2 bit select signal. But strangely the compiler gives me the
following message:
# ** Error: mux.vhd(18): Case statement covers only 4 out of 81 cases.
# ** Error: mux.vhd(25): VHDL Compiler exiting
# C:/Modeltech_pe_edu_6.3c/win32pe_edu/vcom failed.
Why 81 cases? I just have 4 different ones for the sel?
Thanks!
library ieee;
use ieee.std_logic_1164.all;
entity MUX is
port( I0 : in std_logic_vector(3 downto 0);
I1 : in std_logic_vector(3 downto 0);
I2 : in std_logic_vector(3 downto 0);
I3 : in std_logic_vector(3 downto 0);
sel : in std_logic_vector(1 downto 0);
dout: out std_logic_vector(3 downto 0)
);
end MUX;
architecture behave of MUX is
begin
process(I0, I1, I2, I3, sel)
begin
case sel is
when "00" => dout <= I0;
when "01" => dout <= I1;
when "10" => dout <= I2;
when "11" => dout <= I3;
end case;
end process;
end behave;