## 3 Proposed Scheme
### CRC Interleaving Algorithm
#### 3.1.2 Interleaving Process  
The interleaving process is a systematic procedure designed to rearrange the columns of a binary matrix to optimize the sequence for error detection and correction. The scheme flow chart is shown in Figure 1. This process involves the following steps:  
**Step 1: Row-wise Traversal and Column Rearrangement**  
**Initialization**: Begin with the first row of the matrix. Traverse each element from left to right.  
**Condition Check**: For each element in the row, the following occurs:  
* If the element is **1**, move the corresponding column to the leftmost available position of the matrix, ensuring that the new leftmost column does not already contain a **1**.
* Shift all the other columns (if any) one position to the right to accommodate this movement.
* If the element is **0**, leave the column in its current position.  
**Example**:
* Suppose the third element in the row is **1**. Move the third column to the leftmost position that does not already contain a **1** (e.g., the second column). Shift the remaining columns (fourth, fifth, etc.) to the right.
* If the fifth element in the row is also **1**, move the fifth column to the next available leftmost position (e.g., the third column), and shift the remaining columns accordingly.
* Repeat this operation until all elements in the row have been processed.  
**Step 2: Subsequent Row Adjustment**  
**Traverse and Rearrange**: After completing Step 1 for the first row, move to the second row. Traverse the columns whose element value is **1** in this row.  
**Dual Condition Check**:
* If an element in the current column (e.g., second row) and the element directly below it (e.g., third row) are both **1**, move the column to the leftmost position where the upper and lower rows of the matrix do not simultaneously contain **1**.
* If a column already satisfies this condition, leave it unchanged.  
**Example**:
* Suppose the first column has **1** in both the first and second rows. Since no leftmost column exists for this condition, leave the column in place.
* If the second column has a **1** in the first row and **0** in the second row, do not move the column.
* Continue processing the second row in this manner until all columns with a **1** are traversed.  
**Repeat for Remaining Rows**: For each subsequent row, repeat Step 2 using the same traversal and rearrangement logic. The starting position for each traversal is the leftmost position not **0** in the previous row.  
**Step 3: Interleaved Sequence Generation**  
**Column Numbering**: After completing the interleaving process, assign a label to each column based on its position in the original matrix. **Sequence Formation**: Arrange the column numbers in the order they appear in the newly interleaved matrix. The resulting sequence is the interleaved sequence number array:  
\[\{f_{H}(H_{\text{c0}}),f_{H}(H_{\text{c1}}),\ldots,f_{H}(H_{\text{ck-1}})\}.\]  
**Step 4: Position Mark Array Generation**  
**Two-Dimensional Array**: Create a position mark array, denoted as \(positionInfo\), which has two rows. The **first row** indicates the position of each column in the original check matrix \(H\). The **second row** indicates the position of the last **1** in each row of the interleaved matrix. **Purpose**: The positions in the second row are used for error detection and correction.  
**Example**: If the last **1** in the first row appears in column 6, and the last **1** in the second row appears in column 10, while the last **1** in the third row appears in column 11, the second row of \(positionInfo\) would be \([6,10,11]\).  
The interleaving process concludes with the formation of the following interleaved sequence:  
\[H_{\text{c}}=[H_{\text{c0}},H_{\text{c1}},\ldots,H_{\text{ck-1}}]\]  
and the associated position mark array, which are integral to the error detection and correction mechanism.