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

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

问题描述

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

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.如果为偶数,则奇偶校验位为零.这样,如果有任何单个错误,接收器将知道,并且仅需要八分之一的额外带宽.例子:

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天全站免登陆