Function of "&" before a variable

L

Luiz Gustavo

Guest
What's the function of the "&" in this line:

if (&bit_cnt)
sro <= #1 mem[mem_adr];

Thanks
 
Luiz Gustavo wrote:
What's the function of the "&" in this line:

if (&bit_cnt)
sro <= #1 mem[mem_adr];
It is called a "reduction AND". It is a unary operator that ANDs
together all the bits in a vector to produce a 1-bit result. So it is
basically testing whether all the bits in bit_cnt are 1.
 

Welcome to EDABoard.com

Sponsor

Back
Top