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.

signal change in VHDL

Status
Not open for further replies.

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
vhdl detect signal change

How to detect a std_logic_vector change?
I see I can not use the " 'change " attribute because it is not synthesizable.
 

m_kartik

Newbie level 6
Joined
Feb 7, 2006
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
vhdl signal change

what you can do is, delay the signal by 1 clock cycle and then perform XOR with delayed signal

let us assume that y be your std_logic_vector and f1_y be the delayed signal

detect_change <= f1_y XOR y;

whenever there is a change in y, there will be a pulse on detect_change

hope this will help...
 

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
signal change vhdl

How will I make the delay?
 

m_kartik

Newbie level 6
Joined
Feb 7, 2006
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
process changing vhdl

here is a sample code...

PROCESS(clk, rst)
BEGIN
IF (rst = '1') THEN
f1_y <= (OTHERS => '0');
ELSIF (clk'EVENT AND clk = '1') THEN
f1_y <= y;
END IF;
END PROCESS;

f1_y is delayed signal of y
 

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
vhdl delayed version of a signal

So, then I have to check weather f1_y = y in a different process right?
 

m_kartik

Newbie level 6
Joined
Feb 7, 2006
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
signal change vhdl

no you don't need to place it in a different process, which will make another clock cycle delay...

detect_change <= f1_y XOR y;
you can do this outside the process
 

nee_naresh04

Member level 2
Joined
Dec 15, 2005
Messages
47
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,657
vhdl change

put another process in ur programme like

process(anai)
c <= a and anai;
end process;

where anai is the logic vector u defined..and choose " a <= '1' "..observe c at the out put...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top