数字逻辑设计及应用ppt课件.ppt

上传人:牧羊曲112 文档编号:1917631 上传时间:2022-12-25 格式:PPT 页数:45 大小:608.50KB
返回 下载 相关 举报
数字逻辑设计及应用ppt课件.ppt_第1页
第1页 / 共45页
数字逻辑设计及应用ppt课件.ppt_第2页
第2页 / 共45页
数字逻辑设计及应用ppt课件.ppt_第3页
第3页 / 共45页
数字逻辑设计及应用ppt课件.ppt_第4页
第4页 / 共45页
数字逻辑设计及应用ppt课件.ppt_第5页
第5页 / 共45页
点击查看更多>>
资源描述

《数字逻辑设计及应用ppt课件.ppt》由会员分享,可在线阅读,更多相关《数字逻辑设计及应用ppt课件.ppt(45页珍藏版)》请在三一办公上搜索。

1、1,Chapter 2 Number Systems and codes (数系与编码),Numeric Data Number Systems and their Conversions (数值信息 数制及其转换) Nonnumeric Data Codes (非数值信息 编码),Digital Logic Design and Application (数字逻辑设计及应用),2,Review of Chapter 2 (第二章内容回顾),Binary, Octal, and Hexadecimal Numbers (二进制、八进制、十六进制),Positional Number Syste

2、m (按位计数制),Digital Logic Design and Application (数字逻辑设计及应用),3,Review of Chapter 2 (第二章内容回顾),General Positional-Number-System Conversion (常用按位计数制的转换)A Number in any Radix to Radix 10 : Expanding the formula using radix-10 arithmetic (任意进制数 十进制数:利用位权展开),Digital Logic Design and Application (数字逻辑设计及应用),

3、4,Review of Chapter 2 (第二章内容回顾),General Positional-Number-System Conversion (常用按位计数制的转换)A Number in Radix 10 to any Radix : Radix Multiplication or Division (十进制 其它进制:基数乘除法)Note: Decimal Fraction Parts Conversion 注意:小数部分的转换(误差),Digital Logic Design and Application (数字逻辑设计及应用),5,Review of Chapter 2 (

4、第二章内容回顾),Addition and Subtraction of Nondecimal Numbers (非十进制的加法和减法) (Table 2-3) 进位输入 Cin 、进位输出 Cout 、 本位和 S 借位输入 Bin 、借位输出 Bout 、 本位差 D,Digital Logic Design and Application (数字逻辑设计及应用),6,Review of Chapter 2 (第二章内容回顾),Representation of Negative Numbers (负数的表示) Signed-Magnitude 符号数值(原码) Complement Nu

5、mber Systems (补码数制),Digital Logic Design and Application (数字逻辑设计及应用),7,Review of Chapter 2 (第二章内容回顾),Binary Signed-Magnitude, Ones Complement, and Twos Complement Representation (二进制的原码、反码、补码)正数的原码、反码、补码表示相同负数的原码表示:符号位为 1负数的反码表示: 符号位不变,其余在原码基础上按位取反 在 |D| 的原码基础上按位取反(包括符号位)负数的补码表示:反码 + 1,Digital Logic

6、 Design and Application (数字逻辑设计及应用),8,2.5.4 Twos Complement Representation (二进制补码表示法),An n-bit Twos- Complement range is (n位二进制补码表示范围): 2 n-1 + ( 2 n-1 1) Only one representations of Zero ( 零只有一种表示 ) Obtain a Twos- Complement ( 二进制补码的求取 ): Ones Complement (反码) + 1 (为什么?) Expanding the Sign Bit ( 符号位

7、扩展 ),Digital Logic Design and Application (数字逻辑设计及应用),9,2.5 Representation of Negative Numbers (负数的表示),Example 2.5.2:Write the 8-bit signed-magnitude, twos-complement for each of these binary numbers. (分别写出下面二进制数的8位符号数值码、补码) ( 1101 )2 ( 0 . 1101 )2,Digital Logic Design and Application (数字逻辑设计及应用),10

8、,2.5 Representation of Negative Numbers (负数的表示),Digital Logic Design and Application (数字逻辑设计及应用),1、( 1101 )2 2、( 0 . 1101 )2,1、5位二进制表示: 原码 反码 补码1 1101 1 0010 1 0011,2、8位二进制表示: 原码 反码 补码1000 1101 1111 0010 1111 0011, D 反 反 = D D 补 补 = D,11,2.6 Twos Complement Addition and Subtraction (二进制补码的加法和减法),Add

9、ition Rules: Added by ordinary binary addition (加法:按普通二进制加法相加)P.39Subtraction Rules: Taking its twos complement, then add (减法:将减数求补,再相加),Digital Logic Design and Application (数字逻辑设计及应用),12,2.6 Twos Complement Addition and Subtraction (二进制补码的加法和减法),Digital Logic Design and Application (数字逻辑设计及应用),2 0

10、010 3 1101 5 0101 5 1011 7 0111 8 11000 7 0111 1 0001 4 1100 6 1010 3 10011 5 1011,13,13,Adder/Subtractor Example: Calculator,Previous calculator used separate adder and subtractor,14,14,Adder/Subtractor Example: Calculator,Improve by using adder/subtractor, and twos complement numbers,15,2.6 Twos C

11、omplement Addition and Subtraction (二进制补码的加法和减法),Overflow(溢出)如果加法运算产生的和超出了数制表示的范围,则结果发生了溢出(Overflow)。 对于二进制补码,加数的符号相同,和的符号与加数的符号不同。(或者,C in 与 C out 不同) P.41对于无符号二进制数,若最高有效位上发生进位或借位,就指示结果超出范围。 5 1011 7 0111 6 1010 3 0011 11 10101 5 10 1010 6,Digital Logic Design and Application (数字逻辑设计及应用),16,16,Over

12、flow,Sometimes result cant be represented with given number of bitsEither too large magnitude of positive or negativeEx. 4-bit twos complement addition of 0111+0001 (7+1=8). But 4-bit twos complement cant represent number 70111+0001 = 1000 WRONG answer, 1000 in twos complement is -8, not +8Adder/sub

13、tractor should indicate when overflow has occurred, so result can be discarded,17,17,Detecting Overflow: Method 1,For twos complement numbers, overflow occurs when the two numbers sign bits are the same but differ from the results sign bitIf the two numbers sign bits are initially different, overflo

14、w is impossibleAdding positive and negative cant exceed largest magnitude positive or negative,18,18,Detecting Overflow: Method 2,Even simpler method: Detect difference between carry-in to sign bit and carry-out from sign bit,19,2.10 Binary Codes for Decimal Numbers (十进制数的二进制编码),Digital Logic Design

15、 and Application (数字逻辑设计及应用),20,2.10 Binary Codes for Decimal Numbers (十进制数的二进制编码),How to represent a 1-bit Decimal number with a 4-bit Binary code (如何用 4位二进制码 表示 1位十进制码)? Binary Coded Decimal (BCD码),Digital Logic Design and Application (数字逻辑设计及应用),21,2.10 Binary Codes for Decimal Numbers (十进制数的二进制编

16、码),How to represent a Negative BCD number (负的BCD数如何表示)?Signed-Magnitude Representation: Encoding of the sign bit is arbitrary (符号数值表示:符号位的编码任意)10s-complement: 0000 indicates plus, 1001 indicates minus. (十进制补码表示:0000正,1001负)Addition of BCD Digits (BCD数的加法) P.50,Digital Logic Design and Application (数

17、字逻辑设计及应用),22,Digital Logic Design and Application (数字逻辑设计及应用),23,2.10 Binary Codes for Decimal Numbers (十进制数的二进制编码) (Table 2-9),Digital Logic Design and Application (数字逻辑设计及应用),BCD Code2421 CodeExcess-3 (余3码)Biquinary Code (二五混合码)1-out-of-10 (10中取1码),24,Digital Logic Design and Application (数字逻辑设计及应

18、用),25,8421 codeNatural code , just like 4-bit binary numbers;Each digit is weighted;It has 10 valid code words and 6 invalid code words.,BCD codes,26,Each digit is weighted;Self-complementing;Use MSB to express higher/lower part;It has 10 valid codes and 6 invalid codes.,2421 codes,BCD codes,27,BCD

19、codes,Excess-3 code,Its digit is not weighted; 8421 code + “0011”; Self-complementing .,28,Examples: use BCD code for decimal numbers A = 19468421 code : A = 0001 1001 0100 01102421 code : A = 0001 1111 0100 1100Excess-3 code: A = 0100 1100 0111 1001,BCD codes,29,1-out-of-10 code,One hot code:It is

20、very useful in control systems.,One hot codes,30,Two hot codes,Biquinary code 7-bits; two hot code; First 2 bits is one hot code for higher/lower range; Last 5 bits is one hot code in the range. Error-detecting property !,31,From one code to its neighbor, only one bit changed, no transition state.,T

21、emperature code,32,2.11 Gray code(格雷码),Digital Logic Design and Application (数字逻辑设计及应用),33,2.11 Gray code(格雷码),Digital Logic Design and Application (数字逻辑设计及应用),特点:任意相邻码字间只有一位数位变化最高位的0和1只改变一次最大数回到0也只有一位码元不同,34,2.11 Gray code(格雷码),Digital Logic Design and Application (数字逻辑设计及应用),构造方法直接构造 The bits of a

22、n n-bit binary cord word are numbered from right to left, from 0 to n-1. 对 n 位二进制的码字从右到左编号(0 n-1) Bit i of a Gray-code code word is 0 if bits i and i+1 of the corresponding binary code word are the same, else bit i is 1. (若二进制码字的第 i 位和第 i + 1 位相同,则对应的格雷码码字的第 i 位为0,否则为1。)Reflected Code(反射码),35,Gray c

23、odes,Target: code for continues changed numbers (in binary system) to prevent wrong code happened in transition time;Property : In each pair of successive code words, only one bit changes.,36,Gray codes,From binary number to Gray code The width is same, the MSB is same; From left to right, if a bit

24、in binary number is same as its left bit, the gray code is 0, if it is different, the gray code is 1. Examples: binary number: 1001 0010 0110 0011 Gray codes: 1101 1011 0101 0010,37,Error-detecting code,Information word + checking bit,38,Digital Logic Design and Application (数字逻辑设计及应用),2.12 Characte

25、r Codes (字符编码) ASCII码(P36 表2-11),ASCII code:128 Keyboard signs , 7-bit Used for keyboard or display device,39,Digital Logic Design and Application (数字逻辑设计及应用),2.13 Codes for Actions, Conditions, and States (动作、条件和状态的编码) 使用 b 位二进制编码来表示 n 个不同状态,Word: a digital string to represent an object Use n bits,

26、 we can make 2n different words;To make n words, you must use bits.,40,Digital Logic Design and Application (数字逻辑设计及应用),2.16 Codes for Serial Data Transmission and Storage (用于串行数据传输与存储的编码),Parallel way use n-line to transmit an n-bits code words ; transmit an n-bits code words in one time period;Ser

27、ial way use one line to transmit an n-bits code words ; transmit an n-bits code words in n time period;,41,Digital Logic Design and Application (数字逻辑设计及应用),第2章 掌握重点,正数的十进制、二进制、八进制、十六进制表示,以及它们之间的相互转换符号数的 S-M码、补码、反码表示,以及它们之间的相互转换;带符号数的补码的加减运算:溢出的判断BCD码、GRAY码:表示方法、特点,42,第2章作业(P7578),Digital Logic Desig

28、n and Application (数字逻辑设计及应用),2.12 (b) (c)2.34 2.352.382.39 2.22(选做)2.30 (选做) 2.51 (选做),43,Chapter 3 Digital Circuits (数字电路),Give a knowledge of the Electrical aspects of Digital Circuits (介绍数字电路中的电气知识),Digital Logic Design and Application (数字逻辑设计及应用),44,Consider some Questions(思考几个问题),在模拟的世界中如何表征数字系统?如何将物理上的实际值 映射为逻辑上的 0 和 1 ?什么时候考虑器件的逻辑功能; 什么时候考虑器件的模拟特性?,Digital Logic Design and Application (数字逻辑设计及应用),45,A Class Problem ( 每课一题 ),Indicate whether or not overflow occurs when adding the following 8-bit twos-complement numbers:,Digital Logic Design and Application (数字逻辑设计及应用),

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号