Which statement correctly describes how a parity bit helps in error detection?
Think about how a single extra bit can signal if one bit changed during transmission.
A parity bit is a simple error detection method that adds one bit to data to make the count of 1s even or odd. If a single bit flips, the parity changes, signaling an error.
What is the output of the following Python code that calculates the syndrome for a received 7-bit Hamming code?
def calculate_syndrome(received): # Parity check matrix for (7,4) Hamming code H = [ [1,0,1,0,1,0,1], [0,1,1,0,0,1,1], [0,0,0,1,1,1,1] ] syndrome = [] for row in H: s = sum(r*b for r,b in zip(received, row)) % 2 syndrome.append(s) return syndrome print(calculate_syndrome([1,0,1,1,1,1,0]))
Calculate each parity check bit by multiplying and summing modulo 2.
The syndrome is calculated by multiplying the received vector with the parity check matrix rows and taking modulo 2. For the input, the result is [1, 0, 1].
Given a 16-bit CRC code, how many bit errors can it reliably detect in a transmitted message?
Think about the properties of CRC codes and their error detection capabilities.
A 16-bit CRC can detect all single-bit errors, all double-bit errors, and any odd number of errors due to its polynomial properties.
Which plot best shows the relationship between the number of bit errors and the ability of a (7,4) Hamming code to correct them?
Recall that Hamming code corrects single-bit errors but not multiple-bit errors.
The (7,4) Hamming code can correct exactly one bit error. The plot should show correction at 1 error and failure beyond that.
What error does the following code produce when calculating even parity for a list of bits?
def even_parity(bits):
parity = 0
for bit in bits:
parity ^= bit
return parity == 1
print(even_parity([1, 0, 1, 0]))Check what the parity variable should equal for even parity.
The code returns True only if parity equals 1, which means odd parity. For even parity, parity should be 0.
