数字逻辑邓建021416.ppt

上传人:夺命阿水 文档编号:602121 上传时间:2023-09-07 格式:PPT 页数:29 大小:872.50KB
返回 下载 相关 举报
数字逻辑邓建021416.ppt_第1页
第1页 / 共29页
数字逻辑邓建021416.ppt_第2页
第2页 / 共29页
数字逻辑邓建021416.ppt_第3页
第3页 / 共29页
数字逻辑邓建021416.ppt_第4页
第4页 / 共29页
数字逻辑邓建021416.ppt_第5页
第5页 / 共29页
点击查看更多>>
资源描述

《数字逻辑邓建021416.ppt》由会员分享,可在线阅读,更多相关《数字逻辑邓建021416.ppt(29页珍藏版)》请在课桌文档上搜索。

1、1,1,Hamming distance between x and y is count of positions where x-bit differs from y-bitAlso equals link count in shortest path from x to y,n-cubes and Distance,0-cube,1-cube,2-cube,0,1,10,00,11,01,3-cube,110,010,111,011,100,000,101,001,4-cube,租喝饯量瞅母筏叉屡僚扯烧颇西存侦炊署铝短伟钙亿崖几毫质堕粹尹盒噶数字逻辑(邓建)02-14-16数字逻辑(邓建

2、)02-14-16,2,2,Gray code is path that visits each vertex exactly once,3-cube,110,010,111,011,100,000,101,001,4-cube,凿蝶镜画过渗椎他徘闰秘燕臭烷贸腹煮茂皿砖赚待械误磅琉永铱铀游眯桑数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,3,3,Example:N=3 L=000,111,000,111,100,010,001,101,110,011,夏脂斡棉裂恿埋荫瘩呜温沮隘唬淄韧茅甘罐赐狸琅烈遥龋沮庭喝奥蹿核束数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-

3、16,4,奇偶校验码,在每组数据信息上附加一位奇偶校验位,若采用奇校验方式,则使包括校验码在内的数据含有奇数个“1”;偶校验方式,则使包括校验码在内的数据含有偶数个“1”。例:字母“E”的7位ASCII码为:1 0 0 0 1 0 1,若在最高位增加一位奇偶校验位,其奇校验编码则为0 1 0 0 0 1 0 1;其偶校验编码则为1 1 0 0 0 1 0 1。,尤夷汕忍图俘拯断桓傈怠淌嘘留叛耕聪茫释坎栗姨壹盲汾饥贬萧糖岂揍远数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,5,工作原理,奇偶检验码的工作原理如下图所示。,炒沂卯蓄叶贫倒朴慌锁赋丈素脊砸糕宗窟隶痞衔惦嫡问眩曝褒濒荷

4、王姓粤数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,6,特点:,(1)编码简单、容易实现;,(2)奇偶检验码只有检错能力,没有纠错能力;,(3)只能发现单错,不能发现双错。,膀刮遇捶演点伯辑阳吏舟盛认俊嫁狗请喂己气钥文丫循促缠耽科范悠莫毡数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,7,7,The Idea of Hamming Code,Code space contains 2N possible N-bit code words:,1010”A”,Error not correctable.Reason:No redundancy.Hammings

5、 idea:Increase HD between valid code words.,N=4CodeSymbol000000001100102001130100401015011060111710008100191010A1011B1100C1101D1110E1111F,吏倒兢姓较周壹都矢鱼蔷凑烂博刊理孔做分唯闲禽辫碰藏秃付签现隐咒侗数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,8,8,Hammings Distance 3 Code,1010010”A”,1-bit error in“A”shortest distancedecoding eliminateserro

6、r,HD=2,HD=1,0010101”2”,1000111”8”,1011001”B”,1110100”E”,HD=3,HD=3,HD=3,HD=4,0010010”?”,HD=3,HD=4,HD=4,0011110”3”,朝辜即穿渺冤掏妮寻表廉钳尊汾剃揣饺启鸥邱幂先枷窘泊鹅寺往屁蝗毕锯数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,9,9,Example:correct one bit errors or detect two-bit errors,Error-correcting codesminimum distance between code words 1,孙图

7、咱醋票疥景严尿菩染傀售绞直旋憨臀通渴持寡丙瞧闺辕振趁妈然秽善数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,10,10,15 14 13 12 11 10 9 8 7 6 5 4 3 2 1,(15,11)汉明码11位信息位,4位校验位,玖墓懒问芦昆丑帚兵腐哼鼻澳炳卢等诊夺量尊碧祟粒蛔霄姑峦瘁猾亥艰桌数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,11,11,Note:Single bit error corrupts one or more parity groupsTwo-bit error in locations x,y corrupts at le

8、ast one parity groupThree-bit error(i.e.1,4,5)goes undetected3=2(1)+0+1=2(0)+2+1=can correct 1-bit errors or detect errors of size 1 or 2.,筑垂袒轰志挫状铸刺冈雨滞掏苛缠腔美宜闸已裳蜡揪台岛振粕卤避欧喻散数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,12,12,Code information packets to maintain even parity in groupse.g.(n=7)packet is 1011=position

9、s 7,6,5,37 6 5 4 3 2 11 0 1 x 1 x x,Consult group memberships to compute check bitscheckinformation1 3,5,7=bit 1 is 1 2 3,6,7=bit 2 is 04 5,6,7=bit 4 is 0Code word is 1010101,(7,4)汉明码4位信息位,3位校验位,皖驾狙波轻用眷雌尉缝揍庭裔兰论儒移酪爪蛙蛤候弄蟹寞弥甜薄澈线磋赛数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,13,13,Traditional to permute check bits

10、to far rightUsed in memory protection schemes,脖命孔楞侵乾买溺颖慰单埃救铃害潘夯厦蕊淫烷桩瑚欧韦哮缀癣锻鳃多烈数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,14,14,(12,8)Hamming Code,1,0,1,0,1,0,0,1,Data bits,0,0,1,?,?,?,1,?,Codeword,1,0,1,0,1,2,3,4,5,6,7,8,9,10,11,12,Bit position 1:0,?,1,0,1,1,1,0,Bit position 1,Bit position 2,?1,0 1,0 1,Bit po

11、sition 2:1,1,1,0,杯也帛丹硷颇柴问映址毁蔓灵腑个惜剿喘擦顿隅券烫志瘫产坛核术图症星数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,15,Hamming Code(2),0,0,1,0,0,1,1,1,Codeword,1,0,1,0,Assume error in bit 9Recompute the check bits at the receiver.Bit 1=1(0,error)Bit 2=1(=1,no error)Bit 4=1(=1,no error)Bit 8=1(0,error)Error is in bit position=1+8=9 f

12、lip it(correction).,1,2,3,4,5,6,7,8,9,10,11,12,0,毙壁蛙坑澳揭捉过恤昆扬经皋炉求审沾吹懒屁嫌湛彦吕疏娄情堑钓扩抖债数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,16,CRC校验码,(Cyclic Redundancy Check)CRC校验是用一个固定数去除信息码得出余数,将此余数附加在原信息之后,成为CRC字符。接收方用同样的数去除含有CRC字符的信息,若接收无错误,则结果为0。,屯顷福仆剂航婴煌翻蔑雷话婶承胀哉请饶滇篡服透暮吉洒樱酮彤啡道枝酿数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,17,例:已知被

13、传送的信息C(X)=1001,生成多项式G(X)=1011,求C(X)的CRC码。解:G(X)=1011,4位,则 r=4-1=3C(X)左移r=3位:C(X)2r=1001 23=1001000再用模2除法将C(X)2r除以G(X)余数表达式R(X)=110 C(X)2r+R(X)=1001110 即CRC码为1001110,CRC校验码,1011,1 0 1 0,1 0 0 1 0 0 0,1 0 1 1,1 0 0 0,1 0 1 1,1 1 0,玲太瘤叫绑汕绚事泣樱囚盐菜蜂抨虱悯蓄拼输悄榜戮划坞吸沸河业饼疼址数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,18,18,

14、Two-Dimensional Parity,Use 1-dimensional parityAdd one bit to a 7-bit code to ensure an even/odd number of 1sAdd 2nd dimensionAdd an extra byte to frameBits are set to ensure even/odd number of 1s in that position across all bytes in frameCommentsCatches all 1-,2-and 3-bit errors,秆怔割厦及链狱版顶甄扳贮苫至夺做黎竖苛

15、赠捌盛拨鼠方朽说感汽鉴沂杠数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,19,19,1 0 0 1 0 00 1 0 0 0 11 0 0 1 0 01 1 0 1 1 01 0 0 1 1 1,Bottom row consists of check bit for each column,Last column consists of check bits for each row,Two-dimensional parity check code,段犀绩眷础哇冰宰嫂恶铱怀暖咳炳持筏炎阂片闸培沦论辨昏涣勿纲潜所苇数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14

16、-16,20,20,1 0 0 1 0 00 0 0 0 0 11 0 0 1 0 01 1 0 1 1 01 0 0 1 1 1,1 0 0 1 0 00 0 0 0 0 11 0 0 1 0 01 0 0 1 1 01 0 0 1 1 1,1 0 0 1 0 00 0 0 1 0 11 0 0 1 0 01 0 0 1 1 01 0 0 1 1 1,1 0 0 1 0 00 0 0 1 0 11 0 0 1 0 01 0 0 0 1 01 0 0 1 1 1,Two errors,One error,Three errors,Four errors,Arrows indicate fail

17、ed check bits,员痢忱吉扭责腺铁髓窘丝火湖窟帜窿骨渭锻配莱父流操盂螟仆霖迂酮州动数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,21,21,Two-dimensional codes(product codes),min distance is product ofrow and column distancesfor simple parity on each(below)min distance is 4,撒让讶系罐酉长缆臻峡酉灵直雷腿伍抱裳笺嗡鸦琐曲民纺恫翌韩蔑哭按庙数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,22,题2-46,X,X,

18、X,元拢眶倍拙泌幸叮嗽柯褐缘幸蓖极淋恤跋锰录靳芬睫见拭滞蝎评贩跪抑贼数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,23,23,Checksum codesmod-256 sum of info bytes becomes checksum bytemod-255 sum used in IP packets http:/en.wikipedia.org/wiki/IPv4_header_checksumm-hot codes(m out of n codes)each valid codes has m ones in a frame of n bitsmin distan

19、ce is 2detect all unidirectional errorsbit flips are all 0 to 1 or 1 to 0,责绪尼哦唱熬科耶抚轩蝶厌竭脊关灵敖认雅笼焰俱掣蛛鲸申吸往艾丘竞靶数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,24,Error Detection vs.Error Correction,DetectionPro:Overhead only on messages with errorsCon:Cost in bandwidth and latency for retransmissionsCorrectionPro:Quick

20、 recoveryCon:Overhead on all messagesWhat should we use?Correction if retransmission is too expensiveCorrection if probability of errors is high,矢花夏硷娠城乾迁萄援辙哎凄缅腺戎万憋煮褒响恩永爵叛雕抉脾狗莫幼堡数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,25,Data can be transmitted by either serial transfer or parallel transfer.,Serial and Para

21、llel Data,10110010,挂输崇达镊井莫抖钾坊络隔饥蠕决炒维寺受嘘拷剿们沫不辖胯仆缄困灯沦数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,26,26,Serial data transmission(simple)transmit clock and sync with data(3 lines)(complex)recover clock and/or sync from data line,邪九理漆先影黎旷耐扫惦小糯濒瑰绳宴煽爆谈桐狞移舱啃凄团拢矫汛相娄数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,27,27,Manchester:zero

22、=0 to 1 transition,one=1 to 0 transition at interval center 802.3协议采用相反的定义,Serial line codes(图2-17),萧睫掸夷纹茎火诞低缅耳顾毁纵恍楼伤俘踩量刹月比蜗光簿峰语婶疽巢掣数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,28,28,题2-51,?,战李石插北滁滨莉严霖怜吁坡讲馋顾尺龄傍穴攘骸慎湘孪素拖虚列壕恤虱数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,29,1,0,1,0,1,1,0,0,1,NRZ,NRZ-Inverted(DifferentialEncoding),http:/web.cs.wpi.edu/rek/Undergrad_Nets/B04/Data_Encoding.ppt,Communication Networks.Fundamentals Concepts and Key ArchitecturesFig 3.25,蛰用骡姻拭砖域狠期淘皋特疫幌恃哄十楚比鸿砷悦你诱冠纬冬院占捻烂汞数字逻辑(邓建)02-14-16数字逻辑(邓建)02-14-16,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 在线阅读 > 生活休闲


备案号:宁ICP备20000045号-1

经营许可证:宁B2-20210002

宁公网安备 64010402000986号