ITPEC FE Morning October 2020 Question 4

For an 8-bit code with the most significant bit as its parity bit, which of the following is used to obtain the lower seven (7) bits other than parity?

Explanation

AND with 7F — the mask 0111 1111 clears the parity bit and keeps the lower seven bits as they are.

In an AND, a mask bit of 1 passes the data bit through and a mask bit of 0 forces it to 0. The mask we need is 0 in bit 7 and 1 in bits 0 to 6, which is 0111 1111 = 7F in hexadecimal.

Example: 1010 0110 AND 0111 1111 = 0010 0110.

Answer (b)

Why not others:

  • •(a) AND with 0F — 0000 1111 also clears bits 4 to 6, so only the lower four data bits survive
  • •(c) OR with 0F — OR cannot clear anything: it forces bits 0 to 3 to 1 and leaves the parity bit untouched
  • •(d) XOR with FF — inverts all eight bits; the parity bit is flipped, not removed, and the data bits come out inverted

Key rule: To extract bits, AND with a mask that has 1s at the positions to keep; OR sets bits, XOR inverts them.

Basic Theory · AI-written, may contain errors

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.