0
votes

I have the following code:

DATA_LCD <= DATA_ROM when SW(1)='0' or char_code<97 or char_code>122 else
                 std_logic_vector(char_code-32); -- no modification in this code
                     DATA_ROM when SW(2)='0' else
                     std_logic_vector(char_code+1);

But when i try to compile it i get following errors:

Error (10500): VHDL syntax error at LCD_FSM.vhd(57) near text "="; expecting "(", or "'", or "."

Error (10500): VHDL syntax error at LCD_FSM.vhd(57) near text "when"; expecting "(", or "'", or "."

How can I fix it?

1
It could be good to have more information, especially on the signal definition. But basically the second DATA_ROM just comes from nowhere, I don't get what you're trying to do there. - A. Kieffer
No more information needed. The third line is the start of a new (malformed) statement. (There was probably supposed to be another "when" clause on the second line) - user_1818839
Rows 3 and 4 just look like a (combinational) expression. Should it be driving something? - Yann Vernier
So what does SW(1) and SW(2) signify? The first condition expression appears to relate to an HD44780U type LCD controller (2 or 4 line LCD display). Fixing it requires understanding what it's supposed to do - you have two else condition values shown. - user1155120

1 Answers

0
votes

Brian is right, line 3 is a new (malformed) statement. You forgot to put another DATA_LCD <= at the beginning of it.

DATA_LCD <= DATA_ROM when SW(2)='0' else std_logic_vector(char_code+1);