Simple question

V

VHDL_lover

Guest
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
 
VHDL_lover wrote:
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.
 
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
 

Welcome to EDABoard.com

Sponsor

Back
Top