Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Basics of VHDL. Whats happening here?

 
Thread Tools Search this Thread
Old 06-01-2009, 05:01 PM   #1
Default Basics of VHDL. Whats happening here?


I just started to learn VHDL so kindly support me
I'm getting confused between how <= and := symbols actually work? I know that they have a major difference but I cant really make out as I'm from s/w background.

For example in the following code, when do :=, <= statements execute? Please don't stop at saying one is sequential and other is concurrent, that is where I'm not able to understand please explain more with small examples and other possibilities. I really learn fast with examples.

Also can you please explain to me whats happening in this code? I'm really lost.

******** Code****************
architecture twoproc of test is
signal r, rin : std_logic_vector(7 downto 0);
begin

combinational : process(load, count, d, r)
variable tmp : std_logic_vector(7 downto 0);
begin
if load = ’1’ then tmp := d;
elsif count = ’1’ then tmp := r + 1;
else tmp := r; end if;
rin <= tmp;
q <= r;
end process;

sequential : process(clk)
begin
if rising_edge(clk) then r <= rin; end if;
end process;
end;
*******************************


Thank you all so very much!!!


vikramtheone
vikramtheone is offline   Reply With Quote
Old 06-01-2009, 09:56 PM   #2
jeppe
Senior Member
 
Join Date: Mar 2008
Location: Denmark
Posts: 245
Default
Well you found one the "cornerstones" of VHDL - the difference between signals and variables.

A signal will not get its value before the process ends while the variable gets its value immediate (as in C++, Java, C# etc.)

I you add "r" to the sensitivity list will your code work nicely. The problem is that "r" must be able to
trigger the process in order to pass the value to q.
But I will surgest that you pass rin directly to q in the clk-driven process.

Please search for the free interactive book on VHDL Evita from aldec. Specially chapter 6 will answer your questions.

Your welcome
Jeppe


jeppe

Last edited by jeppe : 06-01-2009 at 10:02 PM.
jeppe is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Releases: Blood Soaked Cinema, What's Happening & Robots: Updated complete R1 DVD DB & info lists Doug MacLean DVD Video 0 06-21-2005 06:10 AM
Re: What's Happening!! Season 1 DVD Set Review @ GENRE ONLINE.NET! Justin DVD Video 75 02-11-2004 12:46 PM
What's Happening!! DVD Set Review @ GENRE ONLINE.NET Writer R5 DVD Video 0 02-02-2004 01:19 AM
Suddenly, SPAM and BULK MAIL Flooding. What is happening? Tony A+ Certification 4 09-26-2003 04:45 AM
Re: whats happening to the IT industry? just a gigalo A+ Certification 3 06-30-2003 12:53 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46