Design Question - Odd Parity Detector
How does Parity ensure data integrity? What are its limitations? Concept, Design Choices, FSM explained with SystemVerilog code
Data Parity - Concept
In digital systems, ensuring data integrity is critical. One widely used error-detection method is parity checking, which helps detect transmission errors by appending a parity bit to a data stream.
Among parity methods, odd parity detection ensures that the total count of 1s in a binary sequence remains odd. This simple yet effective technique finds applications in communication protocols, memory systems, and data reliability mechanisms.
Parity refers to a method of error detection where an extra bit (parity bit) is added to a data sequence to enforce a particular sum of 1s.
- Odd Parity: The parity bit ensures the total number of 1s in the data (including the parity bit) is odd.
- Even Parity: The parity bit ensures the total number of 1s is even.
How Does Odd Parity Work?
Consider a 4-bit data sequence:
1010
β Already has two 1s (even count), so the parity bit is1
β Final data:10101
1101
β Already has three 1s (odd count), so the parity bit is0
β Final data:11010
This mechanism ensures consistent error detection, making it useful in scenarios where single-bit errors could compromise data integrity.
State Transition Diagram
The figure below shows the state transition diagram for an odd parity detector. The FSM can essentially be in one of two states, EVEN or ODD, based on the number of 1
s it has received up to that point.