C. 11.40624 D. 0.375 解:
Chapter 3 复习题
1.说出5种计算机可以处理的数据。
答:We discussed five data types: numbers, text, audio, images, and video. 5种计算机可以处理的数据类型为:数字、广西、音频、图像和视频。 2.位模式的长度如何与其能表示的符号数量相关?
答:If the length of the bit pattern is L bits, the number of symbols that can be represented by the bit pattern is 2L.
如果位模式的长度是L位,那么数字符号能表示的位模式为2L。 3.位图的方法是如何以位模式来表示一个图像的?
答:In the bitmap graphic method each pixel is represented by a bit pattern. 在位图方法中每一像素代表一个位模式。
4.矢量图方法优于位图方法的优点是什么?其缺点又是什么?
答:In vector graphic method, the size of the file is smaller and the image can be easily rescaled. However, vector graphic can not be used to represent the details of colors in a photo.
在矢量图方法中,图文件的大小更小,图更容易重构。然而,矢量图不适合存储照片图像的细微精妙。
5.将音频数据转换为位模式需要哪些步骤?
答:The three steps are sampling, quantization, and encoding.
将音频数据转换为位模式需要进行采样、量化和编码三个步骤。
6.比较和对照在无符号、符号加绝对值以及二进制补码格式中的正整数的表示法。
答:Representations are the same except that the representable range of positive integers in unsigned method is twice the other methods.
除了无符号正整数所能表示的范围是其他表示法的两倍外,符号加绝对值以及二进制补码格式中的正整数的表示法相同。
7. 比较和对照在无符号 、符号加绝对值以及二进制补码格式中的负整数的表示法。
答:In both representations, the upper half of the range represents the negative numbers. However, the wrapping is different as shown in Figure S3.7. In addition, there are two zeros in sign-and-magnitude but only one in two’s complement.
- 11 -
在无符号表示法中,它的范围介于0到无穷大之间,所以不能表示负数。在符号加绝对值表示法的负整数出现在正数的右边,有正0和负0之分。在二进制补码格式中的负整数在正整数的左边,没有正0和负0之分,负数不包括0,0属于正数。
8. 比较和对照在无符号 、符号加绝对值以及二进制补码格式中的0的表示法。 答:In the signed-and-magnitude representation, there are two zeros. In two’s complement representation there is only one zero. In the excess representation, zero is represented by a positive number (bias) such as +127 and +1023.
在符号加绝对值表示法中有两个0,即正0和负0。在另外两种表示法中,只有一个0,0只能表示正数。
9.讨论在符号加绝对值和二进制补码格式中最左位扮演的角色。
答:In both systems, the leftmost bit represents the sign. If the leftmost bit is 0, the number is positive; if it is 1, the number is negative.
在符号加绝对值格式表示法中,最左位用于定义整数的符号。0表示正整数,1表示负整数。在二进制补码表示法中,最左位决定符号。如果它是0,该整数为正;如果是1,该整数为负。
10.回答以下关于实数浮点表示法的问题: A.为什么需要规范化? B.什么是尾数?
C.数字在规范化以后,何种信息被计算机存储在内存中? 答:A. Normalization is necessary to make calculations easier.
B. Mantissa is the bit sequence to the right of the decimal point after normalization. C. The computer stores the sign of the number, the exponent, and the mantissa. A.规范化是为了使表示法的固定部分统一,科学记数法和浮点表示法都在小数点左边使用了唯一的非零数码。同时,规范化使得计算更加容易。 B.尾数是指小数点右边的二进制数。 C.数字规范化后,符号、指数和尾数(小数点右边的数)被计算机存储在内存中。 选择题
11.一个字节包含( )位。
A.2 B.4 C.8 D.16
12.在一个64种符号的集合中,每个符号需要的位模式长度为( )位。 A.4 B.5 C.6 D.7 13.10位可以用位模式表示多少种符号?
- 12 -
A.128 B.256 C.512 D.1024
14.假如E的ASCII码是1000101,那么e的ASCII码是( )。不查ASCII码表回答问题。
A.1000110 B.1000111 C.0000110 D.1100101
15.在所有语言中使用的32位码表示系统称为( )。 A.ANSI B.Unicode
C.EBCDIC D.扩展ASCII码 16.使用( )方法,图像可以在计算机中表示。 A.位图 B.矢量图
C.余码系统 D.答案A或B
17.在计算机中表示图像的( )图像方法中,每个像素分配一个位模式。 A.位图 B.矢量图 C.量化 D.二进制
18.在计算机中表示图像的( )图像方法中,图像分解成几何图形的组合。 A.位图 B.矢量图 C.量化 D.二进制
19.在计算机中表示图像的( )图像方法中,重新调整图像尺寸导致图像粗糙。 A.位图 B.矢量图 C.量化 D.二进制
20.当我们存储音乐到计算机中时,音频信号必须要( )。 A.取样 B.量化
C.编码 D.以上全部答案
21.在( )数字表示法中,如果最左边一位为0,其表示的十进制数是非负的。 A.二进制补码 B.浮点
C.余码系统 D.答案A和B
22.在( )数字表示法中,如果最左边一位为1,其表示的十进制数是负的。 A.二进制补码 B.浮点
C.余码系统 D.答案A和B 23.哪一种数字表示方法常用于存储小数部分的指数值? A.无符号整数 B.二进制补码 C.余码系统 D.以上都不是 24.在余码转换中,对要转换的数字( )偏移量。
A.加 B.减 C.乘 D.除 25.当小数部分被规范化,计算机存储( )。 A.符号 B.指数 C.尾数 D.以上全部
26.存储于计算机中数字的小数部分的精度由( )来定义。 A.符号 B.指数 C.尾数 D.以上全部
27.在IEEE标准浮点格式中,一个实数的符号与尾数的组合,用( )表示法作为整数的存储。
A.无符号整数 B.符号加绝对值 C.二进制补码 D.以上都不是
- 13 -
11. c 12. c 13. d 14. d 15. b 16. d 17. a 18. b 19. a 20. d 21. d 22. d 23. c 24. a 25. d 26. c 27. b 练习题
28.有多少不同的5位模式? 答:25 = 32 patterns.
29.一些国家的车牌有2个十进制数码(0~9),我们可以有多少种不同的车牌?如果不允许使用数码0,又会有多少种不同的车牌?
答:102 = 100 if zero is allowed. 92 = 81 if zero is not allowed.
30.用2个数码跟3个大字字母(A~Z)的车牌来重做第29题。 答:a. If zero is allowed, (102 for numbers) × (263 for letters) = 1757600.
2
b. If zero is not allowed, (9 for numbers) × (263 for letters) = 1423656. 31.一种机器有8个不同的圈。要表示每个圈需要多少位? 答:2n = 8→n =3 or log28 = 3.
32.学生在一门课程中的成绩可用A、B、C、D、F、W(退学)或I(未完成)表示等级。表示这些等级需要多少位? 答:2n = 7 → n ≈3 or log27 = 2.81 → 3.
33.一个公司决定给每个员工分配唯一的位模式。如果该公司有900名雇员,构建该表示法的系统最少需要多少位?可分配多少位模式?如果再雇佣另外300名员工,系统需要增加倍数吗?说明答案。
答:2n = 900 → n ≈ 10 or log2900 = 9.81 → 10. With n = 10 we can uniquely assign 210 = 1024 bit pattern. Then 1024 ? 900 = 124 patterns are unassigned. These unassigned patterns are not sufficient for extra 300 employees. If the company hires 300 new employees, it is needed to increase the number of bits to 11. 34.如果使用4位模式表示0到9的数码,将浪费多少位模式? 答:24 ? 10 = 6 are wasted.
36.将下列十进制数转成8位无符号正数。
A.23 B.121 C.34 D.342 答:a. 23 = 16 + 4 + 2 +1 = (0001 0111)2
b. 121 = 64 + 32 + 16 + 8 +1 = (0111 1001)2 c. 34 = 32 +2 = (0010 0010)2.
d. Overflow occurs because 342 > 255. 37.将下列十进制数转成16位无符号整数。
A.41 B.411 C.1234 D.342 答:a. 41 = 32 + 8 +1 = (0000 0000 0010 1001)2.
b. 411 = 256 + 128 + 16 + 8 + 2 + 1 = (0000 0001 1001 1011)2. c. 1234 = 1024 + 128 + 64 + 16 + 2 = (0000 0100 1101 0010)2. d. 342 = 256 + 64 + 16 + 4 + 2 = (0000 0001 0101 0110)2. 38.将下列十进制数转成8位二进制补码表示法。
A. ?12 B. ?145 C.56 D.142 答:
- 14 -
39.将下列十进制数转成16位二进制补码表示法。
A. 102 B. ?179 C.534 D.62056
答:
40.将下列8位无符号整数转换成十进制数。 A.01101011 B.10010100 C.00000110 D.01010000 答:a. 0110 1011 = 64 + 32 + 8 + 2 +1 = 107.
b. 1001 0100 = 128 + 16 + 4 = 148. c. 0000 0110 = 4 + 2 = 6. d. 0101 0000 = 64 + 16 = 80.
41.将下列8位二进制补码表示的整数转换成十进制数。 A.01110111 B.11111100 C.01110100 D.11001110
- 15 -