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.

[SOLVED] Problem in writing WHEN statement in vhdl

Status
Not open for further replies.

er.akhilkumar

Advanced Member level 4
Joined
Feb 1, 2011
Messages
115
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Noida
Activity points
2,381
Hello All,

Can we execute two commands in one when statement as following

A <= B WHEN C = '1' ELSE
'0';

In the above code if else condition comes I want that an assertion shall also fire. Can we execute two statements in one when statement. Actually I don't want to use PROCESS for implementing this logic.

Please provide your comments. thanx
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
5,180
Helped
1,118
Reputation
2,248
Reaction score
1,123
Trophy points
1,393
Location
California, USA
Activity points
28,355
Why don't you want to use a process? That sounds pretty arbitrary.

You could also use two separate WHEN statements, right?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,515
Helped
14,270
Reputation
28,805
Reaction score
12,973
Trophy points
1,393
Location
Bochum, Germany
Activity points
280,589
Do you actually mean an assert statement? It don't understand how it's related to the conditional assignment? It woul be placed as an concurrent independent statement.
 

er.akhilkumar

Advanced Member level 4
Joined
Feb 1, 2011
Messages
115
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Noida
Activity points
2,381
I can write process also...bt I want to write small code...can we write two statements in one WHEN statement?

Consider it as an experiment
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,515
Helped
14,270
Reputation
28,805
Reaction score
12,973
Trophy points
1,393
Location
Bochum, Germany
Activity points
280,589
Why don't you tell the exact WHEN construct you imagine? In my view, the syntax rules for the conditional assignment statement are pretty clear.
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
5,180
Helped
1,118
Reputation
2,248
Reaction score
1,123
Trophy points
1,393
Location
California, USA
Activity points
28,355
I can write process also...bt I want to write small code...can we write two statements in one WHEN statement?

Consider it as an experiment

Writing 'small code' has NO bearing on the final output; you're ultimately creating hardware NOT writing software. 'Small code' is usually hard-to-understand code. I think the answer to your question is:


No, you can't have two assignments in a single WHEN statement.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top