Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > how to write a conditional assignment over generic or constant?

Reply
Thread Tools

how to write a conditional assignment over generic or constant?

 
 
sm.soimu@gmail.com
Guest
Posts: n/a
 
      04-24-2006
Hello,

I would like to write in VHDL an equivalent code for:

parameter INSTANCE = 1;
parameter DATA_WIDTH = (INSTANCE == 1) ? 8 : 16;

The equivalent for parameter statement should be generic or constant,
but I see no way to write the equivalent VHDL code for the above
VERILOG code.

Can anyone suggest any way to write it?

Thank you in advance!

Regards,
Sorin SOIMU

 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      04-24-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> parameter INSTANCE = 1;
> parameter DATA_WIDTH = (INSTANCE == 1) ? 8 : 16;
> Can anyone suggest any way to write it?


Write your own function.
http://groups.google.com/groups/sear...nction+big_int

-- Mike Treseler
 
Reply With Quote
 
 
 
 
sm.soimu@gmail.com
Guest
Posts: n/a
 
      04-25-2006
Thanks Mike! It worked.

Regards,
Sorin

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VOIP over VPN over TCP over WAP over 3G Theo Markettos UK VOIP 2 02-14-2008 03:27 PM
Conditional "FOR..GENERATE" generic construct? Pasacco VHDL 3 05-18-2007 04:42 PM
Generic logic/conditional class or library for classification of data Basilisk96 Python 4 04-03-2007 07:39 AM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
Help: conditional attribute assignment itsme VHDL 1 07-23-2003 03:26 PM



Advertisments