1DigitalLogicDesignandApplication(数字逻辑设计及应用)ReviewofChapter2(第二章内容回顾)GeneralPositional-Number-SystemConversion(常用按位计数制的转换)•AdditionandSubtractionofNon-decimalNumbers(非十进制的加法和减法)2ReviewofChapter2(第二章内容回顾)•RepresentationofNegativeNumbers(负数的表示)Signed-Magnitude[符号-数值(原码)]ComplementNumberSystems(补码数制)Radix–Complement(基数补码)DiminishedRadix–Complement[基数减1补码(基数反码)]DigitalLogicDesignandApplication(数字逻辑设计及应用)3ReviewofChapter2(第二章内容回顾)BinarySigned-Magnitude,Ones’–Complement,andTwo’s–ComplementRepresentation(二进制的原码、反码、补码表示)直接由补码(反码)求二进制数值的大小:最高位位权为-2n-1(-2n-1-1)(1011)2补=()10DigitalLogicDesignandApplication(数字逻辑设计及应用)4ReviewofChapter2(第二章内容回顾)Two’s–ComplementAdditionandSubtraction(二进制补码的加法和减法)Overflow(溢出)如果加法运算产生的和超出了数制表示的范围,则结果发生了溢出(Overflow)。如何判断溢出?MSBCin与Cout不同DigitalLogicDesignandApplication(数字逻辑设计及应用)5ReviewofChapter2(第二章内容回顾)Howtorepresenta1-bitDecimalnumberwitha4-bitBinarycode(如何用4位二进制码表示1位十进制码)?——BinaryCodedDecimal(BCD码)(0.301)10=()8421BCDDigitalLogicDesignandApplication(数字逻辑设计及应用)6ReviewofChapter2(第二章内容回顾)AdditionofBCDDigits(BCD数的加法)思考:两个BCD码与两个4位二进制数相加的区别?DigitalLogicDesignandApplication(数字逻辑设计及应用)7DigitalLogicDesignandApplication(数字逻辑设计及应用)0101100111100110010010001000000001100110591410881610+++++++41+611修正修正01000101100110011001001001101000459991810++++++811修正8ReviewofChapter2(第二章内容回顾)AdditionofBCDDigits(BCD数的加法)思考:何时需要进行修正?如果(X+Y)产生进位信号C或在1010~1111之间如何修正?——结果加6DigitalLogicDesignandApplication(数字逻辑设计及应用)9ReviewofChapter2(第二章内容回顾)Graycode(格雷码)任意相邻码字间只有一位数位变化最高位的0和1只改变一次最大数回到0也只有一位码元不同DigitalLogicDesignandApplication(数字逻辑设计及应用)102.11Graycode(格雷码)DigitalLogicDesignandApplication(数字逻辑设计及应用)构造方法ReflectedCode(反射码)直接构造Thebitsofann-bitbinarycordwordarenumberedfromrighttoleft,from0ton-1.[对n位二进制的码字从右到左编号(0~n-1)]BitiofaGray-codecodewordis0ifbitsiandi+1ofthecorrespondingbinarycodewordarethesame,elsebitiis1.(若二进制码字的第i位和第i+1位相同,则对应的葛莱码码字的第i位为0,否则为1。)11ReviewofChapter2(第二章内容回顾)DigitalLogicDesignandApplication(数字逻辑设计及应用)FrombinarynumbertoGraycodeThewidthissame,theMSBissame;Fromlefttoright,ifabitinbinarynumberissameasitsleftbit,thegraycodeis0,ifitisdifferent,thegraycodeis1.Examples:binarynumber:1001001001100011Graycode:110110110101001012ReviewofChapter2(第二章内容回顾)构造方法异或(XOR)运算:相异为1,相同为0Gn=BnBn=GnGn-1=Bn⊕Bn-1Bn-1=Gn⊕Gn-1……G0=B1⊕B0B0=Gn⊕Gn-1⊕…⊕G0DigitalLogicDesignandApplication(数字逻辑设计及应用)13Chapter3DigitalCircuits(数字电路)GiveaknowledgeoftheElectricalaspectsofDigitalCircuits(介绍数字电路中的电气知识)DigitalLogicDesignandApplication(数字逻辑设计及应用)14ConsidersomeQuestions(思考几个问题)在模拟的世界中如何表征数字系统?如何将物理上的实际值映射为逻辑上的0和1?什么时候考虑器件的逻辑功能;什么时候考虑器件的模拟特性?DigitalLogicDesignandApplication(数字逻辑设计及应用)15DigitalLogicDesignandApplication(数字逻辑设计及应用)3.1LogicSignalsandGates(逻辑信号和门电路)HowtogettheHIGHandLOWVoltage(如何获得高、低电平)?HIGHto0or1(高电平对应0还是1)?VOUTVINVccR获得高、低电平的基本原理Positive(正逻辑)10Negative(负逻辑)101616SwitchesElectronicswitchesarethebasisofbinarydigitalcircuitsAswitchhasthreepartsSourceinput,andoutputCurrenttriestoflowfromsourceinputtooutputControlinputVoltagecontrolswhetherthatcurrentcanflow“off”“on”outputsourceinputoutputsourceinputcontrolinputcontrolinput1717SwitchesTheamazing(令人惊奇的)shrinking(逐渐减小的)switch1930s:Relays1940s:Vacuumtubes1950s:Discretetransistor1960s:Integratedcircuits(ICs)InitiallyjustafewtransistorsonICThentens,hundreds,thousands...relayvacuumtubediscretetransistorICquarter(toseetherelativesize)1818TheCMOSTransistorCMOStransistorBasicswitchinmodernICsSilicon--notquiteaconductororinsulator:Semiconductor2.3gatesourcedrainoxideApositivevoltagehere...(a)ICpackageIC...attractselectronshere,turningthechannelbetweenthesourceanddrainintoaconductor1919TheCMOSTransistorCMOStransistorBasicswitchinmodernICsdoesnotconduct0conducts1gatenMOSdoesnotconduct1gatepMOSconducts02.32020Moore’sLawICcapacity(容量,集成度)doublingaboutevery18monthsforseveraldecadesKnownas“Moore’sLaw”afterGordonMoore,co-founderofIntelPredicted(预言)in1965predictedthatcomponentsperICwoulddoubleroughly(粗略地,大致上)everyyearorso21Moore’sLawForaparticular(特定的)numberoftransistors,theICareashrinksbyhalfevery18monthsConsiderhowmuchshrinkingoccursinjust10years(trydrawingit)Enablesincredibly(不能相信的,难以置信的)powerfulcomputationinincrediblytinydevices22Moore’sLawToday’sICsholdbillionsoftransistorsThefirstPentiumprocessor(early1990s)neededonly3millionAnIntelPentiumprocessorIChavingmillionsoftransistors233.1LogicSignalsandGates(逻辑信号和门电路)DigitalLogicDesignandApplication(数字逻辑设计及应用)从物理的角度考虑电路如何工作,工作中的电气特性实际物理器件不可避免的时间延迟问题从逻辑角度输入、输出的逻辑关系三种基本逻辑:与、或、非2424BooleanLogicGatesBuildingBlocksforDigitalCircuits(BecauseSwitchesareHardtoWorkWith)“Logicgates”arebetterdigitalcircuitbuildingblocksthanswitches(transistors)Why?...2.4Abstraction(提取)reducescomplexity!2525BooleanAlgebraanditsRelationtoDigitalCircuitsTounderstandthebenefitsof“logicgates”vs.switches,weshouldfirstunderstandBooleanalgebra“Traditional”algebraVariablesrepresentrealnumbers(x,y)Operators(运算器)operateonvariables,returnrealnumbers(2.5*x+y-3)a2626BooleanAlgebraanditsRelationtoDigitalCircuitsBooleanAlge