RTL Design #11 · 2026-10-04 · CRC · Medium · about 15 min

A CRC that needs eight more bits

crc8 computes a CRC-8 one bit at a time: polynomial x⁸ + x² + x + 1 (8'h07), initial value 00, no bit reflection, no final XOR.

  • Message bits arrive on din, most significant bit of each byte first, one per rising edge with en high. With en low, crc holds.
  • crc is always the CRC of every bit shifted in since the last clear: once the last bit is in, it's ready, with no extra cycles.
  • clear (or reset, synchronous, active low) sets crc to 00. clear wins over en.

The standard check value for this CRC is f4, for the ASCII string "123456789". Run gets something else. Fix crc8.sv.

Write and run your answer in the browser. The hidden tests check it, and it’s free.