Parity
Parity Invert-Select 8-bit — L1 Upgrade — L2 Upgrade
8-bit parity checker with invert-select control and sticky error detection for single-bit error assumption.
About this block
Simulate it in the Verilog IDE
Parity Invert-Select 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 checker with an invert-select control and sticky error detection. It is designed for memory interfaces and data bus integrity checks, providing corrected data output and status flags for system health monitoring.
The module supports syndrome-based single-bit error correction assumptions and tracks historical errors via a persistent sticky flag. It accepts an 8-bit data input and an invert_select control signal, computing even parity on the input path. The invert_select signal allows bitwise inversion of the input before parity calculation.
This IP implements an 8-bit parity checker with an invert-select control and sticky error detection. It is designed for memory interfaces and data bus integrity checks, providing corrected data output and status flags for system health monitoring. The module supports syndrome-based single-bit error correction assumptions and tracks historical errors via a persistent sticky flag.
- Choose Open in IDE. RTL Studio loads the packaged workspace for Parity Invert-Select 8-bit — L1 Upgrade — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: 8-bit parity checker with invert-select control and sticky error detection for single-bit error assumption.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- 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.
Features
- 8-bit Data Path: Handles 8-bit data words with configurable inversion.
- Invert Select: Allows transparent handling of inverted data streams.
- Syndrome Detection: Calculates syndrome bits to detect parity mismatches.
- Sticky Error Flag: A persistent flag that remains set after the first detected error, useful for system health monitoring.
- Synchronous Outputs: Registered outputs ensure clean timing for system integration.
- Asynchronous Reset: Safe initialization via active-low reset.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low asynchronous reset |
rd_en | Input | 1 | Read enable signal. When high, data_in is sampled. |
data_in | Input | 8 | Input data bus |
invert_select | Input | 1 | If high, data_in is bitwise inverted before processing. |
data_out | Output | 8 | Output data bus. Provides corrected data if an error is detected. |
parity_ok | Output | 1 | High if parity is correct (no error detected). |
error_detected | Output | 1 | High if a parity mismatch is detected on the current cycle. |
sticky_error | Output | 1 | Persistent error flag. Set to 1 after the first error and remains 1. |
Architecture
The module operates as follows:
- Input Conditioning: If
invert_selectis high,data_inis inverted. - Parity Calculation: Even parity is calculated for the conditioned input.
- Error Detection: The parity of the input is compared with the parity of the output (
data_out) to generate a syndrome bit. - Correction: If an error is detected, the least significant bit (LSB) of the sampled data is flipped to correct it.
- Sticky Flag: If a syndrome bit is detected, the
sticky_errorflag is set and remains set.
Verification
The testbench covers normal operation, error detection, and sticky error persistence. All test cases passed successfully during simulation.
| Test Case | Description | Expected Result | Status |
|---|---|---|---|
| TC1 | Normal operation, no invert | data_out matches input, parity_ok=1 | PASS |
| TC2 | Odd parity input, no invert | error_detected=1, sticky_error=1 | PASS |
| TC3 | Sticky error persistence | sticky_error remains 1 | PASS |
| TC4 | Invert select with correct data | data_out is inverted, parity_ok=1 | PASS |
| TC5 | Error with invert select | sticky_error=1 | PASS |
More in Parity
- 4-Bit Parity OK Checker (XOR vs Type) — L1 Upgrade — L2 Upgrade
- 8-Bit Even/Odd Parity Bit Generator — L1 Upgrade
- 8-Bit Parity Error Counter with Accumulator — L2 Upgrade
- 8-Bit Parity Generator (Muxed Even/Odd)
- Byte-Strobe Parity Scrub 32-bit — L2 Upgrade
- Even Parity over 16-Bit Bus — L1 Upgrade — L2 Upgrade
- Hamming Distance 8-Bit — L1 Upgrade
- Odd/Even Parity Select 8-bit — L1 Upgrade — L2 Upgrade
- Parity Byte Checker 8-Bit — L1 Upgrade — L2 Upgrade
- Parity-Protected 8-Bit Register — L2 Upgrade
- SECDED Hamming Check (13,8)
- SECDED Nibble Syndrome (toy) — L2 Upgrade
- Sticky Parity Error Flag 8-Bit — L1 Upgrade
- XOR-Reduce Parity Tree 16-bit