《数字逻辑2-1》由会员分享,可在线阅读,更多相关《数字逻辑2-1(18页珍藏版)》请在金锄头文库上搜索。
1、Chapter 2 Number systems and codes Analog and DigitalSignals in electric circuitDigit in decimal systemDigit in binary systemPositional number systemsUse few digit to express infinite values Each digit position has a different weightDefinition:Number digit base/radixNumber: a string of digits;Each d
2、igit position has a different weight;Radix is written as 10 in any system.Positional number systemsDecimal system: base is 10, the digit may be 0 to 9Binary system: base is 2, the digit may be 0 or 1bit: one digit in binary system; Decimal and BinaryBased on definitions:Binary to DecimalBinary to De
3、cimalDecimal to binary For integer numbers : divided by 2, get its remainders;Examples for 8-bit binary numbers:17989 4422115211 1 0 0 1 1 0 1For decimal fraction numbers : multiplied by radix, and get its integers; Examples for 8-bit binary numbers:0.170.34 0.681.360.721.440.881.761.52Decimal to bi
4、nary Different number systemsP.28 Table 2-1Analog signalAnalog signal: its measured value changed continually between voltage source and ground.Analog signalD is a number between 1 and 0;How to change D to binary ?Analog to digitalUse one binary number: 1 or 0 ?Divide voltage area into 2 state: Anal
5、og to digitalMean value: 1 : 3/4 0: 1/4Quantized step : 1/2Mean error: 1/4Maximum error: 1/2 Analog to digitalUse three decimal number: 000 to 111Divide voltage area into 8 state: Analog to digitalUse n-bit code: 000 to 111 ?With 2n different states ;Resolving ability (quantized step): 2-nMean error : 2-n-1 Maximum error: 2-nTransmit on data bus with n-bit widthDigital to analog Only use two kinds of resistors; the current passed through any resistor will not change !Better way for ADC Mean error : 0Maximum error: 2-n-1