BCH Codec x32bit GF(213)
The BCH Codec IP core operates over GF(213) with a 32-bit input/output data bus and configurable error correction capability. The maximum codeword length is 8191 bits, with a commonly used message length of 4096 bits (512 bytes); shortened codes can be customized. The BCH encoder generates parity bits, and the BCH decoder finds & corrects error bits using three sub-modules: Error Detect Coder (EDC), Key Equation Solver (KES) and Chien Search Machine (CSM). These sub-modules are scheduled in a pipeline manner, which means the decoder can decode three data frames concurrently with each frame in each decoding stage. The parallelism of the KES module is adjustable to match the latency of other sub-modules, and the CSM is implemented area-efficiently using BOYUAN's proprietary technologies.
Key Highlights
3-Stage Pipeline
EDC → KES → CSM pipeline processes three data frames concurrently, one frame per stage, for sustained throughput.
Configurable KES Parallelism
Key Equation Solver unroll factor U is configurable: half-unrolled at 16bit, fully parallel at 36bit, balancing area and throughput.
32bit AXI-Stream
32bit input/output with TVALID/TREADY handshaking and backpressure; dec_result reports corrected-bit count and success flag per frame.
GF(213) & Shortened Codes
Maximum codeword 8191 bits, typical message 4096 bits (512 bytes); codeword and shortened-code lengths are customizable.
Configurable ECC Strength
Typical 16bit (208 parity bits) / 36bit (468 parity bits); other correction levels available on request.
Compute-in-Memory Ready
Online soft-error correction for weight and activation memories in CIM chips, safeguarding compute-array data integrity.
Parity Length
| 16bit vs 36bit Correction Configurations | ||
|---|---|---|
| ECC Level | 16bit | 36bit |
| Parity Length | 208bit | 468bit |
| Message Length | 4096bit | 4136bit |
| Codeword Length | 4304bit | 4604bit |
Request more ECC Levels: tech@bjbytech.com Phone / WeChat (same number): 13601005061
Synthesis Results
DC synthesis of the decoder cores was performed with the SMIC 28nm library (scc28nhkcp_vhsc35p140_rvt_tt_v0p9_25c_basic) at the TT typical corner (0.9V / 25°C) under a 1ns (1GHz) clock constraint. The results below are synthesis estimates at the TT typical corner for the 16bit@4304bit and 36bit@4604bit correction configurations. These are pre-layout figures that do not include interconnect delay after place-and-route, and do not represent a final sign-off frequency.
| Item | 16bit @ 4304bit | 36bit @ 4604bit |
|---|---|---|
| Design | bch_4304_4096_dec_core | bch_4604_4136_dec_core |
| Number of ports | 19592 | 43312 |
| Number of nets | 70950 | 171337 |
| Number of cells | 51458 | 128240 |
| Combinational cells | 40361 | 108060 |
| Sequential cells | 11020 | 19987 |
| Macros / black boxes | 0 | 0 |
| Buf / Inv | 5595 | 14486 |
| Number of references | 10 | 10 |
| Combinational area | 47121.984560 | 129454.585521 |
| Buf / Inv area | 2819.880045 | 7958.832097 |
| Noncombinational area | 37633.176891 | 70115.810142 |
| Total cell area | 84755.161451 | 199570.395662 |
Note: Buf/Inv area is included in combinational area; no wire load model is specified, so Net Interconnect Area and Total Area are reported as undefined.
Decoder 3-Stage Pipeline
The decoder uses a three-stage pipeline of EDC (Error Detection Coding), KES (Key Equation Solving) and CSM (Chien Search), processing three data frames at different stages concurrently. EDC and CSM handle one 32bit word per cycle with a latency of about ceil(N/32) cycles (N = codeword length), while KES processes U error locations per cycle over 2t iterations, giving a latency of about ceil(2t/U) cycles. KES parallelism is configurable: the unroll factor U is chosen to match the latency of the other two stages — half-unrolled for 16bit correction and fully parallel for 36bit correction — balancing area against throughput. CSM uses BOYUAN's proprietary technology for area efficiency.

Compute-in-Memory Applications
Memory reliability for CIM architectures
In compute-in-memory (CIM) chips, memory arrays directly perform multiply-accumulate operations; process variation, noise and device aging can flip bits in weight/activation data. The three-stage pipelined decoder provides low-latency online error correction for each memory block, preventing erroneous weights from propagating into the compute array.
The 32bit AXI-Stream interface integrates easily with CIM macros and on-chip buses, while configurable ECC strength, codeword length and KES parallelism allow the core to be tuned to array bandwidth, memory capacity and area budget — delivering both reliability and energy efficiency.
Verification & FPGA Testing
The IP core provides a complete self-checking verification platform covering both RTL simulation and FPGA board-level prototyping. The platform uses a modular architecture with the following data path: a random number generator produces the test data stream, a rate buffer module performs clock-domain crossing and rate matching before feeding the BCH encoder; the encoder output passes through an error injection module that inserts bit errors according to a configured pattern, then the BCH decoder corrects the errors; finally a check module compares the original and decoded data frame by frame and counts passed / failed frames.
The random number generator uses four parallel linear feedback shift registers (LFSR) to produce 32bit pseudo-random data. Error injection position, pattern and enable come from configurable registers, flexibly covering different correction levels and error distributions. In FPGA prototyping, the test platform is integrated at the top level; VIO configures error patterns and frame enable online, monitors decoding results and frame counters in real time, and can run continuously to measure correction performance.

Port Map
Encoder Signals
| Signal | Direction | Width | Description |
|---|---|---|---|
| clk | Input | 1 | Clock signal. |
| rst_n | Input | 1 | Reset signal, asynchronous active-low. |
| s_axis_tdata | Input | 32 | Input data bus. |
| s_axis_tuser | Input | 1 | Input frame start flag. |
| s_axis_tlast | Input | 1 | Input frame end flag. |
| s_axis_tvalid | Input | 1 | Input data valid. |
| s_axis_tready | Output | 1 | Input data ready. A transfer occurs when s_axis_tvalid and s_axis_tready are both asserted. |
| m_axis_tdata | Output | 32 | Output data bus. |
| m_axis_tuser | Output | 1 | Output frame start flag. |
| m_axis_tlast | Output | 1 | Output frame end flag. |
| m_axis_tvalid | Output | 1 | Output data valid. |
| m_axis_tready | Input | 1 | Output data ready. A transfer occurs when m_axis_tvalid and m_axis_tready are both asserted. |
Decoder Signals
| Signal | Direction | Width | Description |
|---|---|---|---|
| clk | Input | 1 | Clock signal. |
| rst_n | Input | 1 | Reset signal, asynchronous active-low. |
| s_axis_tdata | Input | 32 | Input data bus. |
| s_axis_tuser | Input | 1 | Input frame start flag. |
| s_axis_tlast | Input | 1 | Input frame end flag. |
| s_axis_tvalid | Input | 1 | Input data valid. |
| s_axis_tready | Output | 1 | Input data ready. A transfer occurs when s_axis_tvalid and s_axis_tready are both asserted. |
| m_axis_tdata | Output | 32 | Output data bus. |
| m_axis_tuser | Output | 2 | Bit[0]: output frame start flag; Bit[1]: output correction flag. |
| m_axis_tlast | Output | 1 | Output frame end flag. |
| m_axis_tvalid | Output | 1 | Output data valid. |
| m_axis_tready | Input | 1 | Output data ready. A transfer occurs when m_axis_tvalid and m_axis_tready are both asserted. |
| dec_result | Output | 8 | Bit[6:0]: number of corrected bits; Bit[7]: decoding success flag. |
| dec_result_en | Output | 1 | Decoding result valid. Reports correction results in the order of frame input. |
Features
- Synchronoused design
- Customizable message length, typical 4096bit / 4136bit
- Galois field: GF(213)
- Configurable ECC levels, typical 16bit / 36bit
- Data width: 32bit
- Configurable Key Equation Solver parallelism, half-unrolled at 16bit / fully parallel at 36bit
- Three-stage pipelined decoder, processing three frames concurrently
- Per-frame decoding results (corrected-bit count and success flag)
- Online soft-error correction for compute-in-memory (CIM) arrays
Standard AXI-Stream Interface
- Compliant with the AMBA AXI-Stream protocol, using TVALID / TREADY handshaking for data transfer
- A transfer occurs on a clock cycle only when both TVALID and TREADY are asserted
- TDATA carries the input/output data, and TLAST marks the last beat of a frame
- TUSER conveys sideband information such as error-correction status
- The receiver applies backpressure by deasserting TREADY for flow control
- The transmitter holds TDATA / TLAST / TUSER stable while TVALID is asserted, until the handshake completes
Related Products
Sales / Evaluationsale@bjbytech.com
Technical Supporttech@bjbytech.com
Phone / WeChat (same number)+86 136 0100 5061
FAQ
1. What are the data width and Galois field of this BCH codec IP core?
It uses a 32bit input/output data bus over GF(213), with a maximum codeword length of 8191 bits and a typical message length of 4096 bits (512 bytes); shortened codes can be customized.
2. Are the ECC capability and message length customizable?
ECC capability is configurable, typically 16bit and 36bit (codeword 4304bit and 4604bit respectively). Message length is customizable, typically 4096bit and 4136bit, and shortened codes can be customized.
3. What architecture does the decoder use?
The decoder uses a three-stage pipeline of EDC (Error Detection Coding), KES (Key Equation Solving) and CSM (Chien Search), processing three frames concurrently. KES parallelism is adjustable: half-unrolled for 16bit and fully parallel for 36bit. CSM uses Boyuan's proprietary technology for area efficiency.
4. What is the interface protocol?
It follows AMBA AXI-Stream with TVALID/TREADY handshaking; a transfer completes only when both are asserted. Back-pressure flow control is supported, and TUSER carries correction status flags.
5. What about synthesis technology and frequency?
DC synthesis at the SMIC 28nm TT typical corner (0.9V/25°C) with a 1ns (1GHz) clock constraint. This is a pre-layout estimate excluding place-and-route interconnect delay and does not represent a final sign-off frequency.
Support
The core as delivered is warranted against defects for three months from purchase. Free remote technical support is provided for twelve months, includes consultation via phone and E-mail. The maximum time for processing a request for technical support is three business days.
Deliverables
The core is available in RTL source code (Verilog) and FPGA (Netlist) forms, and includes everything required for successful implementation:
- RTL source code or post-synthesis EDIF Netlist (FPGAs)
- Wrapper for pin compatible replacement
- Testbench (self-checking)
- Simulation script, vectors, expected results, and comparison utility
- Synthesis script (ASICs) or place and route script (FPGAs)
- Comprehensive user documentation, including detailed specifications
Reference Standards & Technical Resources
The design and verification of this IP core follow the industry standards below; the specifications are available for further reference:
- JEDEC Solid State Technology Association — global standards body for flash memory (UFS / eMMC / SSD)
- ONFI (Open NAND Flash Interface) — NAND Flash component-level interface specification
- ARM AMBA Specifications — AXI-Stream on-chip interconnect protocol
- BCH code (Wikipedia) — theoretical foundation of BCH error-correcting codes
Contact for Purchase or Evaluation
To purchase an IP core license, request an evaluation version, or discuss technical cooperation, please contact us via:
Purchase / Evaluation: sale@bjbytech.com Phone / WeChat (same number): 13601005061
More correction capability / Technical consulting: tech@bjbytech.com Phone / WeChat (same number): 13601005061
