




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
Chapter2NumberSystemsandcodes(數(shù)系與編碼)NumericData-NumberSystemsandtheirConversions
(數(shù)值信息——數(shù)制及其轉(zhuǎn)換)
NonnumericData-Codes
(非數(shù)值信息——編碼)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)1Chapter2NumberSystemsandReviewofChapter2(第二章內(nèi)容回顧)Binary,Octal,andHexadecimalNumbers(二進(jìn)制、八進(jìn)制、十六進(jìn)制)PositionalNumberSystem(按位計數(shù)制)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)2ReviewofChapter2(第二章內(nèi)容回顧)BReviewofChapter2(第二章內(nèi)容回顧)GeneralPositional-Number-SystemConversion(常用按位計數(shù)制的轉(zhuǎn)換)ANumberinanyRadixtoRadix10:Expandingtheformulausingradix-10arithmetic(任意進(jìn)制數(shù)
十進(jìn)制數(shù):利用位權(quán)展開)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)3ReviewofChapter2(第二章內(nèi)容回顧)GReviewofChapter2(第二章內(nèi)容回顧)GeneralPositional-Number-SystemConversion(常用按位計數(shù)制的轉(zhuǎn)換)ANumberinRadix10toanyRadix:RadixMultiplicationorDivision(十進(jìn)制
其它進(jìn)制:基數(shù)乘除法)Note:DecimalFractionPartsConversion[注意:小數(shù)部分的轉(zhuǎn)換(誤差)]DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)4ReviewofChapter2(第二章內(nèi)容回顧)GReviewofChapter2(第二章內(nèi)容回顧)AdditionandSubtractionofNondecimalNumbers(非十進(jìn)制的加法和減法)(Table2-3)
進(jìn)位輸入Cin、進(jìn)位輸出Cout、本位和S
借位輸入Bin、借位輸出Bout、本位差DDigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)5ReviewofChapter2(第二章內(nèi)容回顧)AReviewofChapter2(第二章內(nèi)容回顧)RepresentationofNegativeNumbers
(負(fù)數(shù)的表示)Signed-Magnitude[符號-數(shù)值(原碼)]ComplementNumberSystems(補(bǔ)碼數(shù)制)Radix–Complement(基數(shù)補(bǔ)碼)DiminishedRadix–Complement[基數(shù)減1補(bǔ)碼(基數(shù)反碼)]DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)6ReviewofChapter2(第二章內(nèi)容回顧)RReviewofChapter2(第二章內(nèi)容回顧)BinarySigned-Magnitude,Ones’–Complement,andTwo’s–ComplementRepresentation
(二進(jìn)制的原碼、反碼、補(bǔ)碼)正數(shù)的原碼、反碼、補(bǔ)碼表示相同負(fù)數(shù)的原碼表示:符號位為1負(fù)數(shù)的反碼表示:符號位不變,其余在原碼基礎(chǔ)上按位取反在|D|的原碼基礎(chǔ)上按位取反(包括符號位)負(fù)數(shù)的補(bǔ)碼表示:反碼+1DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)7ReviewofChapter2(第二章內(nèi)容回顧)B2.5.4Two’s–ComplementRepresentation
(二進(jìn)制補(bǔ)碼表示法)Ann-bitTwo’s-Complementrangeis(n位二進(jìn)制補(bǔ)碼表示范圍):
–2n-1~+(2n-1–1)
OnlyonerepresentationsofZero(零只有一種表示)ObtainaTwo’s-Complement(二進(jìn)制補(bǔ)碼的求取):
Ones’–Complement(反碼)+1(為什么??)ExpandingtheSignBit(符號位擴(kuò)展)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)82.5.4Two’s–ComplementRepr2.5RepresentationofNegativeNumbers(負(fù)數(shù)的表示)Example2.5.2:Writethe8-bitsigned-magnitude,two’s-complementforeachofthesebinarynumbers.(分別寫出下面二進(jìn)制數(shù)的8位符號–數(shù)值碼、補(bǔ)碼)(–1101)2(–0.1101)2DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)92.5RepresentationofNegati2.5RepresentationofNegativeNumbers(負(fù)數(shù)的表示)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)
1、(–1101)22、(–0.1101)21、5位二進(jìn)制表示:原碼反碼補(bǔ)碼1110110010100112、8位二進(jìn)制表示:原碼反碼補(bǔ)碼100011011111001011110011[[D]反]反=D[[D]補(bǔ)]補(bǔ)=D102.5RepresentationofNegati2.6Two’s–ComplementAdditionandSubtraction(二進(jìn)制補(bǔ)碼的加法和減法)AdditionRules:Addedbyordinarybinaryaddition(加法:按普通二進(jìn)制加法相加)P.39SubtractionRules:Takingitstwo’scomplement,thenadd(減法:將減數(shù)求補(bǔ),再相加)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)112.6Two’s–ComplementAdditi2.6Two’s–ComplementAdditionandSubtraction(二進(jìn)制補(bǔ)碼的加法和減法)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)
+20010-31101
+
+5
+
0101
+
-5
+
1011
+70111-811000
+70111+10001
+
-4
+
1100
+
-6
+
1010
+310011-51011122.6Two’s–ComplementAdditi13Adder/SubtractorExample:CalculatorPreviouscalculatorusedseparateadderandsubtractorDIPswitches108-bitregisterCALCLEDsefclkld88800888882x10110wiciAABBSScowo8-bitadder8-bitsubtractor1313Adder/SubtractorExample:Ca14Adder/SubtractorExample:CalculatorImprovebyusingadder/subtractor,andtwo’scomplementnumbersDIPswitches108-bitregister8-bitadder/subtractorsubCALCLEDseSABfclkld1088881414Adder/SubtractorExample:Ca2.6Two’s–ComplementAdditionandSubtraction(二進(jìn)制補(bǔ)碼的加法和減法)Overflow(溢出)如果加法運(yùn)算產(chǎn)生的和超出了數(shù)制表示的范圍,則結(jié)果發(fā)生了溢出(Overflow)。
對于二進(jìn)制補(bǔ)碼,加數(shù)的符號相同,和的符號與加數(shù)的符號不同。(或者,Cin
與Cout不同)P.41對于無符號二進(jìn)制數(shù),若最高有效位上發(fā)生進(jìn)位或借位,就指示結(jié)果超出范圍。
-51011+70111
+
-6
+
1010
+
+3
+
0011
-1110101=
+5+101010=
-6
DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)152.6Two’s–ComplementAdditi16OverflowSometimesresultcan’tberepresentedwithgivennumberofbitsEithertoolargemagnitudeofpositiveornegativeEx.4-bittwo’scomplementadditionof0111+0001(7+1=8).But4-bittwo’scomplementcan’trepresentnumber>70111+0001=1000WRONGanswer,1000intwo’scomplementis-8,not+8Adder/subtractorshouldindicatewhenoverflowhasoccurred,soresultcanbediscarded1616OverflowSometimesresultcan17DetectingOverflow:Method1Fortwo’scomplementnumbers,overflowoccurswhenthetwonumbers’signbitsarethesamebutdifferfromtheresult’ssignbitIfthetwonumbers’signbitsareinitiallydifferent,overflowisimpossibleAddingpositiveandnegativecan’texceedlargestmagnitudepositiveornegative01111000+0001signbitsoverflow(a)11110111+0100overflow(b)10001111+1011nooverflow(c)Ifthenumbers’signbitshavethesamevalue,whichdiffersfromtheresult’ssignbit,overflowhasoccurred.1717DetectingOverflow:Method118DetectingOverflow:Method2Evensimplermethod:Detectdifferencebetweencarry-intosignbitandcarry-outfromsignbit01111111001000+0001overflow(a)11100010111+0100overflow(b)10000001111+1011nooverflow(c)Ifthecarryintothesignbitcolumndiffersfromthecarryoutofthatcolumn,overflowhasoccurred.1818DetectingOverflow:Method22.10BinaryCodesforDecimalNumbers
(十進(jìn)制數(shù)的二進(jìn)制編碼)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)Asetofn-bitstringsinwhichdifferentbitstringsRepresentdifferentnumbersorotherthings.
(用于表示不同數(shù)或其它事件的一組n位二進(jìn)制碼的集合)192.10BinaryCodesforDecima2.10BinaryCodesforDecimalNumbers
(十進(jìn)制數(shù)的二進(jìn)制編碼)Howtorepresenta1-bitDecimalnumberwitha4-bitBinarycode(如何用4位二進(jìn)制碼表示1位十進(jìn)制碼)?——BinaryCodedDecimal(BCD碼)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)202.10BinaryCodesforDecimal2.10BinaryCodesforDecimalNumbers
(十進(jìn)制數(shù)的二進(jìn)制編碼)HowtorepresentaNegativeBCDnumber(負(fù)的BCD數(shù)如何表示)?Signed-MagnitudeRepresentation:Encodingofthesignbitisarbitrary(符號-數(shù)值表示:符號位的編碼任意)10’s-complement:0000indicatesplus,1001indicatesminus.(十進(jìn)制補(bǔ)碼表示:0000正,1001負(fù))AdditionofBCDDigits(BCD數(shù)的加法)P.50DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)212.10BinaryCodesforDecimalDigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)22DigitalLogicDesignandAppli2.10BinaryCodesforDecimalNumbers
(十進(jìn)制數(shù)的二進(jìn)制編碼)(Table2-9)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)BCDCode2421CodeExcess-3(余3碼)BiquinaryCode(二五混合碼)1-out-of-10(10中取1碼)
WeightedCode(加權(quán)碼)Self-ComplementCode自反碼232.10BinaryCodesforDecimaDigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)24DigitalLogicDesignandAppli8421codeNaturalcode,justlike4-bitbinarynumbers;Eachdigitisweighted;Ithas10validcodewordsand6invalidcodewords.BCDcodes258421codeBCDcodes25Eachdigitisweighted;Self-complementing;UseMSBtoexpresshigher/lowerpart;Ithas10validcodesand6invalidcodes.2421codesBCDcodes26Eachdigitisweighted;2421coBCDcodesExcess-3codeItsdigitisnotweighted;8421code+“0011”;Self-complementing.27BCDcodesExcess-3codeItsdigiExamples:useBCDcodefordecimalnumbersA=19468421code:A=00011001010001102421code:A=0001111101001100Excess-3code:A=0100110001111001BCDcodes28Examples:BCDcodes281-out-of-10codeOnehotcode:Itisveryusefulincontrolsystems.Onehotcodes291-out-of-10codeOnehotcode:OTwohotcodesBiquinarycode
7-bits;twohotcode;First2bitsisonehotcodeforhigher/lowerrange;Last5bitsisonehotcodeintherange.Error-detectingproperty!
30TwohotcodesBiquinarycode30Fromonecodetoitsneighbor,onlyonebitchanged,notransitionstate.Temperaturecode31Fromonecodetoitsneighbor,2.11Graycode(格雷碼)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)322.11Graycode(格雷碼)DigitalLo2.11Graycode(格雷碼)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)特點(diǎn):任意相鄰碼字間只有一位數(shù)位變化最高位的0和1只改變一次最大數(shù)回到0也只有一位碼元不同332.11Graycode(格雷碼)DigitalLo2.11Graycode(格雷碼)DigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)構(gòu)造方法直接構(gòu)造
Thebitsofann-bitbinarycordwordarenumberedfromrighttoleft,from0ton-1.[對n
位二進(jìn)制的碼字從右到左編號(0~n-1)]BitiofaGray-codecodewordis0ifbitsiandi+1ofthecorrespondingbinarycodewordarethesame,elsebitiis1.(若二進(jìn)制碼字的第i位和第i+1位相同,則對應(yīng)的格雷碼碼字的第i
位為0,否則為1。)ReflectedCode(反射碼)342.11Graycode(格雷碼)DigitalLoGraycodesTarget:codeforcontinueschangednumbers(inbinarysystem)topreventwrongcodehappenedintransitiontime;Property:Ineachpairofsuccessivecodewords,onlyonebitchanges.35GraycodesTarget:codeforconGraycodesFrombinarynumbertoGraycodeThewidthissame,theMSBissame;Fromlefttoright,ifabitinbinarynumberissameasitsleftbit,thegraycodeis0,ifitisdifferent,thegraycodeis1.Examples:binarynumber:1001001001100011Graycodes:110110110101001036GraycodesFrombinarynumbertError-detectingcodeInformationword+checkingbit37Error-detectingcodeInformatioDigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)2.12CharacterCodes(字符編碼)
ASCII碼(P36表2-11)
ASCIIcode:128Keyboardsigns,7-bitUsedforkeyboardordisplaydevice38DigitalLogicDesignandAppliDigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)2.13CodesforActions,Conditions,andStates(動作、條件和狀態(tài)的編碼)
使用b位二進(jìn)制編碼來表示n個不同狀態(tài)Word:adigitalstringtorepresentanobject
Usenbits,wecanmake2ndifferentwords;Tomakenwords,youmustusebits.39DigitalLogicDesignandAppliDigitalLogicDesignandApplication(數(shù)字邏輯設(shè)計及應(yīng)用)2.16CodesforSerialDataTransmissionandStorage(用于串行數(shù)據(jù)傳輸與存儲的編碼)Parallelway
usen-linetotransmitann-bitscodewords;
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 設(shè)備連接使用情況統(tǒng)計表
- 出差人員辦公地點(diǎn)跟蹤表
- 體育賽事參與及表現(xiàn)綜合證明書(6篇)
- 教師素質(zhì)提升與教育服務(wù)質(zhì)量的相互關(guān)系
- 產(chǎn)品售后服務(wù)管理跟蹤表
- 人文素養(yǎng)培養(yǎng):古詩詞賞析高中教案
- 孟子中的論說方法與作文技巧:高三語文選讀教學(xué)
- 我心中的英雄寫人文章(13篇)
- 學(xué)習(xí)生活中的一件小事讀后感11篇
- 公司車輛使用與保養(yǎng)記錄表
- 新能源汽車與傳統(tǒng)汽車的對比
- 《堅持才會有收獲》-小學(xué)道德與法治堅持才會有收獲課件2
- 中國非特異性腰背痛臨床診療指南
- 基于STM32的智能避障循跡小車系統(tǒng)設(shè)計答辯模板
- 建筑材料采購?fù)稑?biāo)方案(技術(shù)標(biāo))
- 挪用資金案諒解書
- 駕校消防安全知識培訓(xùn)
- 2023行業(yè)薪酬白皮書
- 國家開放大學(xué)《合同法》形考任務(wù)1-4答案
- 消防應(yīng)急物資檢查記錄表
- ct增強(qiáng)掃描中造影劑外滲課件
評論
0/150
提交評論