RTL Studio Open IDE

Parity

XOR-Reduce Parity Tree 16-bit

Balanced XOR-reduction tree computing even parity for a 16-bit input vector.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

XOR-Reduce Parity Tree 16-bit is a Verilog reference block in the Parity catalog. Even/odd parity generators, checkers, and error-detection helpers. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP implements a balanced XOR-reduction tree for 16-bit data. It computes the even parity bit of the input vector. The design uses a logarithmic depth structure to minimize critical path delay. Simulation confirms correct parity generation for all tested patterns.

This IP provides a fast, balanced parity tree for 16-bit words. It is suitable for error detection in data buses. The design is fully combinational with no clock dependencies. Simulation results confirm functional correctness.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for XOR-Reduce Parity Tree 16-bit.
  2. Read the Verilog module in the editor. The catalog line for this block: Balanced XOR-reduction tree computing even parity for a 16-bit input vector.
  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 reduces 16 input bits to a single parity output. It employs a four-level balanced XOR tree topology. Level 1 reduces 16 bits to 8 intermediate signals. Level 2 reduces 8 signals to 4 intermediate signals. Level 3 reduces 4 signals to 2 intermediate signals. Level 4 performs the final XOR to produce the single output bit. This structure ensures O(log N) latency relative to the input width.

Interface

The module has a simple combinational interface.

SignalDirectionWidthDescription
data_inInput16Input data vector
parity_outOutput1Even parity result

Verification

The testbench performs 15 functional test cases. It checks edge cases such as all zeros and all ones. It verifies single-bit transitions and multi-bit patterns. Random patterns are included to ensure robustness. All tests pass successfully in the Icarus Verilog simulator.

Test CaseInput HexExpected ParityResult
TC10x00000PASS
TC20xFFFF0PASS
TC30x00011PASS
TC40x80001PASS
TC50x00030PASS
TC60xAAAA0PASS
TC70x55550PASS
TC80x000F0PASS
TC90x00071PASS
TC100x12341PASS
TC110x00021PASS
TC120x00071PASS

More in Parity

All Parity blocks