Altera_Forum
Honored Contributor
13 years agoError with VHDL compilation
Hello, I tried for an hour to solve this problem...lets see if u can help me!
here is the code: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ieee.std_logic_unsigned.all; library std; use std.standard.all; entity Calculador is port( a : in std_logic_vector (3 downto 0); b : in std_logic_vector (3 downto 0); Selop : in std_logic_vector (1 downto 0); z1 : out std_logic_vector (3 downto 0); z2 : out std_logic_vector (3 downto 0)); end Calculador; architecture a of Calculador is begin case Selop is when "00" => z1 <= a; z2 <= b; when "01" => z1 <= a; z2 <= a; when "10" => z1 <= b; z2 <= b; when "11" => z1 <= a; z2 <= b; end case; end a; and it gives me this error: Error (10500): VHDL syntax error at opc.vhd(RED LINES) near text "when"; expecting "end", or "(", or an identifier ("when" is a reserved keyword), or a concurrent statement and this one: Error (10500): VHDL syntax error at opc.vhd(BLUE LINES) near text "case"; expecting ";", or an identifier ("case" is a reserved keyword), or "architecture" What am I doing wrong? Thanks