rambleach
Junior Member level 1
this is a program for 2^n to n priority encoder
these are compilation errors i cannot find anything wrong ..plzz help!! i
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity encoder is generic (n:positive); port (a:in std_logic_vector(2**n-1 downto 0); z:out std_logic_vector(n-1 downto 0); v:out std_logic); end entity encoder; architecture exm1 of encoder is begin prc:process(a) is v<='0'; z<=(others=>'0'); for k in a'range loop if a(k)='1' then z<=std_logic_vector(to_unsigned (k,n)); v<='1'; exit; end if; end loop; end process prc; end architecture exm1 ;
Code:
** Error: C:/Modeltech_pe_edu_10.1a/examples/encoder.vhd(16): near "v": syntax error
** Error: C:/Modeltech_pe_edu_10.1a/examples/encoder.vhd(18): near "in": expecting ':'
these are compilation errors i cannot find anything wrong ..plzz help!! i
Last edited by a moderator: