数电第2章1

  • 格式:pdf
  • 大小:588.67 KB
  • 文档页数:28
按位计数制的特点
1) 采用基数(Base or Radix), R进制的基数是R 2) 基数确定数符的个数 如十进制的数符为:0、1、2、3、4、 5、6、7、8、9,个数为10 二进制的数符为:0、1,个数为2 3)逢基数进一
6
2.2 Octal and Hexadecimal numbers (八进制和十六进制数)
i d 16 i p 1
D16
i n
说 明

选择什么数制来表示信息, 对数字系统的成本和性能影响很大, 在数字电路中多使用二进制.

Most Significant Bit(MSB, 最高有效位) Least Significant Bit(LSB, 最低有效位)
1011100010112
2
2 2 2 2 2 2 2 173 86 43 21 10 5 2 1 0
………………余1
………………余0 ………………余1 ………………余1 ………………余0 ………………余1 ………………余0 ………7310=101011012
18
数制转换:十进制小数二进制

i n
d
p 1
i
r
i
推广: D2 = ∑ d i × 2i
Weight of i bit:第i位的权; r:Base or Radix of r Number System
5
Example : (101.001 ) 2 =(5.125 )10
2.1 Positional Number System (按位计数制)
)10
16
2.3 General Positional-Number-System Conversion (常用按位计数制的转换)
A
Number in Radix 10 to any Radix
Multiplication or Division
除 r 取余,逆序排列
(十进制 其它进制)
Method:Radix (基数乘除法)
例:1011100010112=56138=B8B16
10111000.10112=270.548=B8.B16
10
1000110010012 = ( = (
)8 )16
2.2 Octal and Hexadecimal numbers (八进制和十六进制数)
Binary Number Octal Octal Number Binary Number Number 方法:从小数点开始,向左向右每三个数码为一组转换为 一个八进制数码(不足位补零) 10011001110.12 = ? 8 0002 = 08 0012 = 18 1002 = 48 1012 = 58 347.18 = ? 2 0102 = 28 0112 = 38 1102 = 68 1112 = 78
24
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 1 1 0 1 0 0 1
0 0 0 1 0 1 1 1
表2.3.2 二进制减法真值表
•Borrow in ( 借位输 入 ): Bin
•Borrow out ( 借位 输出 ): Bout •Difference bit ( 本 位差 ): D


Integer Parts (整数部分):
Example :( 173 )10 = ( Decimal Fraction Parts (小数部分):
乘 r 取整,顺序排列
)2

17
Example :( 0.8125 )10 = (
)2
数制转换:十进制整数二进制
把十进制 的173转 换为二进 制
数字系统只处理数字信号
0 , 1; 需要将任意信息用( 0 ,1 )表达; 用(0,1)表达数量: 数制 二进制 用(0,1)表达不同对象: 符号编码
3
2.1 positional number system (按位计数制)
Decimal number : 154 A decimal number D :
输 入
被减 减 输入借 数X 数Y 位Bin 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0
输 出
差D 输出借 位Bout 0 0 1 1 0 1 1 1 1 0
1
1 1
25
0
1 1
1
0 1
0
0 1
0
0 1
Digital Logic Design and Application (数字逻辑设计及应用)
19
9 4 2 0
(617.28)10=(1001101001.0100011)2
20
2.3 General Positional-Number-System Conversion (常用按位计数制的转换)
Example :Require < 10-2 ,Complete the following conversion ( 617.28 )10 = ( 1001101001.0100011 )2 2-n <= < 10-2 n=7
T
wo kinds of Information
Numeric Data (数值信息) — Number Systems and their
Conversions
Nonnumeric Data
(非数值信息)
-- Nonnumeric Data Representation – Codes
Chapter 2 Number Systems and codes
Radix Decimal number Binary number Octal number Hexadecimal number
If r=8, then D8 If r=16, then
7
Digit 0~9 0,1 0~7 0~9,A~F
10 2 8 16
p 1

i n
i d 8 i
Chapter 2 Number Systems and codes (数制与编码) Positional number systems Unsigned and Signed numbers
Codes in digital system
1
Chapter 2 Number Systems and codes
D = dp-1 ... d1 d0 . d-1 ... d-n = dp-110p-1+... d1101+d0100 +d-110-1+ ... d-n 10-n

i n
d 10
i
p 1
i
Weight(第i位的权) 10:Base or radix(基数) 10 digit:0,1,...,9
思考:任意两种进位计数制之间的转换 以十进制(二进制)作为桥梁
21
2.4 Addition and Subtraction of Nondecimal Numbers (非十进制数的加法和减法) Two Binary Number Arithmetic Addition Carry (进位) 1 + 1 = 10
=282 +381 +580 +28-1
=235.28
10011101.012 = 010 011 101. 0102 = 235.28
9
二进制与八进制和十六进制之间的转换
位数替换法:保持小数点不变,每位八进制数对 应3位二进制数; 每位十六进制数对应4位二进制数; 二进制转换时,从小数点开始向左右分组,在 MSB前 面和LSB后面可以加0; 转换为二进制时,MSB前面和LSB后面的0不写;
0+0=0 0+1=1 1+0=1 1+1=0,进位为1
Subtraction
Borrow (借位)
10 – 1 = 1
0-0=0 1-0=1 1-1=0 0-1=1,借位为1
22
Digital Logic Design and Application (数字逻辑设计及应用)
2.4 Addition and Subtraction of Non-decimal Numbers (非十进制数的加法和减法)
MSB
8
LSB
2.2 Octal and Hexadecimal numbers (八进制和十六进制数)
10011101.012 = ( )8 =127 +026 +025 +124 +123 +122 +021 +120 +02-1 +12-2
1 +( 022 +121 +120) 6 +( 022 +121 +020 )x 2 83 =2 8 22 0 +( 122 +021 +120 ) 2-3 x8 20 8-1
19
把十进制 数617.28 整数部分 转换为二 进制
2 2 2 2 2 2 2 2 2
617
………………余1 ………………余0 ………………余0 ………………余1 ………………余0 ………………余1 ………………余1 ………………余0 ………………余0 ………………余1
308
154 77 38
C:carry S:sum
23
B:borrow D:difference
表2.3.1 二进制加法真值表
•Carry in (进位 输入): C in (P.32)
• Carry out ( 进 位输出 ) C out Sum ( 本位和 ): S