Forum: FPGA, VHDL & Verilog Error in VHDL

von vhdl n. (Company: none) (pranoy)

Rate this post
0 useful
not useful
library ieee;
    use ieee.std_logic_1164.all;
    entity enc_ent is
        port(enable:in std_logic;
            d:in std_logic_vector(7 downto 0);
            y:out std_logic_vector(2 downto 0)
        architecture enc_arc of enc_ent is
            if(enable='1') then
            case d is
            when "00000001"=> y<="000";
            when "00000010"=> y<="001";
            when "00000100"=> y<="010";
            when "00001000"=> y<="011";
            when "00010000"=> y<="100";
            when "00100000"=> y<="101";
            when "01000000"=> y<="110";
            when others=> y<="111";
            end case;
            end if;
            end process;
     end enc_arc; 

this is my code

but i get this error message.

encoder.vhd(9): near "architecture": expecting: END

can u tell what is the problem?

von Klappskalli (Guest)

Rate this post
0 useful
not useful
end of entity is missing

von vhdl n. (Company: none) (pranoy)

Rate this post
0 useful
not useful


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.