parity checking 奇偶校验 笔记

本文详细介绍了如何通过设置奇偶校验位来检测通信过程中数据传输的准确性,确保数据在传输过程中的完整性。通过在每个传输单位后面添加校验位,使得所有字节要么具有奇数位数的1,要么具有偶数位数的1,以此来判断数据是否准确无误。该方法虽然基础但有效,但也存在局限性,无法检测到特定情况下的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 检查 一个传输单位(7,8 bits)中,被设置为1的位数,按照位数是奇数或者偶数来设置校验位,并把校验位添加到传输单位的后面。
2. even parity: If the number of set bits is even, it sets the parity bit to 0; if the number of set bits is odd, it sets the parity bit to 1.

from:http://www.webopedia.com/TERM/P/parity_checking.html

parity checking
In communication, parity checking refers to the use of parity bits to check that data has been transmitted accurately. The parity bit is added to every data unit (typically seven or eight bits ) that are transmitted. The parity bit for each unit is set so that all bytes have either an odd number or an even number of set bits(值为1的位).

Assume, for example, that two devices are communicating with even parity (the most common form of parity checking). As the transmitting device sends data, it counts the number of set bits in each group of seven bits. If the number of set bits is even, it sets the parity bit to 0; if the number of set bits is odd, it sets the parity bit to 1. In this way, every byte has an even number of set bits. On the receiving side, the device checks each byte to make sure that it has an even number of set bits. If it finds an odd number of set bits, the receiver knows there was an error during transmission.

The sender and receiver must both agree to use parity checking and to agree on whether parity is to be odd or even. If the two sides are not configured with the same parity sense, communication will be impossible.

Parity checking is the most basic form of error detection in communications. Although it detects many errors, it is not foolproof, because it cannot detect situations in which an even number of bits in the same data unit are changed due to electrical noise. There are many other more sophisticated protocols for ensuring transmission accuracy, such as MNP and CCITT V.42.

Parity checking is used not only in communications but also to test memory storage devices. Many PCs, for example, perform a parity check on memory every time a byte of data is read.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值