Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Project 3 explored a fast solution to x mod y using the \"and\" logical operatio

ID: 3579572 • Letter: P

Question

Project 3 explored a fast solution to x mod y using the "and" logical operation x^mask constant. The project called for checking that y was a power of two by testing that y^(y - 1) = 0 Given that x = 32 = (0001 0000)_2, derive the binary representation of the mask, perform the A operation, and enter the decimal representation of the mask and the result. Show your work. 32 mod 16 = 32^= Given that x = 129 = (1000 0001)_2, derive the binary representation of y. perform the^operation, and enter the decimal representation of y and the result. Show your work. 129 mod = 129^127 =

Explanation / Answer

Solution :

If the either of the bits are set to 1 then the result is 1.
If both the bits are 0 or both the bits are 1 then the result is set as 0.
Thus the result of a ^ b=1