CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

Reduction Operator Parity Generator

EasyVerilog / SystemVerilogBuild

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_out must continuously reflect the odd parity of data_in.
  • The logic must be implementable in a single continuous assignment without using loops or procedural blocks.

Topics

CombinationalParityReduction Operators

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.

Sign in to solveSee what Pro unlocks

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.

Related problems

  • Single Continuous AssignmentEasy
  • Basic Vector ConcatenationEasy
  • Ternary Operator MuxEasy
  • Underscores for ReadabilityEasy
  • Left Hand Side ConcatenationEasy
  • Inout Port MechanicsEasy
  • Explicit Binary LiteralsEasy
  • Vector Port EndiannessEasy

Browse all problems · Learning tracks