필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
Raghwan Chitranshu
Raghwan Chitranshu 2019년 1월 22일
답변: Walter Roberson 2019년 1월 23일
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
Jan
Jan 2019년 1월 22일
Does "number of string length" mean "string length"?
You can define as many parity bits as you want. So it depends on the protocol how many are used.
Raghwan Chitranshu
Raghwan Chitranshu 2019년 1월 23일
yeah ... its String length ... if N is string length then ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 1월 23일
"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.

카테고리

Help CenterFile Exchange에서 String에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by