encoder : syntax error..help !! urgent exam knocking at the door !! :(

38 views
Skip to first unread message

pratyush

unread,
Apr 9, 2012, 1:29:02 PM4/9/12
to modelsim-pe-s...@googlegroups.com
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 ;




** 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 erros i cannot find anything wrong ..plzz help!! i
Reply all
Reply to author
Forward
0 new messages