Simple question

V

VHDL_lover

Hi guys

I have very simple question but I am looking for best way to implement
this ,as I need this function so many time in my application.

I have four Numbers A,B ,C,D

I want to find minimun number out of these.

I was wondering if there is any in built function for this.

Like
Ans = min(A,B,C,D)

thanks
 
D

David Bishop

VHDL_lover said:
Hi guys

I have very simple question but I am looking for best way to implement
this ,as I need this function so many time in my application.

I have four Numbers A,B ,C,D

I want to find minimun number out of these.

I was wondering if there is any in built function for this.

Like
Ans = min(A,B,C,D)

Good question.

In the VHDL-200x-ft update, you will see that we are making the
following function implicit for all data types:

function minimum (L, R).

(you can't use "min", because in the type "time" there is a unit called
"min" (minute).)

Thus you can do this, you just have to call it several times, either
like this:

minimum (minimum(A, B), minimum (C, D))

Or, you could call it recursively.
 
V

VHDL_lover

Thanks for you reply,
I am using modelsim 4.4 ,When I use this function ,it is giving error.

May be this is not included in this version ,
Any other help would be aprreciated.
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top