16. Bitwise Operations-III

Question.5

An 8-bit GPIO port register starts at 0x00. A developer performs the following sequence:

reg |= (1 << 0);     // Operation 1
reg |= (1 << 4);     // Operation 2
reg ^= (1 << 0);     // Operation 3
reg |= (1 << 7);     // Operation 4
reg &= ~(1 << 4);    // Operation 5

What is the final value of reg?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!