# How to get number of parity bits for given number of string length

6 visualizzazioni (ultimi 30 giorni)
Raghwan Chitranshu il 22 Gen 2019
Risposto: Walter Roberson il 23 Gen 2019
Hello,
Number of parity bits for a given number of string length?
Suppose I am giving '7' as number of string length, the i am looking for
any one can help
thanks
##### 2 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Raghwan Chitranshu il 23 Gen 2019
yeah ... its String length ... if N is string length then ?

Accedi per commentare.

### Risposte (1)

Walter Roberson il 23 Gen 2019
"parity bit" is a family of techniques, not one particular technique.
A parity bit calculation involves the bitwise exclusive "or" of a number of positions in the data, and the parity bit is then set so that when it is included in the calculation, the end result is either 1 ("odd parity") or 0 ("even parity"). But where the parity bits are placed relative to the other bits is up to the implementation, and which bits are taken together to form a particular parity bit is up to the installation, including the possibility that some inputs bits might contribut to multiple output bits.
For example it would be a valid scheme to say that odd parity is to be calculated for the first 9 bits, and even parity is to be calculated for the next 5 bits, and then odd parity is to be calculated on bits 1:2:19 and then even parity is to be calculated on bits 2:2:20 and then those 4 parity bits are to be placed after the 20 input bits to form a 24 bit system in which bits 1:14 contribute to two different parity bits but bits 15:20 contribute to only 1 parity bit.
We therefore cannot answer the question of how many parity bits should be used for a given string length: it depends on what parity pattern you are using.
Historically it has not been uncommon for packet-oriented protocols to have either one octet (8 bits) or one nibble (4 bits) of parity per packet.
Parity is typically only used for basic sanity checks, not for any serious purpose. There are other techniques that work much better for error detection and error correction.
##### 0 CommentiMostra -1 commenti meno recentiNascondi -1 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Texas Instruments C2000 Processors in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!