minimum number calculation in the integers set

Status
Not open for further replies.

K.S.GANESH KUMAR

Newbie level 3
Joined
Sep 5, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Tamilnadu
Visit site
Activity points
30
hi,
can anyone send VHDL code for calculating minimum.
example :v1=3,v2=4,v3=5,v4=1,v5=6,v6=8,v7=5,v8=10. the minimum no is 1.
i need VHDL code for this minimum calculation.
i have one solution using if then else concept.but i want to use loop or other method.am also try loop concept but the code has some error.
so anyone tell the code concept plz..

Thanks.
 

you would need to declare a type for an integer_array:

type integer_array is array(natural range <>) of integer;

from there you could write a function:
function min(x : integer_array) return integer;

You can use the for loop in the function body.
 

Also you can use loop in a process.

for this method you can add a variable to process and use a for loop to find the minimum.
Then assign it to a whatever you want
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…