奇偶校验位和错误检测 [英] parity bit and error detection

查看:37
本文介绍了奇偶校验位和错误检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在大学的计算机体系结构课程中遇到过这种情况.我无法理解奇偶校验位;为什么它有偶数和奇数两种.

I have faced that in my computer architecture course at university. I can't understand the parity bit; Why it has two kinds of even and odd.

谁能给我清楚地解释一下奇偶校验码?

Can anyone give me clear explain about parity codes?

推荐答案

奇偶校验位"是一种错误检查方法.想象一下,您需要通过连接发送 8 位并确定它们是否正确通过.您可以尝试发送两次,这样如果有错误,接收者就会知道,因为两条消息不同.但是,这需要两倍的带宽,太多了.所以通常每个字节(8 位)也会有一个奇偶校验位.您计算字节中的 1 的数量.如果是奇数,则奇偶校验位为 1.如果是偶数,则奇偶校验位为零.这样,如果有任何单个错误,接收器就会知道,并且只需要八分之一的额外带宽.示例:

A 'parity bit' is a method of error checking. Imagine that you need to send 8 bits over a connection and determine whether they got through right. You could try sending it twice, that way if there is an error, the receiver will know because the two messages differ. However, this requires two times the bandwidth, which is too much. So often every byte (8 bits) will also have a parity bit. You count up the number of ones in the byte. If it is odd, the parity bit is one. If it is even, the parity bit is zero. That way if there is any single error the receiver will know and only one eighth the extra bandwidth is needed. Examples:

Data: 01001001  3 ones, parity bit 1
Data: 00110101  4 ones, parity bit 0

如果接收器得到00111101和奇偶校验位0,它就会知道有一些损坏.

If receiver gets 00111101 and parity bit 0, it will know that there is some corruption.

当然,如果同一字节中有两个错误,则无法检测到这一点 - 例如,如果原始是 00000001 而收到的是 00000010 - 但这是被认为是罕见的,大多数应用程序都不必担心.

Of course if there are two errors in the same byte there will be no way to detect this - example if original is 00000001 and received is 00000010 - but this is considered to be rare enough to not worry for most applications.

这篇关于奇偶校验位和错误检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆