Jump to content

VHDL

- - - - -

  • Please log in to reply
8 replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 429 posts
What the result of this "if"?

[/COLOR][/SIZE][/FONT]variable a : std_logic_vector(4 downto 0) := (others => '0');
variable b : std_logic_vector(31 downto 0
[FONT=arial, sans-serif][SIZE=5][COLOR=#333333]
[/COLOR][/SIZE][/FONT]if b /= a then[FONT=arial, sans-serif][SIZE=5][COLOR=#333333]





#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
This looks like homework. We'll help with homework, but we won't do it for you. Do you know what /= does?
sudo rm -rf /

#3
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 429 posts

dargueta said:

This looks like homework. We'll help with homework, but we won't do it for you. Do you know what /= does?

This is exactly what I'm asking. I know in C:
a /=b ==> a = a / b

But I do not know what is checked in the "if"



#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Google is your friend. :)

VHDL Operators
sudo rm -rf /

#5
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 429 posts
Thanks

dargueta said:

Google is your friend. :)

VHDL Operators


#6
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,252 posts
  • Location:C:\Countries\US
Generally, in C, the following code would output 'abcd' :
int a; 

if (a= 0) printf ("dcba"); 

else printf ("abcd"); 

Whatever's inside the parentheses would get executed, and then the result gets compared to anything that can be defined as 'nothing' .

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
/= is equivalent to != in C.
sudo rm -rf /

#8
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,252 posts
  • Location:C:\Countries\US

dargueta said:

/= is equivalent to != in C.

Are you sure it's C?

#9
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200

RhetoricalRuvim said:

Are you sure it's C?
/= in VHDL, not /= in C.

If I were to guess, I believe they try to describe the symbol ≠ (not equal) with slash-equal.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users