计算机科学导论原书第二版答案第十三章

合集下载

计算机科学导论原书第二版答案第十二章汇编

计算机科学导论原书第二版答案第十二章汇编
2. A stack is a restricted linear list in which all additions and deletions are made at one end, called the top. If we insert a series of data into a stack and then remove it, the order of the data will be reversed. This reversing attribute is why stacks are known as a last in, first out (LIFO) data structure. Four basic stack operations defined in this chapter are stack, push, pop, and empty.
}
return true
}
32. Algorithm S12.32 shows the pseudocode. Algorithm S12.32 Exercise 32
Algorithm: CompareStack(S1, S2)
Purpose: Check if two stacks are the same Pre: Given: S1 and S2 Post: Return: true (S1 = S2) or false (S1 ≠ S2) {
}
if (NOT empty (S1) or NOT empty (S2))
flag ← false
while (NOT empty (Temp1) and NOT empty (Temp2))
{ pop (Temp1, x) push (S1, x) pop (Temp2, y) push (S2, y)

大学计算机基础课课本计算机科学导论课后答案

大学计算机基础课课本计算机科学导论课后答案

大学计算机根底课课本计算机科学导论课后答案以下答案多方资料做的,仅供参考。

第一章绪论1. 和计算机相关的问题.2. 冯.诺依曼模型.3. 第一点:尽管这个模型能够表达现代计算机的功能,但是它的定义太广泛. 第二点:而且,并没有清楚地说明基于这个模型的机器能够完成的操作类型和数量.4. 输入数据和程序.5. 存储器,算术逻辑单元,控制单元和输入/输出单元.6. 存储器是用来存储的区域,在计算机处理过程中用来存储数据和程序.7. 算术逻辑单元是进行计算和逻辑判断的地方.8. 控制单元是用来对存储器,算术逻辑单元,输入/输出单元等子系统的操作进行控制的单元.9. 输入子系统负责从计算机外部接受输入数据和程序;输出子系统负责将计算机的处理结果输出到计算机外部.10. 早期的计算机的存储器存储数据.而完成某一任务的程序是通过操作一系列的开关或改变配线系统来实现的.而基于冯.诺依曼模型的计算机的存储器主要用来存储程序及其相应的数据.11.编程在早期的计算机中表达为对系列开关的开闭和配线系统的改变.而冯.诺依曼模型通过详细的第一计算机可以使用的不同指令集,从而使编程变得相对简单.程序员通过组合这些不同的指令来创立任意数量的程序. 12. B 13. C 14. A 15. B 16. D从而改变了编程的概念.17. C 18. D 19. C 20. A 21. D 22. A 23. C 24. D 25. D 26. D第二章略第三章数的表示1. 将十进制转换成二进制,那么反复采用底数除法.将要转换的数反复除2,所得余数做为从右往左的数.直到除数为1,作为最左端的数.2. 将所给的二进制的数每个二进制数字分别乘以它的权值,最后将每个二进制位乘以权值后的结果相加即得到相应的十进制数. 3. 第N位是2的N-1次幂.4. 第N位是10的N-1次幂.5. 符号加绝对值格式,二进制反码格式和二进制补码格式.6. 计算机定义一个最大的无符号整数的常量,这样,计算机所能存储的无符号整数就介于0到该常量之间.也就定义了一个存值范围.7. 位数分配是指用以表示整数的二进制位数.8. 因为8位的存储单元中,范围最大的无符号整数类型的范围是0~255,256超出其存储范围,在计算机中不能存储. 9. 计数和寻址.10. 溢出. 11. 一样.12. 符号加绝对值:在N位的存储单元中,将该负数忽略其负号,然后转换成N-1位的二进制数,缺乏位数左边补0.最后在最左边加1.二进制反码:在N位的存储单元中,将该负数忽略其负号,然后转换成N位的二进制数,缺乏位数左边补0.最后,将其每一位换成它D 31. C 32. B 33. D 34. ~46* 47.例子: 23. 23/2=11…1, 11/2=5…1, 5/2=2…1, 2/2=1…0, 剩1. 即:10111,所以其八位无符号整数即为00010111.48.例子: 41. 41/2=20…1, 20/2=10…0, 10/2=5…0, 5/2=2…1, 2/2=1…0, 剩1. 即:101001,所以其16位无符号整数为0000000000101001.49. 例子:-101, 去其负号. 101/2=50…1, 50/2=25…0, 25/2=12…1,12/2=6…0, 6/2=3…0, 3/2=1…1, 剩1. 即:1100101. 其8位符号加绝对值即补足7位,再在最左边加1表负数. 即:11100101. 50. 同上.51. 例子:-110, 去其负号, 110/2=55…0, 55/2=27…1, 27/2=13…1,13/2=6…1, 6/2=3…0, 3/2=1…1, 剩1. 即:1101110. 其16位无符号整数位:0000000001101110,二进制反码整数即为:以下略.方法由上面依此类推.第四章位运算略第五章计算机组成39.A 40.B41.A 42.D 43.D 44.D 45.C 46.A 47.B 48.A 49.(2")50.D51.A 52.A 53.C 54.B 55.D 56.D 57.A 58.B 59.C 60.B61.B 62.A 63.C 64.B 65.D 66.C 67.D 68.D 69.C 70.C 71.A 72.C 73.B 74.C 75.B 76.A 77.C第六章计算机网络1.模型是标准化组织制定的用于网络设计的指南;协议是用于控制网络或交互式网络种不同设备间交互的一系列规那么。

《计算机导论》(第2版)习题答案参考

《计算机导论》(第2版)习题答案参考

《计算机导论》(第2版)习题答案参考计算机导论(第2版)习题答案参考Chapter 1: Introduction to Computers1. Define a computer and discuss its attributes.A computer is an electronic device capable of performing various operations and processes based on a set of instructions. Its attributes include the ability to input, process, store, and output information, as well as the capability to execute complex calculations and perform tasks.2. Differentiate between hardware and software.Hardware refers to the physical components of a computer system, including the central processing unit (CPU), memory, storage devices, input/output devices, and peripherals. Software, on the other hand, represents the non-tangible parts of a computer system, such as programs and data that can be stored and executed by the hardware.3. Explain the concept of data representation and discuss different numbering systems used in computer systems.Data representation refers to the way data is stored and processed by a computer. Different numbering systems include the binary system (base-2), decimal system (base-10), octal system (base-8), and hexadecimal system (base-16). Each system has its own set of symbols and rules for representing numbers and characters.Chapter 2: Computer Hardware1. Discuss the major components of a computer system.A computer system consists of several major components, including the central processing unit (CPU), memory, storage devices, input/output devices, and peripherals. The CPU is responsible for executing instructions and performing calculations, while memory stores data and instructions temporarily. Storage devices are used for long-term data storage, andinput/output devices allow users to interact with the computer system.2. Describe the functions and characteristics of the CPU.The CPU is the central processing unit of a computer system and is responsible for executing instructions and performing calculations. It consists of two main components: the control unit, which manages the execution of instructions, and the arithmetic logic unit (ALU), which performs calculations and logical operations. The CPU's performance is determined by factors such as clock speed, cache size, and number of cores.3. Explain the different types of memory in a computer system.A computer system typically has two main types of memory: primary memory (RAM) and secondary memory (storage devices). RAM, or random access memory, is used for temporary data storage and is volatile, meaning its contents are lost when the power is turned off. Secondary memory, such as hard disk drives and solid-state drives, provides long-term storage for data even when the power is off.Chapter 3: Operating Systems1. Define an operating system and discuss its functions.An operating system is a software that manages computer hardware and software resources. Its functions include providing a user interface, managing memory and storage, coordinating the execution of applications, handling input/output operations, and ensuring system security and stability.2. Explain the difference between a single-user and multi-user operating system.A single-user operating system is designed to be used by one user at a time. It provides a user interface and manages the resources on the computer for the sole user. A multi-user operating system, on the other hand, allows multiple users to access the system simultaneously, sharing resources and executing their own programs concurrently.3. Discuss the concept of virtualization and its advantages.Virtualization is the process of creating a virtual version of a computer system or resources. It allows multiple operating systems to run on a single physical machine, enabling better resource utilization, cost savings, and improved flexibility. Virtualization also provides isolation between different virtual machines, enhancing security and system stability.In conclusion, this article provides a brief overview of the topics covered in the second edition of "Introduction to Computers." It includes explanations and answers to selected exercises, helping readers understand the fundamental concepts of computer science and technology. By studying these topics, readers can gain a strong foundation in computer knowledge and skills.。

第13章 计算机编程-计算机导论(第2版)-微课版-吕云翔-清华大学出版社

第13章 计算机编程-计算机导论(第2版)-微课版-吕云翔-清华大学出版社

编程语言的分类
• 编程语言可以按照多种方式进行分类: • 1. 低级语言和高级语言 • 低级语言直接为最底层硬件编写指令,可
分为机器语言和汇编语言。机器语言完全 由0、1二进制字符串组成,可直接交由处 理器处理;汇编语言稍微简便一些——它 可以使用处理器提供的特有指令(如移位 操作、简单的加减法)。 • 高级语言使用了符合人类语言的语法和关 键字,通过使用容易理解的命令来代替难 以理解的二进制代码或汇编代码——这一 工作交由编译器或解释器进行。
• 当发现bug时,编程人员可以使用调试器来 逐行检查程序。通过调试器可以检查程序 执行到特定步骤时的变量值。
编程工具
• 文本编辑器、程序编辑器都属于编程工具,但 在一般情况下,编程人员不会只使用它们进行 编程工作,而是趋向于使用包含了大量编程工 具的SDK或IDE。
• SDK(Software Development Kit,软件开发工 具包)是指某种语言特有的工具集。SDK通常 包含编译器、语言文档和安装说明,一些SDK 还会包含编辑器、调试器、图形化用户界面设 计和API(应用程序编程接口)。
• 文本编辑器。如Windows 的“记事本”。 • 程序编辑器。可以理解为是专门用来进行代码
编写的文本编辑器,它们提供了辅助编程的工 具,如将关键字用彩色显示、自动补全、查找 替换、格式化代码等。 • 可视化开发环境(Visual Development Environment,简称VDE)。提供了可视化编程 的工具,编程人员可以在其中拖动代表对象的 控件并设置其属性。
• 在编程语言编写的程序中,每行代码都由 关键字和参数按照语法规则组合在一起。 关键字是由对应编程语言的编译器或解释 器预先定义的,每个关键字都有其特殊的 含义。

【VIP专享】2011年计算机导论修订第二版课后练习答案

【VIP专享】2011年计算机导论修订第二版课后练习答案

第一章一、简答题1、什么是计算机 计算机系统是一种能够按照事先存储的程序 自动、高速的对数据进行输入、处理、输出和存储的系统。

一个计算机系统包括硬件和软件两大部分。

2、解释冯·诺依曼所提出的“存储程序”概念。

把程序和数据都以二进制的形式同意存放在存储器中 由机器自动执行。

不同的程序解决不同的问题 实现了计算机通用计算的功能3、计算机有哪些主要的特点 运算速度快`精度高计算机的字长越长 其精度越高 现在世界上最快的计算机每秒可以运算几十万次以上。

一般计算机可以有市纪委甚至几十位 二进制 有效数字 计算精度可由千分之几到百万分之几 是任何计算工具所望尘莫及的。

具有逻辑判断和记忆能力计算机有准确的逻辑判断能力和高超的记忆能力。

能够进行各种逻辑判断 并根据判断的结果自动决定下一步应该执行的指令。

高度的自动化和灵活性计算机采取存储程序方式工作 即把编号的程序输入计算机 机器便可依次逐条执行 这就使计算机实现了高度的自动化和灵活性。

4、计算机有哪些主要的用途1 科学计算2 数据处理(3) 实时控制 4 人工智能 5计算机辅助工程和辅助教育 6 娱乐和游戏5、计算机发展中各个阶段的主要特点是什么 第一代计算机特征是采用电子管作为主要元器件第二代计算机特征是采用晶体管作为主要器件第三代计算机特征是半导体中小规模集成电路第四代计算机特征是大规模和超大规模集成电路6信息化社会的主要特点是什么 1·建立完善的信息基础设施2·采用现金的信息技术3·建立广泛的信息产业4·拥有高素质的信息人才5·构建良好的信息环境7、信息化社会对计算机人才的素质和知识结构有哪些要求 在信息化社会中所需要的计算机人才是多方位的 不仅需要研究型、设计型的人才 而且需要应用型的人才 不仅需要开发型人才而且需要维护型、服务型、操作型的人才。

要求计算机人才具有较高的综合素质和创新能力 并对于新技术的发展具有良好的适应性。

计算机导论(第2版)课后习题(选择、填空)题目及参考答案

计算机导论(第2版)课后习题(选择、填空)题目及参考答案

第一章绪论一、选择题1. 冯•诺依曼对现代计算机的主要贡献是(D )oA.设计了差分机 B.设计了分析机 C.建立了理论模型 D.确立了计算机的基本结构2. 在计算机应用中,“计算机辅助设设计”的英文缩写为(A )oA. CADB. CA MC. CA ED. CA T3 .计算机中所有信息的存储都采用(A )。

4. 计算机最主要的工作特点是(B )。

5. 计算机硬件的组成部分主要包括运算器、存储器、输入设备、输出 设备和(A )oA.控制器 B.显示器 C.磁盘驱动器 D.鼠标器6. 用电子管作为电子器件制成的计算机属于(A )。

A.第一代B.第二代C.第三代D.第四代 7. 早期的计算机用来进行(A )。

A.二进制 B.八进制 C.十进制 D.十六进制A.存储程序与自动控制B.高速度与高精度 B.可靠性与可用性 D.有记忆能力A.科学计算B.系统仿真C.自动控制D.动画设计8.世界上公认的第一台计算机是(),诞生于()年,生产国是(), 所使用的逻辑元件是(B)。

A.IBM.PC,1946,美国,电子管B.数值积分计算机,1946,美国,电子管C.电子离散变量计算机,1942,英国,集成电路D.IBM-PCJ942,英国,晶体管9.个人计算机属于(C)A.小巨型机B.小型计算机C.微型计算机D.中型计算机10.计算机之所以能实现自动连续执行,是由于计算机采用了(D)原理A.布尔逻辑运算B.集成电路工作C.串行运算D.存储程序和程序控制11.下列关于计算机发展史的叙述中错误的事(D)A.世界上第一台计算机是在美国发明的ENIACB.ENIAC不是存储程序控制的计算机C.ENIAC是1946年发明的,所以世界从1946年起就进入了计算机时代D.世界第一台投入运行的具有存储程序控制的计算机是英国人设计并制造的EDVAC12.冯诺依曼型计算机的设计思想不包括(B)A计算机采用二进制存储B计算机米用十进制运算C存储程序和程序控制D计算机主要是由存储器,运算器,控制器,输入设备和输出设备五大部件组成的13.第三代计算机的逻辑元件采用(C)A.电子管B.晶体管C.中,小规模集成电路D.大规模或超大规模集成电路14.客机、火车订票系统属于(B)方面的计算机应用A.科学计算B.数据处理C.过程控制D.人工智能15.按照计算机用途。

计算机科学导论第2版答案

计算机科学导论第2版答案

第1章概述习题(答案)一.选择题1. D2. B3. CD4. C5. ABC6. A7. B8. B9. ABCD 10. ABCDE二.简答题1.什么是计算机系统?计算机系统是一种能够按照事先存储的程序,自动、高速地对数据进行输入、处理、输出和存储的系统,由计算机硬件系统和计算机软件系统两大部分组成。

2.请解释冯•诺依曼所提出的“存储程序”概念。

把程序和数据都以二进制的形式统一存放在存储器中,由机器自动执行。

不同的程序解决不同的问题,实现了计算机通用计算的功能。

3.控制器的主要功能是什么?控制器基本功能就是从内存中取出指令和执行指令,即控制器按程序计数器指出的指令地址从内存中取出该指令进行译码,然后根据该指令功能向有关部件发出控制命令,执行该指令。

另外,控制器在工作过程中,还要接受各部件反馈回来的信息。

4.简述CPU和主机的概念。

通常把运算器、控制器做在一个大规模集成电路块上称为中央处理器,又称CPU(Central Processing Unit)。

通常把内存储器、运算器和控制器合称为计算机主机,也可以说主机是由CPU与内存储器组成的,而主机以外的装置称为外部设备,外部设备包括输入/输出设备,外存储器等。

5.什么是计算机软件?计算机软件的分类有哪些?软件是指用来指挥计算机运行的各种程序的总和以及开发、使用和维护这些程序所需的技术文档。

计算机软件系统分为系统软件和应用软件。

计算机系统软件由操作系统、语言处理系统、以及各种软件工具等组成,指挥、控制计算机硬件系统按照预定的程序运行、工作,从而达到预定的目标。

应用软件是用户利用计算机软、硬件资源为解决各类应用问题而编写的软件,包括用户程序及其说明性文件资料。

6.计算机有哪些主要的特点?(1)运算速度快、精度高计算机的字长越长,其精度越高,现在世界上最快的计算机每秒可以运算几十万亿次以上。

一般计算机可以有十几位甚至几十位(二进制)有效数字,计算精度可由千分之几到百万分之几,是任何计算工具所望尘莫及的。

计算机导论(第2版)课后习题答案【清华大学出版社】

计算机导论(第2版)课后习题答案【清华大学出版社】

计算机导论(第 2 版)【清华大学出版社】课后习题答案第一章绪论一、简答题1.什么是计算机?(P1)计算机是一种能够按照事先存储的程序,自动、高速的对数据进行输入、处理、输出和存储的系统。

一个计算机系统包括硬件和软件两大部分。

2.解释冯•诺依曼所提出的“存储程序”概念。

(P6)把计算机程序与数据都以二进制的形式统一存放在存储器中,由机器自动执行。

不同的程序解决不同的问题,实现了计算机通用计算的功能。

3.计算机有哪些主要的特点?(P3-P4)○1运算速度快○2运算精度高○3具有记忆能力○4具有逻辑判断能力○5存储程序4.计算机有哪些主要的用途?(P4-P5)○1科学计算○2数据处理○3实时控制○5人工智能○5计算机辅助工程和辅助教育○6娱乐与游戏5.计算机发展中各个阶段的主要特点是什么?(P6-P8)第一代计算机(1946 年—1957 年)○1逻辑器件使用电子管○2用穿孔卡片机作为数据和指令的输入设备○3用磁鼓或磁带作为外存储器○4使用机器语言编译第二代计算机(1958 年—1964 年)○1用晶体管代替了电子管○2内存储器采用了磁心体○3引入了寄存器和浮点运算硬件○4利用I/O处理机提高了输入输出能力○5在软件方面配置了子程序库和批处理管理程序,并且推出了FORTRAN、COBOL、ALGOL 等高级程序设计语言及相应的编译程序第三代计算机(1965 年—1971 年)○1用小规模或中小规模的集成电路来代替晶体管等分立元件○2用半导体存储器代替磁心存储器○3使用微程序设计技术简化处理机的结构○4在软件方面则广泛引入多道程序、并行处理、虚拟存储系统以及功能完备的操作系统,同时还提供了大量的面向用户的应用程序第四代计算机(1972 年至今)○1使用了大规模和超大规模集成电路○2使用了大容量的半导体存储器作为内存储器○3在体系结构方面进一步发展了并行处理、多机系统、分布式计算机系统和计算机网络系统○4在软件方面则推出了数据库系统、分布式操作系统以及软件工程标准等第五代计算机主要特征是人工智能,具有一些人类智能的属性。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

(10278 mod 411) + 1 = 3 + 1 = 4 (09222 mod 411) + 1 = 2 + 1 = 3 (20553 mod 411) + 1 = 3 + 1 = 4 (17256 mod 411) + 1 = 405 + 1 = 406
. . .
09222 10278 20553
CHAPTER 13
File Structures
(Solutions to Practice Set)
Review Questions
1. The two access methods are sequential and random. 2. The old master file is the file that should be updated; the new master file contains the current data (the data from the old master file including any changes that were made during the update process). 3. The transaction file contains changes that should be made to the old master file. 4. To access a record in a file randomly, we need to know the address of the record. 5. The index is a table that relates the keys of the data items to the addresses in the file where the data are stored. 6. In direct hashing, the key is the address of the record in the file. 7. In modulo division hashing, the key is divided by the file size. The remainder plus 1 is used as the address of the record in the file. 8. In digit extraction hashing, certain digits are removed from the key and used as the address of the record. 9. A collision occurs when two hashed record have the same address. The three collision methods are open addressing, linked list resolution, and bucket hashing. In open addressing, the prime area is searched for an unoccupied address. In linked list resolution, the first record is stored in the home address, but it contains a pointer to the second record. In bucket hashing, a group of records are stored in a buckets which are locations that can accommodate more than one record. 10. A text file is a file of characters while a binary file is a collection of data stored in the internal format of the computer.
. . .
406
17256
36. The result of linked list resolution is shown in Figure S13.36. Figure S13.36 Exercise 36
Address Key Link
(10278 mod 411) + 1 = 3 + 1 = 4 (09222 mod 411) + 1 = 2 + 1 = 3 (20553 mod 411) + 1 = 3 + 1 = 4 (17256 mod 411) + 1 = 405 + 1 = 406
TR OR
Read TF Read OF
Stop
For simplicity, we assume that there is no discrepancy between OF and TF, which means that there is no need to create an error file. The routine follows the logic in the solution to Exercise 37. The loop will terminate when both files have reached their dummy records. The process, however, needs three decision branches. If the there is no transaction for a record (OR.k < TR.k), the record in the old master file is copied to the new transaction file. If there is a new record in the transaction file to be inserted into the new master file (OR.k > TR.k), then the routine simply writes that record. If (OR.k = TR.k), it means that a record needs to be either partially changed or totally deleted. In the case of deletion, no action is needed. In the case of change, the record in the old master file is updated and written to the new master file. Note that the routine works correctly if the transaction file is empty (having only one dummy record). This may happen, if at the end of the updating period, there is no changes to the old master file. The old master file is simply copied to the new master file. The routine also works correctly if the old master file is empty (creation of a new file).
New Master File Key 14 16 17 26 31 89 90 92 Name John Wu George Brown Duc Lee Ted White Joanne King Mark Black Orva Gilbert Betsy Yellow Pay Rate 17.00 18.00 11.00 23.00 28.00 19.00 20.00 14.00 Action A Key 17 Error File Name Martha Kent
Stop
38. Algorithm S13.38 shows the routine in pseudocode. Algorithm S13.38 Exercise 38
Algorithm: MergeFile (F1, F2, Sentinel) Purpose: It merges two sequential files Pre: Given F1 and F2 and the Sentinel Post: Return: A new File (NF) { R1 ← Read F1 R2 ← Read F2 while ((R1.k < Sentinel) OR (R2.k < Sentinel)) { if (R1.k < R2.k) { Write R1 to NF R1 ← Read F1 } else { Write R2 to NF R2 ← Read F2 } } return NF }
Address 003 004 005 Key
1422 = 20164 → 16 1252 = 15625 → 62 1342 = 17956 → 95 1532 = 23408 → 40 14 + 22 = 36 12 + 57 = 69 13 + 49 = 62 15 + 32 = 47 41 + 22 + 43 = 106 21 + 57 + 11 = 89 31 + 49 + 91 = 171 51 + 32 + 31 = 114
1
2
Multiple-Choice Questions
11. d 17. a 23. a 12. a 18. c 24. c 13. a 19. d 25. a 14. d 20. a 26. d 15. c 21. d 27. d 16. a 22. b 28. a
相关文档
最新文档