Bird
0
0

Given the code snippet:

medium📝 Analysis Q4 of 15
ARM Architecture - Bus Architecture
Given the code snippet:
RCC->APB1ENR = 0;
RCC->APB1ENR |= (1 << 4);
RCC->APB1ENR |= (1 << 6);

What is the final value of RCC->APB1ENR in binary (8 bits shown)?
A01000000
B01010000
C00010000
D00000000
Step-by-Step Solution
Solution:
  1. Step 1: Analyze bit positions set

    Bits 4 and 6 are set to 1 using |= operator.
  2. Step 2: Convert bits to binary

    Bit 4 = 00010000, bit 6 = 01000000; combined = 01010000.
  3. Final Answer:

    01010000 -> Option B
  4. Quick Check:

    Bits 4 and 6 set = 01010000 [OK]
Quick Trick: Add bits set to get final binary value [OK]
Common Mistakes:
  • Confusing bit positions
  • Forgetting |= accumulates bits
  • Reading bits in wrong order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More ARM Architecture Quizzes