




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
Chapter2NumberSystemsandCode重點(diǎn):1)二進(jìn)制、八進(jìn)制和十六進(jìn)制數(shù)的表達(dá)及各種數(shù)制之間的相互轉(zhuǎn)換;2)符號(hào)數(shù)的表達(dá)及其加、減運(yùn)算;3)BCD編碼和GRAY碼。2/28/20251數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.1PositionalNumberSystems1.Decimalnumber
Adecimalnumber1536.79d
digits:0、1、2、3、4、5、6、7、8、9weight:10iradix:10power:i,startfromtheleftofthedecimalpoint,increasebyoneforeachsuccessivepositionfrom0;fromtherightofthedecimalpoint,decreasebyonefrom(-1).powerweightdigitradix2數(shù)字邏輯設(shè)計(jì)及應(yīng)用
AnarbitrarydecimalnumberDwithpdigitsinintegerandndigitsinfractiondp-1dp-2……d1d0.d-1d-2……d-nGeneralexpression:2.Binarynumbersradix:2digits:0、1,alsobecalledbit,weight:2i3數(shù)字邏輯設(shè)計(jì)及應(yīng)用Abinarynumber1011010.1012,:※anarbitrarybinarynumberBbp-1bp-2…b1b0
.b-1…b-n
,thegeneralexpressions:Thesumofeachdigitmultipliedbythecorrespondingpoweroftheradixisthebinarynumber’sdecimalvalue.4數(shù)字邏輯設(shè)計(jì)及應(yīng)用3.OthersLSB:LeastSignificantBitMSB:MostSignificantBit
bp-1bp-2…b1b0.b-1…b-nMSBLSB5數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.2OctalandHexadecimalNumbers1.conceptOctalHexadecimalradix816weight8i16idigits0、1、2、3、4、5、6、70、1、2、3、4、5、6、7、8、9、A、B、C、D、E、FGeneralexpression6數(shù)字邏輯設(shè)計(jì)及應(yīng)用Exp3:givethedecimalvalueofthefollowingnumbers.215.78=3AD.8h=2.2-8and2-16number’sConvensions
octal01234567binarysection000001010011100101110111Table1relationbetweenbinaryandoctal7數(shù)字邏輯設(shè)計(jì)及應(yīng)用hexadecimalbinarysection0000010001200103001140100501016011070111hexadecimalbinarysection8100091001A1010B1011C1100D1101E1110F1111Table2binary-hexadecimalrelations8數(shù)字邏輯設(shè)計(jì)及應(yīng)用(a)binary——octal、hexadecimalconversionsStartingatthebinarypoint,separatethebitsintogroupsof3or4,andreplaceeachgroupwiththecorrespondingoctalorhexadecimaldigit.Iftheleftmostgroupfallshortof3or4bits,then0shouldbeaddedtotheleftoftheMSB;sodotheright。Exp:dothefollowingpositional-number-systemconversion。
1111011010.00112=(?)8=(?)hSolution:=1732.148=3DA.3h9數(shù)字邏輯設(shè)計(jì)及應(yīng)用(b)octal,hexadecimal-binarynumberconversionReplaceeachoctalorhexadecimalwiththecorrespondinggroupof3or4bits.Exp:267.248=(?)296CA.28h=(?)210數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.3generalpositional-number-systemconversionsRadix-r-to-decimalconversion:Eachradix-rnumber’sdigitmultiplybyitsownweight,andaddthem.Exp:512.46=(?)d1、decimal-to-radix-rconversion—integerpartmethods:除基取余Theintegerofapdigitsnumberinradixris:Dividetheformulabyrsuccessively,yieldthesuccessivedigitsoftheintegerofD(radixr)fromtherighttolefttillthequotientis0.11數(shù)字邏輯設(shè)計(jì)及應(yīng)用Exp:
371d=(?)2=(?)8=(?)h2、decimal-to-radix-rconversion—fractionpartmethods:乘基取整Thefractionofapdigitsnumberinradixris
:Multiplytheformulabyrsuccessively,yieldthesuccessivedigitsofthefractionofD(radixr)fromthelefttorighttilltherequireddigitsd-1
,d-2,……,d-n
areacquired.12數(shù)字邏輯設(shè)計(jì)及應(yīng)用Exp8:
0.71875d=(?)2=(?)8=(?)h3、summaryofthepositional-number-systemconversions(1)conversionbetweendecimalandradixr(2)radix-r-to-radix-jconversion(non-decimal)binary-to-octal,binary-to-hexadecimalorreverse,beconverteddirectlyconformingtothesection-replacerules.others,radix-rnumber——decimal——radix-jnumber13數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.4additionandsubtractionofnondecimalnumber1、Rulesofbinaryadditionandsubtraction(1)rulesofadditionS=x+y+CinExp:01001011+10001111=?CinxyCoutS0000000101010010111010001101101101011111initialcarrycarry000011110c14數(shù)字邏輯設(shè)計(jì)及應(yīng)用(2)RulesofBinarySubtractiond=x-y-binExp:11001100-01011100=?binxyboutd0000000111010010110010011101101100011111initialborrowborrow011100000b15數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.additionandsubtractionofoctalandhexadecimaladdition:Iftwodigit’ssumisgreaterthantheradixoneachcolumn,thencarry1tothenextmoresignificantbit.subtraction:Iftheminuendislessthansubtrahend,thenborrow1fromthenextmoresignificantbit.16數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.5RepresentationofNegativeNumbers1、signed-magnituderepresentation
unsignednumbers:justthemagnitudeofanumberisrepresented,no‘+’or‘-’signsymbolbeforethenumber。
signednumbers:’+’or‘-’isaddedtotheleftofthenumber。representationofsignednumber:
①signsymbol+numbermagnitude,like+34d、-1102、+1Dh、…
17數(shù)字邏輯設(shè)計(jì)及應(yīng)用②inbinarynumber,signbit+magnitudeTheMSBofabitstringisusedasthesignbit:0—“+”,1—“-”thistypeofsignedbinarynumberiscalledSignedMagnitude(S-M碼,或原碼)。比如,+11101=011101-1011=1101118數(shù)字邏輯設(shè)計(jì)及應(yīng)用③TherangeofS-M’srepresentablenumbers.ann-bitS-MnumberB:
bn-1bn-2…b1b0Itsrangeis:-(2n-1-1)~+(2n-1-1)
Includetwozero:-0and+0Exp:findtheS-Mofthefollowingsignednumbers。Howtorepresentbyusing8-bitS-M.+11101,-1011,+18,-18④thefaultofS-Mwhichisusedinarithmeticaloperation:itcan’tbecalculateddirectly.符號(hào)位數(shù)值19數(shù)字邏輯設(shè)計(jì)及應(yīng)用2、ComplementNumberSystemradixcomplement
(基數(shù)補(bǔ)碼數(shù)制)diminishedradix-complement(基數(shù)減1補(bǔ)碼數(shù)制)Ann-digitnumberDinradixr:D=dn-1……d1d0,①radix-complement②diminishedradix-complement(也稱基數(shù)反碼)Relationbetweenthesetwo:Table2-4,2-5(P.36)showssomer’sand(r-1)s’complement.20數(shù)字邏輯設(shè)計(jì)及應(yīng)用3.Two’s-complementRepresentation
Two'scomplementisamethodforrepresentingsignedintegersasbinarynumbers.n-bitbinarynumberB=bn-1……b1b0,thetwo’scomplementis:B
2’s=2n-B
forExp.,8-bitbinarynumber two’scomplement 00000000 28-0=00000000 00000001 28-1=11111111 00000010 28-10=11111110 …… …… 11111111 0000000121數(shù)字邏輯設(shè)計(jì)及應(yīng)用Definethesetwo’scomplementassignednumber,theMSBisservedassignbit。
MSB=0,positivenumberMSB=1,negativenumberweightofthesignbit:MSB=0,weight+2n-1
MSB=1,weignt-2n-1Rangeofthevalue:positive—0~+(2n-1-1);
negative—(-2n-1)~-1。Onlyonezerointwo’scomplement.22數(shù)字邏輯設(shè)計(jì)及應(yīng)用two’scomplementnumberandtheirdecimalequivalent2’scomplementdecimal00000000000000001+1…………01111111+12710000000-12810000001-127…………11111110-211111111-123數(shù)字邏輯設(shè)計(jì)及應(yīng)用2’s-complementdecimalequivalentS-M000000000000000001000000000000001+100000001……………..01111111+1270111111110000000-128-10000001-12711111111………………11111110-21000001011111111-11000000124數(shù)字邏輯設(shè)計(jì)及應(yīng)用propertysignbit=0,S-Mandtwo’s-complementhavethesamedecimalvalue;
signbit=1,S-Mandtwo’s-complementhavedifferentdecimalvalue。Howtofindthetwo’s-complementrepresentationofanegativedecimalnumber?25數(shù)字邏輯設(shè)計(jì)及應(yīng)用Decimalequivalent4-bits2’scomplement-81000-71001-61010-51011-41100-31101-21110-11111ItsoriginalbinarynumberDecimalequivalent1000801117011060101501004001130010200011互為補(bǔ)數(shù)Samevalue,buthasoppositesignsymbol26數(shù)字邏輯設(shè)計(jì)及應(yīng)用So,tocalculatethe2'scomplementofannegativeinteger,invertthen-bitbinaryequivalentofthegivennumbermagnitudebitbybit,andthenadd1totheLSB.Exp:calculatethe2’scomplementof(+65)and(-65d)in8-bitform.Solution:+6501000001-65binaryequivalentof65is01000001,invertbitbybit10111110add11011111127數(shù)字邏輯設(shè)計(jì)及應(yīng)用Ann-bitbinarynumberB=bn-1……b1b0,theones’-complementis:B
1s’=2n-1-BItisalsothemethodofrepresentingsignedbinarynumbers.MSB=0,positive,weight+(2n-1-1)MSB=1,negative,weight-(2n-1-1)。Rangeofrepresentablenumbers:negative—-(2n-1-1)~-0positive—+0~(2n-1-1)4.Ones’-complementRepresentation28數(shù)字邏輯設(shè)計(jì)及應(yīng)用1s’-complement’spropertyN-bitpositiveintegersarerepresentedinthesamewayasn-bitsign-magnitudenotation.Theones’-complementofann-bitnegativeintegernumberisobtainedbycomplementingeachoneofthebits(then-bitbinarynumber),i.e.,a1isreplacedbya0,anda0isreplacedbya1.Exp.8-bit1s’-complementofthenumber.+18d=00010010-18d=1'scomplementof18=1110110129數(shù)字邏輯設(shè)計(jì)及應(yīng)用decimalS-M2’scomp.1s’comp.-1100111111110-2101011101101-3101111011100-4110011001011-5110110111010-6111010101001-7111110011000-8-1000-decimalS-M2’scomp.1s’comp.7011101110111601100110011050101010101014010001000100300110011001120010001000101000100010001000001000000011110000返回Fromtheleastnumbertobiggestnumber,2’scomp.and1s’comp.aresuccessiveincreasedby1.SummaryofS-M,2’scomp.,1s’comp.30數(shù)字邏輯設(shè)計(jì)及應(yīng)用Allofthesethreeareusedtorepresentsignedintegernumberinbinarysystem.Comparingoftherepresentingrangeofthevalue
Representationsofpositiveintegeraresame;buttherepresentationsofnegativeintegeraredifferentatall.S-M2’scomp.1s’comp.positive+0~(2n-1-1)+0~(2n-1-1)+0~(2n-1-1)negative-(2n-1-1)~-0(-2n-1)~-1-(2n-1-1)~-031數(shù)字邏輯設(shè)計(jì)及應(yīng)用Calculatesignedinteger’sS-M,2’s-comp.,1s’-comp.①positivesignednumber:
convertthegivennumberintothewantedn-bitbinaryequivalent.②negativesignednumber:firstconvertthenumberinton-bitbinaryequivalent,
S-M—letMSB=1;
1s’-complement—invertthen-bitbinaryequivalentbitbybit,getthen-bit1s’-comp.;
2’s-complement—add1totheLSBofthen-bit1s’-complementofthegivennumberExp13:FindingtheS-M,2’s-comp,1s’-compofthefollowingsignednumberin8-bit。
+60,-60,+10010,-110132數(shù)字邏輯設(shè)計(jì)及應(yīng)用5.SignextensionWhenweconvertann-bit2’scomplementnumberXintoanm-bitone:(a)ifm>n,append(m-n)copiesofX’ssignbittotheleftofX;(b)ifm<n,discardX’s(n-m
)leftmostbit。Sodoto1s’-complement.33數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.6Two’s-complementAdditionandSubtraction1、RulesTwooperandsaddorsubtractdirectly
。
Exp:
3+3,4+(-5),7-3,1-6,符號(hào)數(shù)表格34數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.AgraphicalviewModular:thebiggestnumberofquantitiesthatan-bitsystemcanrepresentis2n.Modularoperation:mMOD2n=m-i·2n(i=int())
Exp:18MOD16=276543210-1-2-3-4-5-6-7-80111011001010100001100100001000011111110110111001011101010011000+235數(shù)字邏輯設(shè)計(jì)及應(yīng)用3.overflowIfanadditionoperationproducesaresultthatexceedstherangeofthenumbersystem,overflowissaidtooccur.thatis,ifresult>+(2n-1-1),or<-(2n-1),overflowisoccurred.Detectingofoverflow:
Anadditionoverflowsiftheaddends’signsarethesamebutthesum’ssignisdifferentfromtheaddends’.Exp:judgewhethertheresultoftheadditionoverflowornot。
11111101+1000000136數(shù)字邏輯設(shè)計(jì)及應(yīng)用4.Subtractionrulesm-n=m+(2n-n)Negatethesubtrahendbytakingits2’scomplement,andthenaddittotheminuendusingthenormalrulesforaddition.
2’s-comp.ofn76543210-1-2-3-4-5-6-7-80111011001010100001100100001000011111110110111001011101010011000-2+1437數(shù)字邏輯設(shè)計(jì)及應(yīng)用Exp:8-bit2’s-comp.38數(shù)字邏輯設(shè)計(jì)及應(yīng)用5.Two’s-complementandUnsignedBinaryNumbersWhenn-bitbinarynumbersaretakenforunsignednumber,therulesofadditionandsubtractionareassameasthe2’s-complement.Iftheresultofadditionoperationexceedtherangeofn-bitsystem,acarryisproducedtotheleftmoresignificantbit.39數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.10BinaryCodesforDecimalNumbersEmphasis:BCD,excess-3code:asetofn-bitinwhichdifferentbitstringsrepresentdifferentnumbersofotherthingsiscalledacode.codeword:aparticularcombinationofnbit-values.1、BCDcodethedigits0~9areencodedby4-bitunsignedbinaryrepresentations,0000through1001.andthewords1010~1111arenotused.(invalidcodeword)40數(shù)字邏輯設(shè)計(jì)及應(yīng)用BCD’spropertyBCDisweightedcode,theweightsforthebitsfromlefttorightis:23、22、21、20。alsocalled8421BCD。(1)representingnumbersbyBCDlike,11d,
BCD—00010001 256d, BCD–001001010110(2)PackedBCDtwo-digits-per-bytedecimaldigits8421BCD00000100012001030011401005010160110701118100091001Donotdiscardthese041數(shù)字邏輯設(shè)計(jì)及應(yīng)用(3)AdditionwithBCDbesimilarto4-bitunsignedbinarynumberaddition.Butacorrectionmustbemadeifthesumexceeds1001if,sum>1001,thenadd0110totheresult。
Exp.:>1001makeacorrection42數(shù)字邏輯設(shè)計(jì)及應(yīng)用2.OtherdecimalcodesP.49t
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度供暖供氣設(shè)施施工安全協(xié)議
- 二零二五年度鋼材現(xiàn)貨交易居間服務(wù)協(xié)議
- 2025年度電子商務(wù)合伙拆伙協(xié)議終止協(xié)議
- 2025年度離職解除勞動(dòng)合同模板:傳媒廣告行業(yè)員工離職流程
- 會(huì)計(jì)財(cái)務(wù)審計(jì)作業(yè)指導(dǎo)書
- 公司股權(quán)購(gòu)買協(xié)議詳細(xì)版
- 金融服務(wù)個(gè)人風(fēng)險(xiǎn)免責(zé)聲明
- 《數(shù)學(xué)思維訓(xùn)練課程:數(shù)形結(jié)合學(xué)習(xí)指導(dǎo)》
- 肉類銷售代理合同
- 關(guān)于項(xiàng)目進(jìn)度管理的解決方案
- 2025年湖南有色金屬職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能測(cè)試題庫(kù)參考答案
- 儲(chǔ)能站施工組織設(shè)計(jì)施工技術(shù)方案(技術(shù)標(biāo))
- 2025部編版小學(xué)道德與法治一年級(jí)下冊(cè)教學(xué)計(jì)劃
- 女職工權(quán)益保護(hù)法律知識(shí)競(jìng)賽題庫(kù)(293題附答案)
- 樓梯 欄桿 欄板(一)22J403-1
- 2024湖北省聯(lián)合發(fā)展投資集團(tuán)限公司招聘221人高頻難、易錯(cuò)點(diǎn)500題模擬試題附帶答案詳解
- 03S702鋼筋混凝土化糞池-標(biāo)準(zhǔn)圖集
- 幼兒園中班居家安全教案
- 國(guó)網(wǎng)直流電源系統(tǒng)技術(shù)監(jiān)督規(guī)定
- 香港雇傭合同協(xié)議書
- 部編版四年級(jí)語(yǔ)文下冊(cè)第二單元《習(xí)作:我的奇思妙想》課件PPT
評(píng)論
0/150
提交評(píng)論