计算机导论复习重点
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Chapter 1 Computer and Data
Knowledge point:
1.1The computer as a black box.
1.2von Neumann model
1.3The components of a computer: hardware, software, and data.
1.4The history of computers.
REVIEW QUESTIONS
1.How is computer science defined in this book?
A:Issues related to the computer.
2.What model is the basis for today’s computers? ( Knowledge point 1.2)
A:The von Neumann model.
3.Why shouldn’t you call a computer a data processor? ( Knowledge point 1.1)
A:Computer is general-purpose machine. it can do many different types of tasks.
4.What does a programmable data processor require to produce output data? ( Knowledge
point 1.1)
A:The input data and the program.
5.What are the subsystems of the von Neumann computer model? ( Knowledge point 1.2) A:Memory, arithmetic logic unit, control unit, and input/output.
6.What is the function of the memory subsystem in von Neumann’s model? ( Knowledge
point 1.2)
A:Memory is the storage area. It is where programs and data are stored during processing.
7.What is the function of the ALU subsystem in von Neumann’s model? ( Knowledge point
1.2)
A:ALU is where calculation and logical operations take place.
8.What is the function of the control unit subsystem in von Neumann’s model? ( Knowledge
point 1.2)
A:It controls the operations of the memory, ALU, and the input/output subsystem.
9.What is the function of the input/output subsystem in von Neumann’s model?
( Knowledge point 1.2)
A:The input subsystem accepts input data and the program from outside the computer; the output subsystem sends the result of processing to the outside.
pare and contrast the memory contents of early computers with the memory contents
of a computer based on the von Neumann model? ( Knowledge point 1.2)
A:Computer based on the von Neumann model stores both the program and its corresponding data in the memory. Early computers only stored the data in the memory.
11.How did the von Neumann model change the concept of programming? ( Knowledge
point 1.2)
A:A program in the von Neumann model is made of a finite number of instructions. The instructions are executed one after another.
12.The first electronic special-purpose computer was called c( Knowledge point
1.4)
a. Pascal
b. Pascaline
c. ABC
d. EDV AC
13.One of the first computers based on the von Neumann model was called d
( Knowledge point 1.4)
a. Pascal
b. Pascaline
c. ABC
d. EDV AC
14.The first computing machine to use the idea of storage and programming was called
d( Knowledge point 1.4)
a. the Madeline
b. EDV AC
c. the Babbage machine
d. the Jacquard loom
15.d separated the programming task from the computer operation tasks.
( Knowledge point 1.3)
a. Algorithms
b. Data processors
c. High-level programming languages
d.
Operating systems
30. According to the von Neumann model, can the hard disk of today be used as input or output? Explain. ( Knowledge point 1.2)
A:Yes. When the hard disk stores data that results from processing, it is considered an output device; when you read data from the hard disk, it is considered an input device. 32. Which is more expensive today, hardware or software? ( Knowledge point 1.3)
A:Software.
Chapter 2 Data Representation
Knowledge point:
2.1 Data Types.
2.2 Data inside the Computer.
2.3 Representing Data.
2.4 Hexadecimal and Octal notation.
REVIEW QUESTIONS
five types of data that a computer can process. ( Knowledge point
2.1)
A:Numbers, text, images, audio, and video.
2.How does a computer deal with all the data types it must process? ( Knowledge point 2.2) A:All data types are transformed into bit pattern.
3.
4.What is the difference between ASCII and extended ASCII? ( Knowledge point 2.3)
A:ASCII is a bit pattern made of 7 bits and extended ASCII is a bit pattern made of 8 bits.
5.What is EBCDIC? ( Knowledge point 2.3)
A:Extended Binary Coded Decimal Interchange Code.
6.How is bit pattern length related to the number of symbols the bit pattern can represent?
( Knowledge point 2.3)
A:The relationship is logarithmic.
7.
8.
9.What steps are needed to convert audio data to bit patterns? ( Knowledge point 2.3)
A:Sampling, Quantization, and Coding.
10.What is the relationship between image data and video data? ( Knowledge point 2.3)
A:Video is a representation of images in time.
34. A company has decided to assign a unique bit pattern to each employee. If the company has 900 employees, what is the minimum number of bits needed to create this system of representation? How many patterns are unassigned? If the company hires another 300
employees, should it increase the number of bits? Explain your answer. ( Knowledge point 2.3)
A:log2900≈10,
210-900=124,
Yes, 900+300>210
Chapter 3 Number Representation
Knowledge point:
3.1 Convert a number from decimal, hexadecimal, and octal to binary notation and vice versa.
3.2 Integer representation: unsigned, sign-and-magni tude, one’s complement, and two’s complement.
3.3 Excess system.
3.4 Floating-point representation.
REVIEW QUESTIONS
5. What are three methods to represent signed integers? (Knowledge point 3.2)
A:Sign-and-Magnitude, One’s Complement, and Two’s Complement.
9. Name two uses of unsigned integers. ( Knowledge point 3.2)
A:Counting and Addressing.
10. What happens when you try to store decimal 130 using sign-and-magnitude representation with an 8-bit allocation? ( Knowledge point 3.2)
A:Overflow.
11. Compare and contrast the representation of positive integers in sing-and-magnitude, one’s complement, and two’s complement. ( Knowledge point 3.2)
A:The representation of positive integers in sing-and-magnitude, one’s complement, and two’s complement is the same.
14. Compare and contrast the range of numbers that can be represented in sign-and-magnitude, one’s complement, and two’s complement. ( Knowledge point 3.2)
A:Sign-and-Magnitude range –(2N-1-1)~+(2N-1-1)
One’s Complement range –(2N-1-1)~+(2N-1-1)
Two’s Complement range –(2N-1)~+(2N-1-1)
16. What is the primary use of the Excess_X system? ( Knowledge point 3.3)
A:The primary use of the Excess_X system is in storing the exponential value of a fraction.
17. Why is normalization necessary? ( Knowledge point 3.4)
A:A fraction is normalized so that operations are simpler.
Chapter 4 Operation On Bits
Knowledge point:
4.1 Arithmetic operations.
4.2 Logical operations.
4.3 Mask.
4.4 Shift operations.
REVIEW QUESTIONS
3. What happens to a carry form the leftmost column in the final addition? ( Knowledge point
4.1)
A:The carry is discarded.
5. Define the term overflow. ( Knowledge point 4.1)
A:Overflow is an error that occurs when you try to store a number that is not within the range defined by the allocation.
8. Name the logical binary operations. ( Knowledge point 4.2)
A:NOT, AND, OR, and XOR.
10. What does the NOT operator do? ( Knowledge point 4.2)
A:It inverts bits.(it changes 0 to 1 and 1 to 0)
11. When is the result of an AND operator true? ( Knowledge point 4.2)
A:Both bits are 1.
12. When is the result of an OR operator true? ( Knowledge point 4.2)
A:Neither bit is 0.
13. When is the result of an XOR operator true? ( Knowledge point 4.2)
A:The two bits are not equal.
17. What binary operation can be used to set bits? What bit pattern should the mask have? ( Knowledge point 4.3)
A:OR. Use 1 for the corresponding bit in the mask.
18. What binary operation can be used to unset bits? What bit pattern should the mask have? ( Knowledge point 4.3)
A:AND. Use 0 for the corresponding bit in the mask.
19. What binary operation can be used to flip bits? What bit pattern should the mask have? ( Knowledge point 4.3)
A:XOR. Use 1 for the corresponding bit in the mask.
Chapter 5 Computer Organization
Knowledge point:
5.1. three subsystems that make up a computer
5.2. functionality of each subsystem
5.3. memory addressing and calculating the number of bytes
5.4. addressing system for input/output devices.
5.5. the systems used to connect different components together.
Review questions:
1. What are the three subsystems that make up a computer?(Knowledge point 5.1) Answer: the CPU, main memory, and the input/output (I/O) subsystem.
2. What are the parts of a CPU? (Knowledge point 5.1)
Answer: The CPU performs operations on data and has a ALU, a control unit, and a set of registers.
3. What‘s the function of the ALU? (Knowledge point 5.2)
Answer: The ALU performs arithmetic and logical operations.
Exercises:
78. A computer has 64MB of memory. Each word is 4 bytes. How many bits are needed to
address each single word in memory? (Knowledge point 5.3)
Solution:
The memory address space is 64 MB, that is 2 raised to the power 26. The size of each word in bytes is 2 raised to the power 2. So we need 24(subtract 2 from 26) bits to address each single word in memory.
79. How many bytes of memory are needed to store a full screen of data if the screen is made of 24 lines with 80 characters in each line? The system uses ASCII code, with each ASCII character store as a byte. (Knowledge point 5.3)
Solution:
The quantity of bytes in a full screen is 1920 (24*80) while the system uses ASCII code with each ASCII character store as a byte. So we need 1920 bytes of memory to store the full screen of data.
87. A computer uses isolated I/O addressing. Memory has 1024 words. If each controller has 16 registers, how many controllers can be accessed by this computer? (Knowledge point 5.4) Solution:
Memory has 1024 words. So the address space is 1024. Each controller has 16 registers. Then we get 64 (divide 16 by 1024)controllers which can be accessed by this computer.
88. A computer uses memory-mapped I/O addressing. The address bus uses 10 lines. If memory is made of 1000 words, how many four-register controllers can be accessed by this computer? (Knowledge point 5.4)
Solution:
The address bus uses 10 lines. So, the address space is 1024(2 raised to the power 10). The memory is made of 1000 words and each controller has four registers. Then we get (1024-1000)/4 = 6 four-register controllers which can be accessed by this computer.
Chapter 6 Computer Networks
Knowledge point:
6.1. OSI model
6.2. TCP/IP protocol
6.3. three types of networks
6.4. connecting devices
6.5. client-server model
Review questions:
2. Name the layers of the OSI model? (6.1)
Answer: Physical layer, Data link layer, Network layer, Transport layer, Session layer, Presentation layer and Application layer.
3. Name the layers of the TCP/IP protocol suite. (6.2)
Answer: The layers of the TCP/IP protocol suite are: physical and data-link layers network layer, transport layer, and application layer.
8. What are the three common topologies in LANs? Which is the most popular today? (6.3) Answer: bus topology, star topology, ring topology, star topology
9. Name four types of network connecting devices. (6.4)
Answer: the four types of network connecting devices are repeater, bridge, router and gateway.
Chapter 7 Operating Systems
Knowledge point:
7.1. the definition of an operating system
7.2. the components of an operating system
7.3. Memory Manager
7.4. Process manager
7.5. deadlock
Review questions:
4. What are the components of an operating system? (7.2)
Answer: An operating system includes: Memory Manager, Process Manager, Device Manager and File Manager
13. What kinds of states can a process be in? (7.4)
Answer: ready state, running state, waiting state.
15. If a process is in the running state, what states can it go to next? (7.4)
Answer: ready state, waiting state.
What’s the definition of an operating system? (7.1)
Answer: An operating system is an interface between the hardware of a computer and user(programs or humans) that facilitates the execution of other programs and the access to hardware and software resources.
What are the four necessary conditions for deadlock? (7.5)
Answer: mutual exclusion, resource holding, no preemption and circular waiting.
51. A multiprogramming operating system uses paging. The available memory is 60 MB divided into 15 pages, each of 4MB. The first program needs 13 MB. The second program needs 12MB. The third program needs 27 MB. How many pages are used by the first program? How many pages are used by the second program? How many pages are used by the third program? How many pages are unused? What is the total memory wasted? What percentage of memory is wasted? (7.3)
Answer:
Each page is 4MB. The first program needs 13 MB. It is obviously that 4*3<13<4*4. So the first program uses 4 pages and wastes 3(16-3) MB. The second program needs 12 MB. It is obviously that 12=4*3. So the second program uses 3 pages and wastes 0 MB. The third program needs 27 MB. It is obviously that 4*6<27<4*7. So the first program uses 7 pages and wastes 1(28-27) MB. There are 1(15-4-3-7) page unused. There are totally 4(3+0+1) MB memory wasted. The percent of memory wasted is 4/(60-4*1)=7%.
Chapter 8 Algorithms
Knowledge point:
8.1. the concepts of an algorithm and a subalgorithm
8.2. three constructs for developing algorithms
8.3. basic algorithms
8.4. tools for algorithm representation
8.5. recursion
Review questions:
1. What is the formal definition of an algorithm? (8.1)
Answer: An ordered set of unambiguous steps that produces a result and terminates in a finite time.
2. Define the three constructs used in structured programming. (8.2)
Answer: The three constructs in structured programming are Sequence, Decision and Repetition.
10. What are the three types of sorting algorithms? (8.3)
Answer: bubble sort, selection sort and insertion sort.
12 What is the purpose of a searching algorithm? (8.3)
Answer: The purpose is to find the location of a target among a list of objects.
13. What are the two major types of searches? How are they different? (8.3)
Answer: sequential search and binary search. The difference is whether the list is ordered or not.
55. A list contains the following elements. Using the binary search algorithm, trace the steps followed to find 20. At each step, show the values of first, last and mid.
3, 7, 20, 29, 35, 50, 88, 200 (8.3)
Solution:
index 0---1---2---3---4---5---6---7
3, 7, 20, 29, 35, 50, 88, 200
First=0, Last=7, Mid=(0+7)/2=3
The data is D(3)=29, 20 smaller than the D(3), so remove the data from index 3 to 7. Change the new point First=0, Last= mid-1=2, and Mid=(0+2)/2=1
The data is D(1)=7, 20 bigger than the D(1), so remove the data from index 0 to 1. Change the new point First=mid+1=2, Last=2, and Mid=(2+2)/2=2
The data is D(2)=20, we find the data 20 in index=2
58. Write a recursive algorithm to find the combination of n objects taken k at a time using following definition.
C(n,k)=1 , if k=0 or n=k
C(n,k)=C(n-1,k)+(n-1,k-1) , if n>k>0 (8.5)
Solution:
A: C
Input : n and k
If(k==0 or n==k)
Then return 1
End if
If(n>k and k>0)
Then Return C(n-1,k)+(n-1,k-1)
End if
End。