In computer architecture and data manipulation: A number used to control or shape the form of another number (for example by selective bit operations) is called what?
-
AMap
-
BMask
-
CMarker
-
DModulo
-
ENone of the above
Answer
Correct Answer: Mask
Explanation
Introduction / Context:Low-level programming and digital logic often use a special value to clear, set, or test selected bits of another value. Recognizing the correct terminology is essential for understanding bitwise operations and systems programming.
Given Data / Assumptions:
- The operation is numerical but focuses on bits.
- The controlling value determines which bits pass through, are set, or are cleared.
- Common operations include AND, OR, XOR, and NOT.
Concept / Approach:
A bitmask, or simply mask, is a number whose bits are used to select or modify bits in another number. For example, AND with 0 clears a bit; OR with 1 sets a bit. Thus the controlling number is called a mask.
Step-by-Step Solution:
1) Identify that the question describes control over the 'form' of another number, implying bit-level gating.2) Recall terminology: mask (bitmask) is the standard term.3) Choose 'Mask' as the correct answer.Verification / Alternative check:
Example: To zero the lower 4 bits of 0xAB (10101011), AND with 0xF0 (11110000). The value 0xF0 is the mask controlling the operation.
Why Other Options Are Wrong:
- Map: refers to associations, not bit control.
- Marker: annotation concept, not a numeric controller.
- Modulo: arithmetic operator for remainders, not bit selection.
- None of the above: incorrect because 'Mask' is exact.
Common Pitfalls:
- Confusing 'mask' with 'map' due to similar spelling.
- Assuming masking only means hiding; in computing it is precise bit manipulation.
Final Answer:
Mask.