程序代码错误检测_错误检测代码

程序代码错误检测

错误检测代码 (Error Detecting Codes)

A group of bits is known as words, and these words move as an entity from one block to another in the digital system. While moving from one part to another within the system via transmission media, the bits within the word can get altered/distorted due to external factors, whom we call Noise. Because digital systems need to be accurate to the digit, an error can pose a serious threat. So, several error detecting methods are introduced to find these incorrect bits in the words, which can be corrected and after detection and should be retransmitted.

一组位称为字,这些字作为一个实体从数字系统中的一个块移动到另一个块。 当通过传输介质从系统中的一个部分移动到另一部分时,该字中的位会由于外部因素(我们称为“噪声”)而发生更改/失真。 因为数字系统需要精确到数字,所以错误可能会构成严重威胁。 因此,引入了几种错误检测方法以在单词中找到这些不正确的比特,这些错误比特可以被纠正并且在被检测之后应当被重新发送。

平价 (Parity)

The simplest technique for detecting an error in a word is adding an extra bit in the group of bits, this extra bit is known as the parity bit.

检测单词错误的最简单技术是在位组中添加一个额外的位,这个额外的位称为奇偶校验位。

There are two types of parity which we consider for error detection purposes which are ODD parity and EVEN parity. In odd parity, 0 or 1 parity bit is added to the group of bits such that the total number of 1 bit including the parity bit in word remains odd in number. Similarly, in even parity, 0 or 1 bit is added in the group of bits such that total no. of 1 bit including the parity bit in the word remains even in number.

为了错误检测的目的,我们考虑两种奇偶校验,即ODD奇偶校验EVEN奇偶校验 。 在奇数奇偶校验中 ,将01个奇偶校验位添加到位组中,以使包括字中的奇偶校验位的1位总数保持奇数。 类似地,在偶数奇偶校验中,将0或1位添加到位组中,以使总数为0。 包括该字中的奇偶校验位的1位元的数量保持偶数。

Given below is a table which contains message bit of 4 bits and the parity bit in odd and even parity cases,

下表是一个包含4位消息位和奇偶校验情况下奇偶校验位的表,

Word of 4 bitsParity Bit(Odd)Word of 4 bitsParity Bit(Even)
0000100000
0001000011
0010000101
0011100110
0100001001
0101101010
1100111000
0111001111
1000010001
1001110010
1010010100
............
............
4位字 奇偶校验位(奇数) 4位字 奇偶校验位(偶数)
0000 1个 0000 0
0001 0 0001 1个
0010 0 0010 1个
0011 1个 0011 0
0100 0 0100 1个
0101 1个 0101 0
1100 1个 1100 0
0111 0 0111 1个
1000 0 1000 1个
1001 1个 1001 0
1010 0 1010 0
... ... ... ...
... ... ... ...

A parity checker circuit is set up on the receiving side which generates an error whenever an odd number of 1's occurs in case of even parity and an even number of 1's occurs in case of odd parity system.

在接收侧建立一个奇偶校验器电路,每当偶数奇偶校验出现奇数1时发生错误,而在奇偶校验系统奇偶校验发生时偶数1出现错误。

Generally, odd parity is used more often than even parity because even parity does not detect the situation where all 0's is created by a short circuit or other fault condition.

通常,奇数奇偶校验比偶数奇偶校验使用更多,因为偶数奇偶校验无法检测到短路或其他故障情况导致全0的情况。

Example 1: In even-parity system, which of the following words contain an error?

示例1:在偶数奇偶校验系统中,以下哪个单词包含错误?

  1. 0010100011

    0010100011

  2. 1010001010

    1010001010

  3. 0010000110

    0010000110

Answer: In an even-parity system, total number of 1’s should be even. So,

答:在偶数奇偶校验系统中,总数1应该是偶数。 所以,

  1. 0010100011, contains 4 one bit which is even. Thus, it has no errors.

    0010100011 ,包含4个偶数位。 因此,它没有错误。

  2. 1011101010, contains 6 one bit which is even. Thus, it has no errors.

    1011101010 ,包含6个偶数位。 因此,它没有错误。

  3. 0010000110, contains 3 one bit which is odd. Thus, this word has an error.

    0010000110 ,包含3个奇数位。 因此,这个词有错误。

Example 2: In odd-parity system, which of the following words contain an error?

示例2:在奇偶校验系统中,以下哪个单词包含错误?

  1. 1011101111

    1011101111

  2. 1011000011

    1011000011

  3. 1011110110

    1011110110

Answer: In an odd-parity system, total number of 1’s should be odd. So,

答:在奇数奇偶校验系统中,总数1应该是奇数。 所以,

  1. 1011101111, contains 8 one bit which is even. Thus, it has an error.

    1011101111 ,包含8个偶数位。 因此,它有一个错误。

  2. 1011000011, contains 5 one bit which is odd. Thus, it has no errors.

    1011000011 ,包含5个奇数位。 因此,它没有错误。

  3. 1011110110, contains 7 one bit which is odd. Thus, it has no errors.

    1011110110 ,包含7个奇数位。 因此,它没有错误。

翻译自: https://www.includehelp.com/basics/error-detecting-codes.aspx

程序代码错误检测

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/540645.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Web浏览器端通过https 使用mqtt通讯

做的产品简介 这次需要做一个web端的上课平台,有音视频通讯,有白板(画板)功能,有文字通讯等。技术点 音视频通讯需要走Webrtc需要跟ios, android, windows, mac 客户端互联互通一般通讯通过mqtt协议MQTT简介 MQTT(Message Queuing…

vga显示模式_VGA的完整形式是什么?

vga显示模式VGA:视频图形阵列 (VGA: Video Graphics Array) VGA is an abbreviation of "Video Graphics Array". VGA是“视频图形阵列”的缩写 。 It is a three-row 15-pin DE-15 connector display hardware developed by IBM in 1987. It was first …

【iCore4 双核心板_FPGA】例程十一:FSMC总线通信实验——独立地址模式

实验原理: STM32F767上自带FMC控制器,本实验将通过FMC总线的地址独立模式实现STM32与FPGA 之间通信,FPGA内部建立RAM块,FPGA桥接STM32和RAM块,本实验通过FSMC总线从STM32向 RAM块中写入数据,然后读取RAM出来的数据进行…

世界粮农组织五大健康食品_粮农组织的完整形式是什么?

世界粮农组织五大健康食品粮农组织:请注意 (FAO: For the Attention Of) FAO is an abbreviation of "For the Attention Of". FAO是“ For the Attention Of”的缩写 。 It is an expression, which is commonly used in the Gmail platform. When a ma…

http 412 precondition failed

2019独角兽企业重金招聘Python工程师标准>>> 今天在谷歌浏览器上刷新页面的时候,出现了 如下失败信息: HTTP 412 (Precondition Failed) 想想当时的动作是在发送ajax请求失败之后,再刷新,就会出现上面的失败问题。百度…

Python | Pyplot标签

There are the following types of labels, 标签有以下几种, 1)X轴贴标 (1) X-axis labelling) plt.xlabel(Number Line)# Default labellingplt.xlabel(Number Line, colorgreen)#Font colour Changedplt.xlabel(Number Line, colorGreen, fontsize15)#Font size …

LTNS的完整形式是什么?

LTNS:很久没看到 (LTNS: Long Time No See) LTNS is an abbreviation of "Long time, no see". LTNS是“长时间,看不见”的缩写 。 It is an English phrase used when people meet and greet each other after a while when in between they…

MySQL Index Condition Pushdown

2019独角兽企业重金招聘Python工程师标准>>> 一、Index Condition Pushdown简介 ICP(index condition pushdown)是mysql利用索引(二级索引)元组和筛字段在索引中的where条件从表中提取数据记录的一种优化操作。ICP的思…

ADBB的完整形式是什么?

ADBB:所有完成的再见 (ADBB: All Done Bye Bye) ADBB is an abbreviation to All Done Bye Bye. ADBB是All Done Bye Bye的缩写。 Whenever a person wants to convey his message to another person, they use some sort of short-form in the text messages. ADB…

c 环境

系统ubuntu sudo apt-get install vim g openssh-server libgl1-mesa-dev检查下安装的版本gcc -v g -v make -v gdb -v 转载于:https://blog.51cto.com/skinglzw/1964449

java.util (Collection接口和Map接口)

1:Collection和Map接口的几个主要继承和实现类 1.1 Collection接口 Collection是最基本的集合接口,一个Collection代表一组Object,即Collection的元素(Elements)。一些Collection允许相同的元素而另一些不行。一些能排…

scala 拆分字符串翻转_Scala程序分割字符串

scala 拆分字符串翻转A string is a collection that stores multiple characters, it is an immutable sequence which cannot be changed. 字符串是存储多个字符的集合,它是不可更改的不可更改的序列。 分割字符串 (Splitting a string) In Scala, using the spl…

[转载] python 简单示例说明os.walk和os.path.walk的不同

参考链接: 示例说明Python2.x和Python3.x之间的重要区别 import os,os.path def func(arg,dirname,names): for filespath in names: print os.path.join(dirname,filespath) if __name__"__main__": print "os.walk" index 1 for root,subd…

c#中索引器是什么_C#中的索引器

c#中索引器是什么An Indexer is a special feature of C# to use an object as an array. If you define an indexer in a class then it will behave like a virtual array. Indexer is also known as smart array in C#. It is not a compulsory or essential part of OOPS. …

asp.net MVC5为WebAPI添加命名空间的支持

前言 默认情况下,微软提供的MVC框架模板中,WebAPI路由是不支持Namespace参数的。这导致一些比较大型的项目,无法把WebApi分离到单独的类库中。 本文将提供解决该问题的方案。 微软官方曾经给出过一个关于WebAPI支持Namespace的扩展&#xff0…

[转载] Python3.X 线程中信号量的使用方法示例

参考链接: 示例说明Python2.x和Python3.x之间的重要区别 信号量semaphore 是一个变量,控制着对公共资源或者临界区的访问。信号量维护着一个计数器,指定可同时访问资源或者进入临界区的线程数。下面这篇文章主要给大家介绍了关于Python3.X 线…

从流程的自动化中获得最大价值的10种方式

流程自动化很好,如果它可以节省时间并减少错误。但是如果它不能在业务流程中“很好地契合”,那么会难以得到普及。问问有谁没有对语音助手感到伤脑筋。 所幸的是,某些最佳实践让你可以从流程自动化中获得最大价值,以下就是其中的1…

java中null是常量吗_C_NULL Julia中的常量

java中null是常量吗Julia| C_NULL常数 (Julia | C_NULL Constant) C_NULL is a constant of Ptr{Nothing} type in Julia programming language, it represents the null pointer value, which is used for C Null Pointer while calling external code. C_NULL是Julia编程语言…

[转载] Python京东抢购

参考链接: 从Python获取输入 Python京东抢购 分析其中提交信息接口的参数,可以成功抢购商品,并且可以提交订单。。。。2018年7月17日 提交信息的获取 直接提交信息对post提交分析其中的参数。 经过分析参数大多数在:https…

6.04 从字符串中删除不需要的字符

需求:删除所有的0和元音字母。 select ename,replace(replace(replace(replace(replace(ename,A,),E,),I,),O,),U,) as stripped1,sal,replace(sal,0,) stripped2from emp;转载于:https://www.cnblogs.com/liang545621/p/7518766.html