Rectangular codes
1 / 10

Rectangular Codes - PowerPoint PPT Presentation

  • Updated On :

m 1. row parity bits. Rectangular Codes. n 1 . message bits. x. Rule : take intersection of row-column parity error(s) – single error correction (double error detection). x. corner bit (use even parity checking). column parity bits.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Rectangular Codes' - xenia

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Rectangular codes l.jpg


row parity bits

Rectangular Codes





Rule: take intersection of row-column parity error(s) – single error correction (double error detection)


corner bit (use even parity checking)

column parity bits

If n= m (square): (n − 1)² message bits + (2n − 1) check bits = n² total

Example: n = 11, 21% overhead


Triangular codes l.jpg
Triangular Codes

Rule: intersection of parity errors – single error correction (no double error detection). A single parity error implies the error was on the diagonal itself.


diagonal parity checks






both row and column sum

to even parity (see book)

n(n − 1)/2 message bits + n check bits = n(n + 1)/2 total


Hyper dimensional codes l.jpg




Hyper-dimensional Codes

Arrange the bits in a cube, and include check bits not in every linear dimension, but every plane. So we get three edges of check bits, which intersect in a single point. Total of n³ = (3n − 2) check bits + message.

excess bit redundancy ~ 3 / n²

Four-dimensional: check over hyperplanes (cubes)

excess bit redundancy ~ 4 / n³


k = 3

k = 1

k = 2

3.3 cont.

Hypercubes l.jpg

More generally, consider a k-dimensional n-cube. There are n (k−1) dimension hyperplanes in each of the k directions (each are parity checked), for a total of n × k bits. Overhead is hence ~ nk / nk = k / nk−1. So keeping m = nk fixed, overhead is ~ k∙k√m. This has a minimum when its (natural) logarithm does: log k + (ln m) / k. Taking derivatives: 1/k − (ln m)/k² = 0 implies k = ln m is the optimal dimension, making n = e. This is almost the highest dimensional space possible, since n must be at least two. So try using a k-dimensional 2-cube, with n = 2k bits. One parity check in each direction means each of the k different ways of splitting the cube has even parity.

3.3 cont.

Hamming code l.jpg
Hamming Code

Design a code so the sequence of parity error bits (called syndrome) address (point to) the erroneous bit. All zero’s is no error. If we number the parity checks pm, ..., p1, where pi = (1 for an error / 0 for no error), then they can point to 2m 1 erroneous bits. If we use a total of n bits, we must have n ≤ 2m  1 to correct an error in any possible location. Clearly, each parity check pimust sum over all positions i in the string such that the jth bit of i is one:

In order for x1, …, xn to be a valid code word, it must include both message bits and the propercheck bits. The most convenient choice is to locate them at positions 2j-1 in the word x1, …, xn according to the formula:

x2j-1 = ∑ {xi : i = (bm… b1)two & bj = 1} mod 2


Example l.jpg

n = 7, m = 3; parity bit positions: 1, 2, 4. 7  3 = 4 message bits at positions 3, 5, 6, 7.


Turn 90


error in position 3


Hamming distance l.jpg

Hamming distance

The minimum distance between allowable code words is:




of code

This is the number of places that they differ (same as L0 norm in F2).


Sphere packing l.jpg
Sphere packing

For single error correction, with minimum distance = 3, the spheres of radius one around each code word must not overlap:

k = # of message bits

n = total number of bits

m = # of check bits

double error correction has non-overlapping spheres of radius 2:

“Density” corresponds to efficiency of code

When equality is achieved, the code is said to be “perfect”. E.g. double-error correcting with m = 12, n = 90.


Double error detection l.jpg

Double – Error Detection

Algebraic approach

Hamming code would cause 3 errors in a double-error situation. But if we add an extra parity check bit over the entire word we can detect double errors:

x0x1, …, xnx0 = ∑ {xi : i = 1 … n} mod 2

Geometric approach – In the original code, points of distance 3 from each other have a different # of 1’s in them (mod 2) since they differ in 3 positions, so their extra parity checks will be set differently, and now they will differ in 4 positions!


Hamming codes on words l.jpg
Hamming Codes on Words

0 0  0 represents no parity error

anything else represents a parity error

a check =

Think of doing parity checks over entire words, using a logical sum.

The same syndrome technique locates the erroneous word. Any of the parity check failure words could now be added to the erroneous word to correct it.


parity bit

Consider the ASCII code with each 8-bit word having a parity bit, and for each block of words, a checksum word.

The parity check within a word locates the erroneous word, and the check sum bits locate the erroneous bit.




This is equivalent to a rectangular code

checksum word