VHDL Conditionals (in if then) using "=" vs ":=" [closed] - vhdl

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I'm getting an error in my VHDL 1993 code which I cannot solve in the following code line:
if (((cur_stap2 := IDLE) or (cur_stap2 := MDLE)) AND (txe_n = '0') AND (wr_n = '1')) then
VHDL compiler issues an error with this statement:
Error (10500): VHDL syntax error at mst_fifo_fsm.vhd(123) near text ":="; expecting ")", or ","
IDLE, MDLE are states which are declared with this lines of code:
type states is (IDLE, MTRD, MDLE, MTWR);
signal current_state, next_statem, cur_stap1, cur_stap2, cur_stap3, cur_stap4 : states;
txe_n and wr_n are normal signals with type std_logic.
Can you please tell me what is the correct way of checking if these conditions are met?
Thank you in advance
using Intel Quartus 17.0

Your code uses a ":=" where it needs an "=". Your code corrected is:
if (((cur_stap2 = IDLE) or (cur_stap2 = MDLE)) AND (txe_n = '0') AND (wr_n = '1')) then
":=" is for variable assignment and initialization in declarations. "=" is for comparison.
Note: Compilers do not have AI. The way to read this error message (and any error message in general) is "Dear user, I found ":=" and I died. I think the reason is ..." Note sometimes the "..." is useful, sometimes it is not. So in this case, it correctly told you, don't use ":=" here.

Related

vbscript minus operator marked as invalid character [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I have a very simple equation in vbscript/asp. I get error on minus operator. I even had to add 0 in start of equation because I got same error at first one too.
y = 0 - (0.0114 * (x^2)) − (0.2396 * x) + 112.57
Microsoft VBScript compilation error '800a0408'
Invalid character
y = 0-(0.0114 * (x^2))-(0.2396 * x)+112.57
----------------------------^
The character between the x^2)) and the (0.2396 does not look like the character between the 0 and the (0.0114. It is likely an en dash, not a minus/hyphen. Fix that. Do not use Word or other word processor for creating code; the smart replacement of dashes and quotes will cause problems with code. Use a text editor like Notepad or Notepad++ instead.

unexpected tidentifier expecting keyword_end [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I've got a problem in Ruby, "unexpected tidentifier expecting keyword_end", how Can I solve it?
def riko(user)
if user.name.eql? 'Mia Khalifa Fan'
#client.send_msg 'Hola Mia <3 ¿Cómo te trato este dia, cosa guapa y sensual?',
else
if user.mame.eql? 'Skul Goy'
#client.send_msg 'Muerete. '
else
#client.send_msg "Hola #{user.name} o/ \ :v / "
end
end
You're using else if which works fine in other languages, but in Ruby represents 2 distinct conditionals. You probably want to replace it with elsif instead, which is the Ruby equivalent.

Ruby syntax error with declarative concept of using variable [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I am trying to use the reactive programming concept in ruby, I have create two block of code:
1 Imperative
a = 5, b = 2
c = a + b
print c #=> 7
a = 2
print c #=> 7
2 Declarative
a := 5, b := 2
c := a + b
print c #=> 7
a := 2
print c #=> 4
However second example doesn't work for me and give the below error:
d.rb:1: syntax error, unexpected '=', expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
a := 5, b := 2
^
Please anyone help me to find out the error in the code. Any suggestion will be highly appreciated.
I know the second one is pseudo code but one thing surprise me that top score person make it off topic? The second code can also be executed using Reactive Library and top score programmer don't aware about it.
The := is not valid Ruby.
The error message is because symbols are represented by leading colons so :example is a symbol (compare to "example" which is a string).
So encountering : Ruby expects a valid beginning character for a symbol, which would be any of...
#$_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Middle characters can be...
_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
And the last character can be...
!_=?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
So = is never a valid symbol character.
The article you reference is showing pseudo-code not actual Ruby.

syntax error, unexpected keyword_end, expecting end-of-input [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I have this code:
Class Card
def initialize(suit, number)
#suit = suit
#number = number
end
end
I am getting the error message:
/go_fish/lib/Card.rb:8 syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
Any suggestions or stuff I'm missing?
Your error is the first char in the first line. class should be lowercase...
class Card
def initialize(suit, number)
#suit = suit
#number = number
end
end
Furthermore you may want to follow common rules for coding styles in Ruby. To do so change the file name to card.rb (again lowercase), same with require. And it is common to indent with just two whitespace characters in Ruby files.

PLS-00103 Encountered the symbol " " error in CASE [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have simply written CASE statement in the procedure as below
(case when (T1.DEVICEHOLD = 'Z1' or T2.ISHOLD = 1) then 1
else 0
END) AS HOLD
But when I'm compling procedure its giving an error Compilation errors for PACKAGE BODY
Error: PLS-00103: Encountered the symbol "Z1" when expecting one of the following:
* & = - + ; at in is mod remainder not rem
or != or ~= >= and or like LIKE2_
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
The symbol "* was inserted before "Z1" to continue.
Could anyone help me to resolve this?
Thanks in advance!
This is a compiler error. The most likely cause is a stray ' somewhere which means that the first ' in your snippet terminates a quoted string and so the compiler considers Z1 to be code, and not valid as such.
The easiest way to spot such things is to use a decent editor or IDE which has syntax highlighting. These tools colourize quotes, keywords and comments and so make it easy to spot where we have made our bloomers. There are plenty of free tools available: Notepad++ or Oracle SQL Developer are popular options.

Resources