RTL Studio Open IDE

Parity

Parity Byte Checker 8-Bit — L1 Upgrade — L2 Upgrade

8-bit parity checker with sticky error flag and syndrome-based single-bit correction using data[2:0] as index.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Parity Byte Checker 8-Bit — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Parity catalog. Even/odd parity generators, checkers, and error-detection helpers. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements an 8-bit parity byte checker with sticky error detection and syndrome-based bit correction.

It detects single-bit errors using even parity and corrects them based on a syndrome index derived from the lower 3 bits of the data.

The module registers the input data and control signals to ensure stable output timing.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Parity Byte Checker 8-Bit — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: 8-bit parity checker with sticky error flag and syndrome-based single-bit correction using data[2:0] as index.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Architecture

The module operates on a rising clock edge with an active-low asynchronous reset. It samples data_in only when a rising edge of rd_en is detected. Parity is computed as the XOR reduction of all 8 input bits. If the parity is odd, an error is flagged and the syndrome index is extracted from data_reg[2:0]. The syndrome index indicates which bit position to flip for correction. This approach assumes a specific error pattern where the error location correlates with the data value's lower bits.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
rd_enInput1Read enable (rising edge triggers sampling)
data_inInput8Input data byte
parity_okOutput1High if parity is even (no error)
errOutput1High if parity is odd (error detected)
data_outOutput8Corrected output data

Verification

The testbench performs five key test cases to validate functionality.

  • TC1: Verifies correct operation with even parity data (no error).
  • TC2: Verifies error detection and correction when syndrome index is 1.
  • TC3: Verifies error detection and correction when syndrome index is 2.
  • TC4: Verifies error detection and correction when syndrome index is 4.
  • TC5: Verifies correct operation with another even parity data pattern.

All tests passed successfully in the Icarus Verilog simulation.

More in Parity

All Parity blocks