ITPEC FE Subject A April 2025 Question 1

Source exam: ITPEC FE Subject A April 2025Topic: Basic Theory & Math

ITPEC FE Subject A April 2025 — Question 1 of 60

Bit Masking with AND — extract specific bits by zeroing others.

To extract the most significant 4 bits of an 8-bit integer, apply AND with a mask:

  • Mask: 11110000 — ones where you want to keep, zeros where you want to clear
  • Example: 10110101 AND 11110000 = 10110000

Why not others:
- (b) NAND with 11110000 — inverts the AND result, gives the opposite

- (c) OR with 00001111 — sets lower 4 bits to 1 instead of clearing them

- (d) XOR with 00001111 — flips lower 4 bits instead of clearing them

Key rule: AND 1 = keep bit, AND 0 = clear bit. This is the standard bit masking technique.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.