Network | parity bit

奇偶校验位是一个表示给定位数的二进制数中1的个数是奇数还是偶数的二进制数。奇偶校验位是最简单的错误检测码。

A parity bit, or check bit is a bit added to the end of a string of binary code that indicates whether the number of bits in the string with the value one is even or odd. Parity bits are used as the simplest form of error detecting code.

奇偶校验位有两种类型:偶校验位与奇校验位。如果一组给定数据位中1的个数是奇数,那么偶校验位就置为1,从而使得总的1的个数是偶数。如果给定一组数据位中1的个数是偶数,那么奇校验位就置为1,使得总的1的个数是奇数。

奇偶校验位是一种错误检测码,但是由于没有办法确定哪一位出错,所以它不能进行错误校正。发生错误时必须扔掉全部的数据,然后从头开始传输数据。在噪声很多的媒介上成功传输数据可能要花费很长的时间,甚至根本无法实现。但是奇偶校验位也有它的优点,它是使用一位数据能够达到的最好的校验码,并且它仅仅需要一些异或门就能够生成。

原文地址:https://www.cnblogs.com/linyx/p/3779043.html