Reduction Operator Parity Generator
Serial communication links and memory controllers frequently append a parity bit to data payloads to detect single-bit corruption during transmission. Calculating this bit efficiently in hardware requires evaluating the entire payload vector simultaneously rather than iterating through bits sequentially.
This module computes an odd parity bit for a 32-bit data payload. In an odd parity scheme, the total number of set bits (1s) across both the data payload and the appended parity bit must evaluate to an odd number. Consequently, the parity bit must be asserted to 1 when the input payload contains an even number of 1s, and deasserted to 0 when the payload contains an odd number of 1s.
| Signal | Direction | Width | Description | |--------|-----------|-------|-------------| | data_in | input | 32 | The data payload to be evaluated | | parity_out | output | 1 | Odd parity bit for the payload; strictly combinational |
Constraints
- The circuit must be purely combinational; no clocks or resets are present.
- The output
parity_outmust continuously reflect the odd parity ofdata_in. - The logic must be implementable in a single continuous assignment without using loops or procedural blocks.
Topics
Solve this problem
Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against a real testbench — you get the waveform back, not a stored answer.
This problem is part of Codiode Pro. The statement above is free to read.
The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.