程序代码错误检测

错误检测代码 (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 bits Parity Bit(Odd) Word of 4 bits Parity Bit(Even)
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
... ... ... ...
... ... ... ...
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

程序代码错误检测

程序代码错误检测_错误检测代码相关推荐

  1. 表白代码c语言_这段代码怎么啦?居然瞬间引起了所有程序员网友的注意!

    不知从何时开始,被黑了十几年的「理工男」得到了释放,人们开始把视线聚焦在了一个群体上,那就是「程序员」!比如,热播的电视大剧<欢乐颂2>里,「直男处女情结」引起了整个互联网热议,众网友纷纷 ...

  2. java 代码解析工具_改善 Java 代码质量的工具与方法

    原标题:改善 Java 代码质量的工具与方法 我们可能见过上面的有关代码质量的图片,究竟如何衡量一段代码好坏? 代码质量是什么?为什么它很重要? 作家通过他的著作来讲述了一个清晰的.令人信服的故事.他 ...

  3. python ssd目标检测_目标检测算法之SSD的数据增强策略

    前言 这篇文章是对前面<目标检测算法之SSD代码解析>,推文地址如下:点这里的补充.主要介绍SSD的数据增强策略,把这篇文章和代码解析的文章放在一起学最好不过啦.本节解析的仍然是上篇SSD ...

  4. 处理veh调试器检测_越狱检测抖音逻辑???

    对于应用安全甲方一般会在这三个方面做防御.按逻辑分类的话应该应该分为这几类, 但如果从实现原理的话, 应该分为两类, 用API实现的 和 不用API实现的(这说的不用 API 实现, 不是指换成 in ...

  5. 空间中的语义直线检测_直线检测

    作者:张远学; 陶青川; 王维 期刊:<现代计算机> 为了限制河岸场景下不文明.违规的垂钓行为,提出一种融入深度学习的垂钓行为检测方法.首先使用基于CNN开发的语义分割模型deeplabV ...

  6. 【文件上传绕过】——后端检测_内容检测图片马绕过

    文章目录 一.实验目的: 二.工具: 三.实验环境: 四.漏洞说明: 五.实验过程: 1. 图片马制作: 1.1 文件头检测+文件内容检测文件类型(没有进行后缀名白名单检测): 1.1.1 webji ...

  7. 【教程】unet图像分割检测墙体裂缝检测_瑕疵检测python含代码

    直接上效果图: 整个文件的代码简洁,易懂,如上图所示,代码数据集放在datasets文件夹下, 通过运行make_datasets生成文本数据集 配置文件都在utils文件下, 运行train.py即 ...

  8. java 代码注释搞笑_搞笑的代码注释,那些有趣的程序员

    发表于 2019-04-24 16:11:26 by月小升 搞笑 /*** * .::::. * .::::::::. * ::::::::::: F*CK YOU * ..:::::::::::' ...

  9. python行人检测_行人检测 基于 OpenCV 的人体检测

    原文链接行人检测 基于 OpenCV 的人体检测 - 热分享​hotdog29.com 行人检测 基于 OpenCV 的人体检测 我们都知道,无论性别,种族或种族如何,我们的身体都具有相同的基本结构. ...

最新文章

  1. python+flask+vue开发(1)--虚拟环境创建
  2. HVM guest配置文件
  3. USACO_1_4_Mother's Milk
  4. luinx php木马,Linux Bash Shell 寻找PHP(网站)挂马,后门
  5. Lync Server外部访问系列PART5:模拟公网DNS
  6. 处理Redis里的数据
  7. Debug解决问题方法论
  8. 推荐阅读-Docker实现原理之Namespace,CGroup
  9. 关于生成静态页--终极解决方案
  10. IDEA将maven项目复制成一个新的框架/项目
  11. 构造函数初始化列表用的是构造函数
  12. 【Java】Java_03第一个Java程序
  13. linux 设置显卡命令,linux查看显卡命令
  14. 039 我的技术成长历程
  15. MATLAB傅里叶变换后寻找频谱次大值对应的位置
  16. .NET Standard
  17. 【干货】针对DNN的神经网络中上下文相关处理的连续学习概述
  18. Tomcat修改默认主页
  19. 音乐播放器制作 (HTML + CSS + JavaScript)
  20. 【GaussDB】初始GaussDB和GaussDB版本介绍

热门文章

  1. string转为char数组_StringBuilder的区别是什么?String是不可变?一点课堂(多岸学院)...
  2. 用计算机模拟地球诞生,计算机模拟显示早期金星或像地球一样宜居
  3. java int相除向上取整_java实战项目常用类,Date、Calendar、BigDecimal、Math、UUID
  4. bind() c语言,c/c++ 标准库 bind 函数详解
  5. python函数参数传递机制_Python 学习笔记(一) 理解Python的函数传参机制
  6. 360手柄摇杆漂移修复_彻底解决你的Switch手柄摇杆问题,最省钱的完美修复。
  7. Pytorch Anaconda 安装CPU版本
  8. oracle的sga
  9. 那些你不知道的 getClientRects()
  10. 如何快速精确的和leader沟通