Odd parity assignment for data words For each 7- or 8-bit data word, determine the required parity bit P to achieve odd parity: • 1011101 • 11110111 • 1001101
-
AP = 1, P = 1, P = 0
-
BP = 0, P = 0, P = 0
-
CP = 1, P = 1, P = 1
-
DP = 0, P = 0, P = 1
Answer
Correct Answer: P = 0, P = 0, P = 1
Explanation
Introduction / Context:Parity bits provide simple error detection over a set of data bits. For odd parity, the total number of 1s—including the parity bit—must be odd. This question asks you to compute the parity bit P for three separate data words.
Given Data / Assumptions:
- Words: 1011101, 11110111, 1001101.
- Odd parity required: total count of 1s (data + P) must be odd.
- We append one bit P to each word independently.
Concept / Approach:Count the number of 1s in each data word. If the count is already odd, set P = 0. If the count is even, set P = 1 to make the total odd. This follows directly from parity definition and requires only a popcount of each word.
Step-by-Step Solution:
Word 1: 1011101 has 1s at positions 1,3,4,5,7 → 5 ones (odd) → P = 0.Word 2: 11110111 has ones count 7 (odd) → P = 0.Word 3: 1001101 has ones count 4 (even) → P = 1.Therefore results: P = 0, P = 0, P = 1.Verification / Alternative check:Add P and recount: Word 1 total ones 5, Word 2 total ones 7, Word 3 total ones 5 → all odd, confirming correctness.
Why Other Options Are Wrong:
- P = 1, 1, 0 and P = 1, 1, 1: Do not satisfy odd parity for the words with already-odd one counts.
- P = 0, 0, 0: Fails for the third word which has an even number of ones and requires P = 1.
Common Pitfalls:Miscounting ones, assuming the same parity bit for all words, or forgetting that each word’s parity is computed independently.
Final Answer:P = 0, P = 0, P = 1