INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

how to read this code

how to read this code

(OP)
Hi,
I am a beginner in vhdl, struggling with vhdl programming. I am currently reading books and trying to understand code by other authors. i have to understand a code structure like this:

CODE --> VHDL

entity declaration

architecture behavioral of entity is

signal declarations:

signal(0) <= '1' when signal_1(0)='0' and signal_2(0)='1' else '0';
signal(1) <= '1' when signal_1(1)='0' and signal_2(1)='1' else '0';
signal(2) <= '1' when signal_1(2)='0' and signal_2(2)='1' else '0';
signal(3) <= '1' when signal_1(3)='0' and signal_2(3)='1' else '0';

inport <=  data_in and not signal;

signal_4(0) <= '1' when signal(0)='0' and signal_2(0)='1' else '0';
signal_4(1) <= '1' when signal(1)='0' and signal_2(1)='1' else '0';
signal_4(2) <= '1' when signal(2)='0' and signal_2(2)='1' else '0';
signal_4(3) <= '1' when signal(3)='0' and signal_2(3)='1' else '0';

inport_1 <= signal or signal_4;

process(clk)
do something here
.
.
end  process

end behavioral 

my questions are:

  • how this code will work, for behavioral part all statements execute concurrently, but signal_4 depends on signal so will second when-else would wait for signal computation?
  • how inport would be computed, concurrently or sequentially?
  • are all when else for signal computed simultaneously?
  • if i want to count how many bits of signal are turning to '1' after all 4 bits are computed is the 1's counter after when else for signal is the only way to do it? can i somehow count 1's within the when else?
  • if i want the same number of bits to go high for signal and signal_4, how can i do it?
  • if there are more than one processes in a code will they execute concurrently as well, i understand that process executes seuqentially and is executed when sentivity list signals change?
I appreciate any help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close