Altera_Forum
Honored Contributor
14 years agoconv_std_logic_vector
I have the following code but after compiling it said there is error in conv_std_logic_vector , can someone help me ??
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.NUMERIC_STD.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity QuadratureDecoder is Port ( QuadA : in STD_LOGIC; QuadB : in STD_LOGIC; Clk : in STD_LOGIC; Position : out STD_LOGIC_VECTOR (7 downto 0)); end QuadratureDecoder; architecture Behavioral of QuadratureDecoder is signal QuadA_Delayed: STD_LOGIC_VECTOR(2 downto 0) := "000"; signal QuadB_Delayed: STD_LOGIC_VECTOR(2 downto 0) := "000"; signal Count_Enable: STD_LOGIC; signal Count_Direction: STD_LOGIC; signal Count: STD_LOGIC_VECTOR(7 downto 0) := "00000000"; begin process (Clk) begin if Clk='1' and Clk'event then QuadA_Delayed <= (QuadA_Delayed(1), QuadA_Delayed(0), QuadA); QuadB_Delayed <= (QuadB_Delayed(1), QuadB_Delayed(0), QuadB); if Count_Enable='1' then if Count_Direction='1' then Count <= Count + 1; Position <= conv_std_logic_vector(Count, 8); //compile wrongly else Count <= Count - 1; Position <= conv_std_logic_vector(Count, 8); //compile wrongly end if; end if; end if; end process; Count_Enable <= QuadA_Delayed(1) xor QuadA_Delayed(2) xor QuadB_Delayed(1) xor QuadB_Delayed(2); Count_Direction <= QuadA_Delayed(1) xor QuadB_Delayed(2); end Behavioral;