欢迎来到天天文库
浏览记录
ID:57599817
大小:438.00 KB
页数:17页
时间:2020-08-28
《数字逻辑设计及应用教学课件:2-3-b编码2.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、class-exercises1、Writethe8421binary-codeddecimalrepresentationsforthedecimalnumbers:5862、Indicatewhetherornotoverflowoccurswhenaddingthefollowing8-bittwo’scomplementnumbers:11010100+1010101100100110+01011010Code(编码)binary-codeddecimal(BCD码)1bytemayrepresentthevaluesfrom0to99.Binary-c
2、odeddecimalisaweightedcode(加权码)TheweightsfortheBCDbitsare8,4,2,and1.紧缩BCD(Packed-BCD)把两个BCD数码装配在1个字节中.10010101BCD=9510AdditionofBCDdigits.(P50)BCD(8421)码2421码余3码(excess-3)二五混合码(biqunarycode)(anerror-detectingproperty具有检错特性)10中取1码(1-out-of-10code)加权码(WeightedCode)自反码(self-complementin
3、g)Table2-9(P49).(P50)2.11Graycode(格雷码)001-011-010P522.11Graycode(格雷码)特点:任意相邻码字间只有一位数位变化最高位的0和1只改变一次最大数回到0也只有一位码元不同2.11Graycode(格雷码)构造方法直接构造Thebitsofann-bitbinarycordwordarenumberedfromrighttoleft,from0ton-1.[对n位二进制的码字从右到左编号(0~n-1)]BitiofaGray-codecodewordis0ifbitsiandi+1ofthecorrespo
4、ndingbinarycodewordarethesame,elsebitiis1.(若二进制码字的第i位和第i+1位相同,则对应的葛莱码码字的第i位为0,否则为1。)(Wheni+1=n,bitnofthebinarycodewordisconsideredtobe0.)ReflectedCode(反射码)ExampleofGray-code10111002=Gray-code11100101011100010001112.12*字符编码P(53)字符编码是ASCII码,即美国信息交换标准码(AmericanStandardCodeforInformation
5、Interchange)具有128个字符和符号,以7位二进制编码表示。Yes:111100111001011010011Iftherearendifferentactions,conditions,orstates,wecanrepresentthemwithab-bitbinarycodewithbits.(Thebracketsdenotetheceilingfunction—thesmallestintegergreaterthanorequaltothebracketedquantity.Thus,bisthesmallestintegersuchtha
6、t2b≥n.)1-out-of-ncode(n中取1码)2.13*CodesforActions,Conditions,andStates(字符、动作、条件和状态编码)(P53)2.16*CodesforSerialDataTransmissionandStorage(用于串行数据传输与存储的编码)P(69)ParallelandSerialDatafloatingpointnumbers(浮点数)浮点数由一个整数或定点数(即尾数)乘以某个基数(计算机中通常是2)的整数次幂得到,这种表示方法类似于基数为10的科学记数法。所谓浮点数就是小数点在逻辑上是不固定的,而
7、定点数只能表示小数点固定的数值。一个指数范围为±4的4位十进制浮点数可以用来表示43210,4.321或0.00043214.321x10n(n=-4~4)floatingpointnumbers(浮点数)IEEE于1985年指定的计算机处理浮点数标准1、以4个字节表示的单精度格式2、以8个字节表示的双精度格式单精度格式为例:S=1位符号位e=8位指数f=23位有效数二进制数的浮点数表达*浮点数由三部分构成:符号位(Sign)、阶码、尾数(Mantissa)。它表示了浮点数:±(1.尾数)×(2^E)。其中符号位0表示+,1表示-。(1.尾数)是一个二进制的数
8、。2^E表示2的E次方,
此文档下载收益归作者所有