lchtan
Newbie level 3
I'm encountering some difficulties in my programming VHDL, the system(Quartus II Version6.1) points there're syntax error in my code, but I don't know where is the mistakes. Please help me ,thanks!!!!!
Error (10500): VHDL syntax error at test.vhd(29) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(36) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(43) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(50) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(57) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(64) near text "<="; expecting "then"
my code is as follows:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
ENTITY first IS
PORT
(
SECTOR1 : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
COUNT : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
A : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
B : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
--C : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
PWM_CSR : OUT STD_LOGIC_VECTOR(5 DOWNTO 0)
);
END first;
ARCHITECTURE rtl OF first IS
BEGIN
CMP1ROCESS(SECTOR1, COUNT, A, B)
BEGIN
CASE SECTOR1 IS
WHEN "001" => IF COUNT<=A THEN
PWM_CSR<="100001";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="110000";
ELSE
PWM_CSR<="100100";
END IF;
WHEN "010" => IF COUNT<=A THEN
PWM_CSR<="110000";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="011000";
ELSE
PWM_CSR<="010010";
END IF;
WHEN "011" => IF COUNT<=A THEN
PWM_CSR<="011000";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="001100";
ELSE
PWM_CSR<="001001";
END IF;
WHEN "100" => IF COUNT<=A THEN
PWM_CSR<="001100";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="000110";
ELSE
PWM_CSR<="100100";
END IF;
WHEN "101" => IF COUNT<=A THEN
PWM_CSR<="000110";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="000011";
ELSE
PWM_CSR<="010010";
END IF;
WHEN "110" => IF COUNT<=A THEN
PWM_CSR<="000011";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="100001";
ELSE
PWM_CSR<="001001";
END IF;
WHEN OTHERS=> NULL;
END CASE;
END PROCESS CMP1;
END rtl;
Added after 46 minutes:
Please help me, I'm waiting online! thanks
Error (10500): VHDL syntax error at test.vhd(29) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(36) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(43) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(50) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(57) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(64) near text "<="; expecting "then"
my code is as follows:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
ENTITY first IS
PORT
(
SECTOR1 : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
COUNT : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
A : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
B : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
--C : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
PWM_CSR : OUT STD_LOGIC_VECTOR(5 DOWNTO 0)
);
END first;
ARCHITECTURE rtl OF first IS
BEGIN
CMP1ROCESS(SECTOR1, COUNT, A, B)
BEGIN
CASE SECTOR1 IS
WHEN "001" => IF COUNT<=A THEN
PWM_CSR<="100001";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="110000";
ELSE
PWM_CSR<="100100";
END IF;
WHEN "010" => IF COUNT<=A THEN
PWM_CSR<="110000";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="011000";
ELSE
PWM_CSR<="010010";
END IF;
WHEN "011" => IF COUNT<=A THEN
PWM_CSR<="011000";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="001100";
ELSE
PWM_CSR<="001001";
END IF;
WHEN "100" => IF COUNT<=A THEN
PWM_CSR<="001100";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="000110";
ELSE
PWM_CSR<="100100";
END IF;
WHEN "101" => IF COUNT<=A THEN
PWM_CSR<="000110";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="000011";
ELSE
PWM_CSR<="010010";
END IF;
WHEN "110" => IF COUNT<=A THEN
PWM_CSR<="000011";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="100001";
ELSE
PWM_CSR<="001001";
END IF;
WHEN OTHERS=> NULL;
END CASE;
END PROCESS CMP1;
END rtl;
Added after 46 minutes:
Please help me, I'm waiting online! thanks
lchtan said:I'm encountering some difficulties in my programming VHDL, the system(qu(at)rtus II Version6.1) points there're syntax error in my code, but I don't know where is the mistakes. Please help me ,thanks!!!!!
Error (10500): VHDL syntax error at test.vhd(29) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(36) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(43) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(50) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(57) near text "<="; expecting "then"
Error (10500): VHDL syntax error at test.vhd(64) near text "<="; expecting "then"
my code is as follows:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
ENTITY first IS
PORT
(
SECTOR1 : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
COUNT : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
A : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
B : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
--C : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
PWM_CSR : OUT STD_LOGIC_VECTOR(5 DOWNTO 0)
);
END first;
ARCHITECTURE rtl OF first IS
BEGIN
CMP1ROCESS(SECTOR1, COUNT, A, B)
BEGIN
CASE SECTOR1 IS
WHEN "001" => IF COUNT<=A THEN
PWM_CSR<="100001";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="110000";
ELSE
PWM_CSR<="100100";
END IF;
WHEN "010" => IF COUNT<=A THEN
PWM_CSR<="110000";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="011000";
ELSE
PWM_CSR<="010010";
END IF;
WHEN "011" => IF COUNT<=A THEN
PWM_CSR<="011000";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="001100";
ELSE
PWM_CSR<="001001";
END IF;
WHEN "100" => IF COUNT<=A THEN
PWM_CSR<="001100";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="000110";
ELSE
PWM_CSR<="100100";
END IF;
WHEN "101" => IF COUNT<=A THEN
PWM_CSR<="000110";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="000011";
ELSE
PWM_CSR<="010010";
END IF;
WHEN "110" => IF COUNT<=A THEN
PWM_CSR<="000011";
ELSIF A<COUNT<=A+B THEN
PWM_CSR<="100001";
ELSE
PWM_CSR<="001001";
END IF;
WHEN OTHERS=> NULL;
END CASE;
END PROCESS CMP1;
END rtl;