To determine whether a 32 bit number is even or odd we need to check the LSB of that number.
If least significant bit of the number is 0 then it is even otherwise it is odd.
So in the incoming 32 bit numbers we just have to check the Least significant bit of the number and we should be able to check the same.
This is the most optimal solution in terms of hardware design or software compilation.
If least significant bit of the number is 0 then it is even otherwise it is odd.
So in the incoming 32 bit numbers we just have to check the Least significant bit of the number and we should be able to check the same.
This is the most optimal solution in terms of hardware design or software compilation.
0 comments:
Post a Comment