数字逻辑设计及应用ppt课件.ppt
《数字逻辑设计及应用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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数字 逻辑设计 应用 ppt 课件

链接地址:https://www.31ppt.com/p-1917631.html