0

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?

4
  • 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. Commented Jan 4, 2017 at 12:55
  • 3
    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) Commented Jan 4, 2017 at 12:56
  • Rows 3 and 4 just look like a (combinational) expression. Should it be driving something? Commented Jan 4, 2017 at 13:14
  • 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. Commented Jan 4, 2017 at 20:18

1 Answer 1

0

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);
Sign up to request clarification or add additional context in comments.

1 Comment

I don't get your edit. The code you added does not match the OP question. Furthermore, this question is 16 months old!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.