Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL process fundamentals

Status
Not open for further replies.

Ripatti

Newbie level 1
Joined
Mar 9, 2017
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
8
Hi,

I'm new with logic design and simply don't get my process behaviour. I don't understand why adding a line:"temp1 <= '0';" affects to LED blink frequency?
Yes, I know that this code does not make sense, but it is just an example. I think that if-statement should always be true, since I set temp1 to 1 just before it, but apparently it is not!

Code:
*************************
process (clk)
begin
	if rising_edge(clk) then
		temp1 <= '1';
		if(temp1 = '1') then
			temp1 <= '0'; -- if this line is added, then LED blink half as fast

			if temp2 = '1' then
				LED <= '0';
		                temp2 <= '0';
			else
				LED <= '1';
		                temp2 <= '1';
			end if;
		end if;
	end if;
end process;
****************************
 
Last edited by a moderator:

If temp1 was '0' before, then on the first clock edge temp1 will be '0', and '1' on the next clock edge. Signals are only updated when process suspend - assignments to them only schedule the value to be assigned at some point in the future. This is opposite to variables, which are updated immediately.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top