Bird
0
0

What will be the effect of the following code?

medium📝 Analysis Q5 of 15
ARM Architecture - Bus Architecture
What will be the effect of the following code?
RCC->AHBENR &= ~(1 << 17);
ADisables the clock for GPIO port A
BEnables the clock for GPIO port A
CResets the GPIO port A peripheral
DNo effect on GPIO port A clock
Step-by-Step Solution
Solution:
  1. Step 1: Understand bit clearing operation

    The &=~ operator clears the specified bit to 0.
  2. Step 2: Identify bit 17 meaning

    Bit 17 in RCC->AHBENR controls GPIO port A clock enable; clearing disables it.
  3. Final Answer:

    Disables the clock for GPIO port A -> Option A
  4. Quick Check:

    Clearing bit disables clock [OK]
Quick Trick: Clear bit with &=~ to disable clock [OK]
Common Mistakes:
  • Thinking &=~ enables clock
  • Confusing reset with clock disable
  • Assuming no effect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes