2015下数字逻辑设计第二章_第1页
2015下数字逻辑设计第二章_第2页
2015下数字逻辑设计第二章_第3页
2015下数字逻辑设计第二章_第4页
2015下数字逻辑设计第二章_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Digital DesignDigital Design Principles and Principles and PracticesPracticesDigital DesignDigital Design Principles and Principles and PracticesPracticesBinary Codes for DecimalMost people are accustomed to using Decimal. BCD (Binary-Coded Decimal, 8421 Code)It has 10 valid code words and 6 invalid

2、 code words. Natural code (just like 4-bit binary numbers)Each digit is weighted.DecimalBCD(8421)00000100012001030011401005010160110701118100091001Unused Code Words101010111100110111101111Addition of BCD DigitsBinary Codes for Decimal01100100+11000100000008816+101100110+1010001011001459+100110010010

3、9918+101101000+1100111105914+0101修正修正+6修正修正+6修正修正+69, 无效码字无效码字9, 无效码字无效码字进位进位-10+4进位进位-10+69, 有效码字有效码字9, 无效码字无效码字进位进位-10+8Subtraction of BCD DigitsBinary Codes for Decimal修正修正-6-6MSB有借位,结果无效有借位,结果无效正确正确10011000192- - -0001 01100010- - MSB无借位,结果有效无借位,结果有效01010011853- - -1000 Binary Codes for Decimal

4、2421 CodeDecimal242100000100012001030011401005101161100711018111091111Unused Code Words010101100111100010011010Each digit is weighted.Self-complementingMSB indicates higher/lower part.It has 10 valid code words and 6 invalid code words. Easy to obtain 9s complement.Binary Codes for Decimal Excess-3

5、CodeDecimalExcess-300011101002010130110401115100061001710108101191100Unused Code Words000000010010110111101111Digits isnt weighted.Self-complementing8421 code + 0011It has 10 valid code words and 6 invalid code words. Easy to obtain 9s complement.A wider rang of underflow/overflowMSB indicates highe

6、r/lower part.Use BCD code for a decimal number: A = 1946 8421 code : A = 0001 1001 0100 0110 2421 code : A = 0001 1111 0100 1100 Excess-3 code: A = 0100 1100 0111 1001 Examples: Binary Codes for DecimalBinary Codes for Decimal Biquinary Code (二五混合二五混合码码)DecimalBiquinary001000011010001020100100301010

7、00401100005100000161000010710001008100100091010000Unused Code Words00000000000001000001000000110000101.7-bits Two hot codeFirst 2 bits are one hot code for higher/lower partLast 5 bits are one hot code in the range. Error- detecting property !Binary Codes for Decimal 1-out-of-10 CodeDecimal1-out-of-

8、10010000000001 2 3 4 5 6 7 8 9 Unused Code Words.10-bits One hot codeIt is very useful in control systems.Gray CodeMechanical Encoding1101011000110001110010100 ? ?Four possible values: 000, 001, 010, 0111101011000110001110010100 0 1Gray CodeGray Mechanical Encoding1011111100100001000010110 ? 1Two po

9、ssible values: 001, 011. Both are valid.Property : In each pair of successive code words, only one bit changes.Target: Code for continues changed numbers (in binary system) to prevent wrong code happened in transition time.最高位的最高位的0和和1只改变一次只改变一次!最大数回到最大数回到0也只有一位码元不同也只有一位码元不同!Gray CodeTable 2-10 A co

10、mparison of 3-bit binary code and Gray codeReflected Gray CodeGray Code ConstructingMethod 1:Recursive Constructing01001011The first 2n code words The last 2n code words 0000011110001111The first 2n code words The last 2n code words n+1 bits Gray code, n=0n+1 bits Gray code, n=1n+1 bits Gray code, n

11、=2Gray CodeGray Code ConstructingMethod 2:Direct ConstructingFrom binary number to Gray code The width is same, the MSB is same; From left to right, if a bit in binary number is same as its left bit, the gray bit is 0. If it is different, the gray bit is 1. Examples: Binary number: 1001 0010 Gray co

12、des: 1101 1011Gray CodeTranslation between Gray Code and Binary CodeBinary code: bn-1 bn-2 bn-1 b1 b0Gray code: gn-1 gn-2 gn-1 g1 g0gn-1 = bn-1 0 = bn-1gi = bi+1 bi A = BCA = BCC = A BB = A Cbn-1 = gn-1 0 = gn-1 bi = bi = bi+1gi bi+1gi Character CodesASCII Code128 Keyboard signs , 7-bitCharacter CodesHow are you! 1001000 1101111 1110111 0100000 1100001 1110010 1100101 0100000 1111001 1101111 1110101 0100001 12 characters Transmitting WayParallel way Us

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论