欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > PPT文档下载  

    数字设计课件第二章.ppt

    • 资源ID:5984830       资源大小:441.50KB        全文页数:47页
    • 资源格式: PPT        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    数字设计课件第二章.ppt

    2023/9/11,数字逻辑设计及应用,1,Chapter2 Number Systems and Code,重点:1)二进制、八进制和十六进制数的表达及各种数制之间的相互转换;2)符号数的表达及其加、减运算;3)BCD编码和GRAY码。,数字逻辑设计及应用,2,2.1 Positional Number Systems,1.Decimal number A decimal number 1536.79d digits:0、1、2、3、4、5、6、7、8、9weight:10iradix:10power:i,start from the left of the decimal point,increase by one for each successive position from 0;from the right of the decimal point,decrease by one from(-1).,数字逻辑设计及应用,3,An arbitrary decimal number D with p digits in integer and n digits in fractiondp-1dp-2d1d0.d-1d-2d-nGeneral expression:,2.Binary numbersradix:2digits:0、1,also be called bit,weight:2i,数字逻辑设计及应用,4,A binary number 1011010.1012,:,an arbitrary binary number Bbp-1bp-2b1b0.b-1b-n,the general expressions:The sum of each digit multiplied by the corresponding power of the radix is the binary numbers decimal value.,数字逻辑设计及应用,5,3.Others LSB:Least Significant Bit MSB:Most Significant Bit bp-1bp-2b1b0.b-1b-n,MSB,LSB,数字逻辑设计及应用,6,2.2 Octal and Hexadecimal Numbers,1.concept,数字逻辑设计及应用,7,Exp3:give the decimal value of the following numbers.215.78=3AD.8h=2.2-8 and 2-16 numbers Convensions,Table 1 relation between binary and octal,数字逻辑设计及应用,8,Table 2 binary-hexadecimal relations,数字逻辑设计及应用,9,(a)binaryoctal、hexadecimal conversions,Starting at the binary point,separate the bits into groups of 3 or 4,and replace each group with the corresponding octal or hexadecimal digit.If the leftmost group fall short of 3 or 4 bits,then 0 should be added to the left of the MSB;so do the right。Exp:do the following positional-number-system conversion。1111011010.00112=(?)8=(?)hSolution:=1732.148=3DA.3h,数字逻辑设计及应用,10,(b)octal,hexadecimal-binary number conversion,Replace each octal or hexadecimal with the corresponding group of 3 or 4bits.Exp:267.248=(?)2 96CA.28h=(?)2,数字逻辑设计及应用,11,2.3 general positional-number-system conversions,Radix-r-to-decimal conversion:Each radix-r numbers digit multiply by its own weight,and add them.Exp:512.46=(?)d1、decimal-to-radix-r conversioninteger partmethods:除基取余The integer of a p digits number in radix r is:Divide the formula by r successively,yield the successive digits of the integer of D(radix r)from the right to left till the quotient is 0.,数字逻辑设计及应用,12,Exp:371d=(?)2=(?)8=(?)h2、decimal-to-radix-r conversionfraction partmethods:乘基取整The fraction of a p digits number in radix r is:Multiply the formula by r successively,yield the successive digits of the fraction of D(radix r)from the left to right till the required digits d-1,d-2,d-n are acquired.,数字逻辑设计及应用,13,Exp8:0.71875d=(?)2=(?)8=(?)h3、summary of the positional-number-system conversions(1)conversion between decimal and radix r(2)radix-r-to-radix-j conversion(non-decimal)binary-to-octal,binary-to-hexadecimal or reverse,be converted directly conforming to the section-replace rules.others,radix-r numberdecimal radix-j number,数字逻辑设计及应用,14,2.4 addition and subtraction of nondecimal number,1、Rules of binary addition and subtraction(1)rules of additionS=x+y+CinExp:01001011+10001111=?,initial carry,carry,数字逻辑设计及应用,15,(2)Rules of Binary Subtraction,d=x-y-binExp:11001100-01011100=?,initial borrow,borrow,数字逻辑设计及应用,16,2.addition and subtraction of octal and hexadecimal,addition:If two digits sum is greater than the radix on each column,then carry 1 to the next more significant bit.subtraction:If the minuend is less than subtrahend,then borrow 1 from the next more significant bit.,数字逻辑设计及应用,17,2.5 Representation of Negative Numbers,1、signed-magnitude representation unsigned numbers:just the magnitude of a number is represented,no+or-sign symbol before the number。signed numbers:+or-is added to the left of the number。representation of signed number:sign symbol+number magnitude,like+34d、-1102、+1Dh、,数字逻辑设计及应用,18,in binary number,sign bit+magnitudeThe MSB of a bit string is used as the sign bit:0“+”,1“-”this type of signed binary number is called Signed Magnitude(S-M码,或原码)。比如,+11101=011101-1011=11011,数字逻辑设计及应用,19,The range of S-Ms representable numbers.an n-bit S-M number B:bn-1bn-2b1b0Its range is:-(2n-1-1)+(2n-1-1)Include two zero:-0 and+0Exp:find the S-M of the following signed numbers。How to represent by using 8-bit S-M.+11101,-1011,+18,-18the fault of S-M which is used in arithmetical operation:it cant be calculated directly.,符号位,数字逻辑设计及应用,20,2、Complement Number System,radix complement(基数补码数制)diminished radix-complement(基数减1补码数制)An n-digit number D in radix r:D=dn-1d1d0,radix-complement diminished radix-complement(也称基数反码)Relation between these two:Table 2-4,2-5(P.36)shows some rs and(r-1)s complement.,数字逻辑设计及应用,21,3.Twos-complement Representation,Twos complement is a method for representing signed integers as binary numbers.n-bit binary number B=bn-1b1b0,the twos complement is:B 2s=2n-B for Exp.,8-bit binary number twos complement0000000028-0=000000000000000128-1=111111110000001028-10=111111101111111100000001,数字逻辑设计及应用,22,Define these twos complement as signed number,the MSB is served as sign bit。MSB=0,positive number MSB=1,negative numberweight of the sign bit:MSB=0,weight+2n-1 MSB=1,weignt-2n-1Range of the value:positive 0+(2n-1-1);negative(-2n-1)-1。Only one zero in twos complement.,数字逻辑设计及应用,23,twos complement number and their decimal equivalent,数字逻辑设计及应用,24,数字逻辑设计及应用,25,property,sign bit=0,S-M and twos-complement have the same decimal value;sign bit=1,S-M and twos-complement have different decimal value。How to find the twos-complement representation of a negative decimal number?,数字逻辑设计及应用,26,Same value,but has opposite sign symbol,数字逻辑设计及应用,27,So,to calculate the 2s complement of an negative integer,invert the n-bit binary equivalent of the given number magnitude bit by bit,and then add 1 to the LSB.Exp:calculate the 2s complement of(+65)and(-65d)in 8-bit form.Solution:+65 01000001-65 binary equivalent of 65 is 01000001,invert bit by bit 10111110 add 1 10111111,数字逻辑设计及应用,28,An n-bit binary number B=bn-1b1b0,the ones-complement is:B 1s=2n-1-BIt is also the method of representing signed binary numbers.MSB=0,positive,weight+(2n-1-1)MSB=1,negative,weight-(2n-1-1)。Range of representable numbers:negative-(2n-1-1)-0positive+0(2n-1-1),4.Ones-complement Representation,数字逻辑设计及应用,29,1s-complements property,N-bit positive integers are represented in the same way as n-bit sign-magnitude notation.The ones-complement of an n-bit negative integer number is obtained by complementing each one of the bits(the n-bit binary number),i.e.,a 1 is replaced by a 0,and a 0 is replaced by a 1.Exp.8-bit 1s-complement of the number.+18d=00010010-18d=1s complement of 18=11101101,数字逻辑设计及应用,30,返回,From the least number to biggest number,2s comp.and 1s comp.are successive increased by 1.,Summary of S-M,2s comp.,1s comp.,数字逻辑设计及应用,31,All of these three are used to represent signed integer number in binary system.Comparing of the representing range of the value Representations of positive integer are same;but the representations of negative integer are different at all.,数字逻辑设计及应用,32,Calculate signed integers S-M,2s-comp.,1s-comp.,positive signed number:convert the given number into the wanted n-bit binary equivalent.negative signed number:first convert the number into n-bit binary equivalent,S-M let MSB=1;1s-complement invert the n-bit binary equivalent bit by bit,get the n-bit 1s-comp.;2s-complement add 1 to the LSB of the n-bit 1s-complement of the given numberExp13:Finding the S-M,2s-comp,1s-comp of the following signed number in 8-bit。+60,-60,+10010,-1101,数字逻辑设计及应用,33,5.Sign extension,When we convert an n-bit 2s complement number X into an m-bit one:(a)if m n,append(m-n)copies of Xs sign bit to the left of X;(b)if m n,discard Xs(n-m)leftmost bit。So do to 1s-complement.,数字逻辑设计及应用,34,2.6 Twos-complement Addition and Subtraction,1、RulesTwo operands add or subtract directly。Exp:3+3,4+(-5),7-3,1-6,,符号数表格,数字逻辑设计及应用,35,2.A graphical view,Modular:the biggest number of quantities that a n-bit system can represent is 2n.Modular operation:m MOD 2n=m-i2n(i=int()Exp:18 MOD 16=2,+2,数字逻辑设计及应用,36,3.overflow,If an addition operation produces a result that exceeds the range of the number system,overflow is said to occur.that is,if result+(2n-1-1),or-(2n-1),overflow is occurred.Detecting of overflow:An addition overflows if the addends signs are the same but the sums sign is different from the addends.Exp:judge whether the result of the addition overflow or not。11111101+10000001,数字逻辑设计及应用,37,4.Subtraction rules,m-n=m+(2n-n)Negate the subtrahend by taking its 2s complement,and then add it to the minuend using the normal rules for addition.,-2,数字逻辑设计及应用,38,Exp:,数字逻辑设计及应用,39,5.Twos-complement and Unsigned Binary Numbers,When n-bit binary numbers are taken for unsigned number,the rules of addition and subtraction are as same as the 2s-complement.If the result of addition operation exceed the range of n-bit system,a carry is produced to the left more significant bit.,数字逻辑设计及应用,40,2.10 Binary Codes for Decimal Numbers,Emphasis:BCD,excess-3code:a set of n-bit in which different bit strings represent different numbers of other things is called a code.code word:a particular combination of n bit-values.1、BCD code the digits 09 are encoded by 4-bit unsigned binary representations,0000 through 1001.and the words 1010 1111 are not used.(invalid code word),数字逻辑设计及应用,41,BCDs property,BCD is weighted code,the weights for the bits from left to right is:23、22、21、20。also called 8421BCD。(1)representing numbers by BCDlike,11d,BCD00010001256d,BCD 0010 0101 0110(2)Packed BCDtwo-digits-per-byte,数字逻辑设计及应用,42,(3)Addition with BCD be similar to 4-bit unsigned binary number addition.But a correction must be made if the sum exceeds 1001 if,sum1001,then add 0110 to the result。Exp.:,数字逻辑设计及应用,43,2.Other decimal codes,P.49 table2-9,Excess-3 code:the code word for each decimal digit is the corresponding BCD code word plus 0011.it is a self-complement code.2421 code:weighted code,each bit of the code word has assigned weight with 2,4,2 and 1 from left to right。self-complement,数字逻辑设计及应用,44,2.11 Gray code,3-bit mechanical encoding diskstraightforward binary encoding(natural binary codes)two successive values differ in only one bit,000,001,010,011,100,101,110,111,数字逻辑设计及应用,45,Constructing an n-bit gray code,1-bit gray code:0,1The first 2n code words of an(n+1)-bit Gray code equal the code words of an n-bit Gray code,written in order with a leading 0 appended.The last 2n code words of an(n+1)-bit Gray code equal the code words of an n-bit Gray code,but written in reverse order with a leading 1 appended.,数字逻辑设计及应用,46,Exp:reflected binary code,数字逻辑设计及应用,47,translating a binary value into the corresponding Gray code,Binary number bn-1bn-2b1b0Gray code gn-1gn-2g1g0Then gn-1=bn-1 bit i of a Gray-code word is 0 if bits i and i+1 of the corresponding binary code word are the same,else bit i is 1.101102=()grey解:B 1 0 1 1 0 G 1 1 1 0 1,

    注意事项

    本文(数字设计课件第二章.ppt)为本站会员(小飞机)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开