---
title: "Hadamard code conditions and 8×8 construction"
subject: "Wireless Communication"
chapter: 6
key: "semester_7/wireless_communication:hadamard-code-conditions"
source: https://www.bctengineer.com/q/semester_7/wireless_communication/hadamard-code-conditions
site: BCT Engineering
---

# Hadamard code conditions and 8×8 construction

Wireless Communication · Chapter 6: Speech and Channel Coding

- Asked in: 2079 Chaitra, 3+5 marks
- Video: [Hadamard Code ( Linear Block Code )  (हिन्दी )](https://www.youtube.com/watch?v=3JeatK8vAS4) — LEARN AND GROW
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/wireless_communication/hadamard-code-conditions
- Whole chapter: https://www.bctengineer.com/md/semester_7/wireless_communication/chapter-6

## Question

Write the steps to satisfy condition for Hadamard code. Construct 8 by 8 Hadamard code that satisfies above conditions.

## Short answer

Hadamard code conditions: square N×N matrix, first row all zeros, every other row has N/2 zeros and N/2 ones, and any two rows differ in N/2 positions. Sylvester construction H2n=[Hn Hn; Hn Hn'] gives H8 with binary rows 00000000, 01010101, 00110011, 01100110, 00001111, 01011010, 00111100, 01101001.

## Answer

#### Conditions (steps) for a Hadamard code

A Hadamard (Walsh) code is a set of N codewords of length N (N = 2ᵏ) taken from the rows of a Hadamard matrix. The conditions it must satisfy are:

1. **Square matrix:** N rows and N columns, entries only 0/1 (or +1/−1).
2. **First row (and first column) all zeros** (all +1), i.e. the matrix is normalized.
3. **Equal weight:** every row except the first has exactly N/2 zeros and N/2 ones.
4. **Orthogonality:** any two different rows agree in exactly N/2 places and differ in N/2 places. In ±1 form, the inner product of two different rows is 0, so H·Hᵀ = N·I.

**Steps to construct (Sylvester method)** – these steps guarantee the above conditions:

1. Start with H₁ = [0].
2. Form H₂ₙ from Hₙ by placing Hₙ in the top-left, top-right and bottom-left blocks and its **complement** Hₙ′ in the bottom-right block:

```text
 H2n = | Hn  Hn  |
       | Hn  Hn' |
```

3. Repeat until the required size N is reached (1 → 2 → 4 → 8).

#### Construction of 8 × 8 Hadamard code

```text
 H1 = [0]

 H2 = | H1  H1 |  = | 0 0 |
      | H1  H1'|    | 0 1 |

 H4 = | H2  H2 |  = | 0 0 0 0 |
      | H2  H2'|    | 0 1 0 1 |
                    | 0 0 1 1 |
                    | 0 1 1 0 |

 H8 = | H4  H4 |      (H' = complement of H)
      | H4  H4'|
```

Writing H8 in full:

```text
         c1 c2 c3 c4 c5 c6 c7 c8
 W0:      0  0  0  0  0  0  0  0
 W1:      0  1  0  1  0  1  0  1
 W2:      0  0  1  1  0  0  1  1
 W3:      0  1  1  0  0  1  1  0
 W4:      0  0  0  0  1  1  1  1
 W5:      0  1  0  1  1  0  1  0
 W6:      0  0  1  1  1  1  0  0
 W7:      0  1  1  0  1  0  0  1
```

**Verification:**
- Row W0 is all zeros; every other row has four 0s and four 1s.
- Example: W1 = 01010101 and W2 = 00110011 agree in positions 1, 4, 5, 8 and differ in 2, 3, 6, 7, i.e. 4 agreements and 4 disagreements, so they are orthogonal. The same holds for every pair (checked for all 28 pairs).
- Minimum distance between codewords = N/2 = 4.

These 8 orthogonal codewords are used as Walsh spreading codes to separate channels in CDMA (IS-95 uses the 64 × 64 version).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Apart from the first row, how many zeros does each row of an N x N Hadamard code have?
   A. N
   B. N/2
   C. 1
   D. N-1
   Answer: B. Every non-first row has N/2 zeros and N/2 ones. (Key point: Equal weight)

2. How do two different rows relate?
   A. They agree in N/2 places and differ in N/2 places
   B. They are identical
   C. They agree in all but one place
   D. They are complements
   Answer: A. Orthogonal rows agree in N/2 and differ in N/2 positions, so the +/-1 inner product is 0. (Key point: Orthogonality)

3. In the Sylvester method, what goes in the bottom-right block of H2n (0/1 form)?
   A. Hn
   B. All ones
   C. Complement of Hn
   D. Zeros
   Answer: C. Hn is in three blocks and its complement in the bottom-right. (Key point: Construction step)

4. What is the minimum distance between codewords of the 8x8 Hadamard code?
   A. 8
   B. 2
   C. 1
   D. 4
   Answer: D. Different rows differ in N/2 = 4 positions. (Key point: Minimum distance)

## Related in Wireless Communication

- [Turbo coding and 8×8 Hadamard code](https://www.bctengineer.com/question.md?key=semester_7%2Fwireless_communication%3Aturbo-coding-hadamard) — Wireless Communication, chapter 6
- [Hadamard matrix H8](https://www.bctengineer.com/question.md?key=semester_7%2Fwireless_communication%3Ahadamard-matrix-h8) — Wireless Communication, chapter 6

## Related in other subjects

- [Construct a (7,4) Hamming code](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-74-construct) — Data Communication, chapter 8
- [Huffman code tree steps with example](https://www.bctengineer.com/question.md?key=semester_8%2Fmultimedia_system%3Ahuffman-code-tree-steps) — Multimedia System, chapter 5, asked 7×
- [Steps of sewer construction](https://www.bctengineer.com/question.md?key=semester_6%2Fsanitary_engineering%3Asewer-construction-steps) — Sanitary Engineering, chapter 3
- [Construction steps of cement concrete pavement](https://www.bctengineer.com/question.md?key=semester_7%2Ftransportation_engineering_ii%3Acc-pavement-construction-steps) — Transportation Engineering II, chapter 3
