hi all; i want to detect if the lsb is odd or even for integer data . how can i do it in vhdl code
You can use the "mod" operator. http://www.csee.umbc.edu/portal/help/VHDL/operator.html
if (myinteger mod 2 = 1) then -- odd else -- even end if;
Alternatively you can first convert to unsigned type and then check the lowest bit.
myunsigned <= to_unsigned(myinteger, length); if (myunsigned(0) = '1') then -- odd else -- even end if;
: Edited by User