计算机科学与导论的答案,计算机科学与导论第三章答案.pdf

本文详细探讨了计算机科学中的五种数据类型:数字、文本、音频、图像和视频的表示。介绍了位模式如何表示不同数量的符号,位图和向量图形的优缺点,以及图像处理中的采样、量化和编码步骤。此外,还讨论了无符号、带符号和两补数方法在整数表示上的差异,并通过实例展示了数值转换的过程。内容还包括了不同数据类型的存储效率和表示范围,以及溢出处理等概念。
摘要由CSDN通过智能技术生成

a7f4a3f590493a1e451dd952a488fd7c.gif 计算机科学与导论第三章答案.pdf

(11页)

3ba12b331400af4c1bfcbdb84be5fae3.gif

本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦!

11.90 积分

1CHAPTER 3 Data Storage(Solutions to Review Questions and Problems)Review QuestionsQ3-1. We discussed five data types: numbers, text, audio, images, and video.Q3-2. If the length of the bit pattern is L bits, the number of symbols that can be rep-resented by the bit pattern is 2L.Q3-3. In the bitmap graphic method each pixel is represented by a bit pattern.Q3-4. In vector graphic method, the size of the file is smaller and the image can beeasily rescaled. However, vector graphic can not be used to represent thedetails of colors in a photo.Q3-5. The three steps are sampling, quantization, and encoding.Q3-6. Representations are the same except that the representable range of positiveintegers in unsigned method is twice the other methods. Q3-7. In both representations, the upper half of the range represents the negativenumbers. However, the wrapping is different as shown in Figure Q3.7. Inaddition, there are two zeros in sign-and-magnitude but only one in two’scomplement. Figure Q3.7 Wrapping for two number representationsWrapping in sign-and-magnitude representation Wrapping in two’s complement representation Minimum -0+0 MaximumMinimum 0 MaximumWrappingWrapping2Q3-8. In the signed-and-magnitude representation, there are two zeros. In two’scomplement representation there is only one zero. In the excess representa-tion, zero is represented by a positive number (bias) such as +127 and +1023.Q3-9. In both systems, the leftmost bit represents the sign. If the leftmost bit is 0, thenumber is positive; if it is 1, the number is negative. Q3-10.a. Normalization is necessary to make calculations easier.b. Mantissa is the bit sequence to the right of the decimal point after normal-ization.c. The computer stores the sign of the number, the exponent, and the mantissa.ProblemsP3-1. 25 = 32 patterns.P3-2. 102 = 100 if zero is allowed. 92 = 81 if zero is not allowed.P3-3.a. If zero is allowed, (102 for numbers) × (263 for letters) = 1757600. b. If zero is not allowed, (92 for numbers) × (263 for letters) = 1423656.P3-4. 2n = 8 → n =3 or log28 = 3. P3-5. 2n = 7 → n ≈3 or log27 = 2.81 → 3. P3-6. 2n = 900 → n ≈ 10 or log2900 = 9.81 → 10. With n = 10 we can uniquelyassign 210 = 1024 bit pattern. Then 1024 − 900 = 124 patterns are unassigned.These unassigned patterns are not sufficient for extra 300 employees. If thecompany hires 300 new employees, it is needed to increase the number of bitsto 11. P3-7. 24 − 10 = 6 are wasted.P3-8. 256 level can be represented by 8 bits because 28 = 256. Therefore, the num-ber of bits per seconds is (8000 sample/ sec) × (8 bits / sample) = 64,000 bits /secondsP3-9.a. 23 = 16 + 4 + 2 +1 = (0000 1011)2b. 121 = 64 + 32 + 16 + 8 +1 = (0111 1001)2c. 34 = 32 +2 = (0010 0010)2.d. Overflow occurs because 342 > 255. 3P3-10. a. 41 = 32 + 8 +1 = (0000 0000 0010 1001)2.b. 411 = 256 + 128 + 16 + 8 + 2 + 1 = (0000 0001 100。省略部分。 Leftmost bit is 0. The sign is plus 0 1 1 1 0 1 1 1 Integer changed to decimal 119Sign is added +119Leftmost bit is 1. The sign is minus 1 1 1 1 1 1 0 0 ↓↓↓↓↓↓↓↓Apply one’s complement operation 0 0 0 0 0 0 1 1 Integer changed to decimal 3Sign is added −3Leftmost bit is 0. The sign is plus 0 1 1 1 0 1 0 0 Integer changed to decimal 116Sign is added +116Leftmost bit is 1. The sign is minus 1 1 0 0 1 1 1 0 ↓↓↓↓↓↓↓↓Apply one’s complement operation 0 0 1 1 0 0 0 1 Integer changed to decimal 49Sign is added −499P3-26.a. (01110111)2b. (11111100)2c. (01110100)2d. (11001110)2P3-27. a. With 3 digits we can express 103 = 1000 integers, 500 for positives and 500negatives. Then we can represent numbers in the range of −499 to 499. b. The first digit determine the sign of the number. The number is positive ifthe first digit is 0 to 4 and negative if the first digit is 5 to 9. c. We have two zeros, one positive and one negative. d. +0 = 000 and −0 = 999.P3-28.a. +234 → 234.b. +560 → Overflow because 560 is not in the range −499 to 499. c. −125 → 874.d. −111 → 888.One’s complement = 10001000 Two’s complement = 10001001 +110001001One’s complement = 00000011 Two’s complement = 00000100 +100000100One’s complement = 10001011 Two’s complement = 10001100 +110001100One’s complement = 00110001 Two’s complement = 00110010 +10011001010P3-29. a. With 3 digits we can represent 103 = 1000 integers, 500 for zero and posi-tives and 500 for negatives. Then we can represent numbers in the range of−500 to 499. b. The first digit determine the sign of the number. The number is zero or pos-itive if the first digit is 0 to 4 and negative if the first digit is 5 to 9. c. No, there is only one representation for zero (0 = 000). d. NA.P3-30. a. +234 → 234. b. +560 → Overflow because 560 is not in the range −500 to 499. c. −125 → 874 + 1 = 875.d. −111 → 888 + 1 = 889.P3-31. a. With 3 digits we can represent 163 = 4096 integers, 2048 for positives and2048 for negatives. Then we can represent numbers in the range of (−7FF)16 to (7FF)16. b. The fifteen’s complement of a positive number is itself. To find the fifteencomplement of negative numbers, we subtract each digit from 15. c. We have two zeros, a positive zero and a negative zero.d. +0 = (000)16 and −0 = (EEE)16.P3-32.a. (+B14)16 → (B14)16.b. (+FE1)16 → Overflow because it is not in the range (−7FF)16 to (7FF)16. c. (−1A)16 = (−01A)16 → (FE5)16.d. (−1E2)16 → (E1D)16.P3-33.a. With 3 digits we can represent 163 = 4096 integers, 2048 for zero and posi-tives and 2048 for negatives. Then we can represent numbers in the rangeof (−800)16 to (7FF)16.b. If the number is positive, the complement of the number is itself. If thenumber is negative we find the fifteen’s complement and add 1 to it. c. No, there is only one zero, (000)16. d. NA. 关 键 词: 导论 答案

4d91c43bfc72ca913299809b07b4968f.gif  天天文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值