← Quiz: Error Detection and Correction: all 10 questions
Quiz: Error Detection and Correction · Question 8 of 10
What does this print? (code)
What does this print?
def crc_remainder(bits, gen):
n = len(gen) - 1
work = list(bits + "0" * n)
for i in range(len(bits)):
if work[i] == "1":
for j in range(len(gen)):
work[i + j] = "0" if work[i + j] == gen[j] else "1"
return "".join(work[-n:])
print(crc_remainder("1101011011", "10011"))
- A.0000
- B.1011
- C.1110
- D.0111
Answer & explanation
Correct answer: 1110
Appending four zeros and XOR-dividing by 10011 leaves 1110, the CRC sent after the data.
Can you get the rest right without peeking?
Take the timed Quiz: Error Detection and Correction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →