|
Message
From: Michael Hordijk<hoffbrinkle@h...>
Date: Wed Apr 20 18:43:02 CEST 2005
Subject: [oc] Re: Operations within a vector
"Roberto Ammendola" <roberto.ammendola@r...> wrote in message news:42665168.3010505@r...... > global_b <= b(0) or b(1) or ... or b(PARAMETER-1) or b(PARAMETER); > > So, how would you calculate global_b, keeping the parametric feature in > your code?
You could always use the or_reduce function in std_logic_misc if you have the appropriate data types, or write your own which would be similar to the other reply already posted:
---------------
function or_reduce ( vec : std_logic_vector ) return std_logic is variable result : std_logic := '0'; begin for i in vec'range loop result := result or vec(i); end loop; end function or_reduce;
---------------
global_b <= or_reduce(b);
---------------
That's what I do, because I'm usually not working with std_logic_vector data types.
- hoffer
|
 |