# 计算机科学概论课后答案.pdf

Chapter 1 ExercisesFor Exercises 1–10, match the following people with their accomplish-ments.A. LeibnizB. PascalC. BabbageD. LovelaceE. HollerithF. ByronG. TuringH. Jacquard1. What French mathematician built and sold the first gear-drivenmechanical machine that did addition and subtraction?B2. Who built the first mechanical machine that did addition, subtraction,multiplication, and division?A3. Who designed the first mechanical machine that included memory?C4. Who was considered the first programmer?D5. Who proposed that a punched card be used for counting the census?E6. Who edited Babbage’s work?D7. Who was Ada Lovelace’s father?F8. Who would have been mentioned in the book the Code Breakers?G9. Who developed the concept of punched holes used in weaving cloth?H10. Who is associated with IBM?E567Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 567For Exercises 11–23, match the hardware listed to the appropriate genera-tion.A. FirstB. SecondC. ThirdD. FourthE. Fifth11. Circuit boardsC12. TransistorB13. Magnetic core memoryB14. Card input/outputA15. Parallel computingD16. Magnetic drumA17. Magnetic tape drivesA18. Integrated circuitsC19. Personal computerD20. Vacuum tubeA21. Large scale integrationD22. Magnetic discB23. NetworkingDFor Exercises 24–38, match the software or software concepts listed to theappropriate generation.568 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 568A. FirstB. SecondC. ThirdD. FourthE. Fifth24. AssemblersA25. FORTRANB26. Operating systemsC27. Structured programmingD28. Time sharingC29. HTML (for Web)E30. LoadersB31. SpreadsheetsD32. Word processorsD33. LispB34. PC-DOSD35. Loaders/linkers bundled into Operating SystemC36. JavaE37. SPSSC38. C++DChapter 1 Exercises 569Lewis_complete_ans 5/26/04 4:54 PM Page 569Exercises 39–55 are short answer.39. What do we mean by the statement that the 1980s and 1990s must becharacterized by the changing profile of the user?The original user was the programmer who had a problem to solve. Bythe 1970s, application programs were being written such that non-programmers could use them to solve problems. With the advent ofthe personal computer, many people began using the computer forpersonal correspondence, personal accounts, and games.40. Distinguish between computing as a tool and computing as a disci-pline.Computing as a tool refers to the use of computing by people to solveproblems in their professional or personal life. Computing as a disci-pline refers to the study of the body of knowledge that makes upcomputer science and/or computer engineering.41. Is computing a mathematical discipline, a scientific discipline, or anengineering discipline? Explain.Computing is neither a mathematical discipline nor a scientific disci-pline nor an engineering discipline; it has roots in all three disciplines.Boolean algebra, logic, and numerical analysis contribute greatly tothe foundations of computing. Simulation and model building fromthe scientific discipline contribute to the foundations of computing.The techniques from engineering of building large systems contributeto the foundations of computing.42. Distinguish between systems areas and applications areas incomputing as a discipline.The systems areas of computing as a discipline relate to the under-standing and building of computer tools: algorithms and data struc-tures, programming languages, (computer) architecture, operatingsystems, software methodology and engineering, and human-computercommunication. The applications areas in computing relate to thecomputer’s use as a tool: numerical computation, databases and infor-mational retrieval, artificial intelligence and robotics, graphics, organi-zational informatics, and bioinformatics.43. Define the word abstraction and relate it to the drawing in Figure 1.2.An abstraction is a mental model that removes complex details. Anabstraction lets the viewer see only those details that are relevant tothe user’s view. An engine is a mental model of a car from the builderor mechanic’s view. The cockpit is the mental model for an ordinarydriver, who does not have to know the details of the engine in order todrive the car.570 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 57044. Name the six subject subareas of computer science, called systemsareas, that relate to understanding and building computing tools ingeneral.algorithms and data structures, programming languages, architecture,operating systems, software methodology and engineering, andhuman-computer communication.45. Name the six subject subareas of computer science, called applicationsareas, that relate to the computer’s use as a tool.numerical and symbolic computation, databases and informationalretrieval, artificial intelligence and robotics, graphics, organizationalinformatics, and bioinformatics.46. Define the word protocol and explain how it is used in computing.A protocol is a code prescribing strict adherence to correct etiquetteand procedure (as in a diplomatic exchange). Computing terminologyhas borrowed the word to describe the correct etiquette for computersto use when communicating with one another.47. Distinguish between machine language and assembly language.Machine language is the language that is built into the electricalcircuitry of a computer.Assembly language is a language made up of mnemonic codes thatrepresent machine-language instructions.Programs written in assembly language are translated into machinelanguage programs by a computer program called an assembler.48. Distinguish between assembly language and high-level languages.Whereas assembly language is a language made up of mnemonic codesthat represent machine-language instructions, high-level languages useEnglish-like statements to represent a groups of assembly-languagestatements or machine-language statements. There is a one-to-onecorrespondence between statements in an assembly language and thestatements they represent in machine language. There is a one-to-manycorrespondence between high-level statements and the correspondingmachine-language statements.49. FORTRAN and COBOL were two high-level languages definedduring the second generation of computer software. Compare andcontrast these languages in terms of their history and their purpose.FORTRAN was written at IBM for use in solving science and engi-neering problems. It was not formally designed and has grown greatlyover the years. COBOL was design by a team for business applicationsand has been relatively stable.Chapter 1 Exercises 571Lewis_complete_ans 5/26/04 4:54 PM Page 57150. Distinguish between an assembler and a compiler.An assembler translates assembly-language programs into machinecode. A compiler translates programs in a high-level language intoeither assembly-language programs or machine-language programs.51. Distinguish between a systems programmer and an applicationsprogrammer.A systems programmer writes programs that are tools to help otherswrite programs. An applications programmer writes programs to solvespecific problems.52. What was the rationale behind the development of operating systems?The human operator was too slow. Computers were idle while thehuman prepared the next program to be run. The computer has thespeed to organize itself.53. What constitutes systems software?Utility programs such as loaders and linkers, operating systems, andlanguage translators are systems software.54. What do the following pieces of software do?a. LoaderA loader puts a program’s instructions into memory where they canbe executed.b. LinkerA linker is a program that puts pieces of a large program togetherso that it can be put into memory where it can be executed.c. EditorA editor is a word processing program that allows the user to enterand edit text.55. How was the program SPSS different from the programs that camebefore it?SPSS was the first application program written so that the non-programmer user could enter data and specify the processing of thedata.Chapter 2 ExercisesFor Exercises 1–5, match the following numbers with their definition.A. NumberB. Natural numberC. Integer numberD. Negative numberE. Rational number572 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 5721. A unit of an abstract mathematical system subject to the laws of arith-metic.A2. A natural number, a negative of a natural number, or zero.C3. The number zero and any number obtained by repeatedly adding oneto it.B4. An integer or the quotient of two integers (division by zero excluded).E5. A value less than zero, with a sign opposite to its positive counterpart.DFor Exercises 6–11, match the solution with the problem.A. 10001100B. 10011110C. 1101010D. 1100000E. 1010001F. 11110006. 1110011 + 11001 (binary addition)A7. 1010101 + 10101 (binary addition)C8. 1111111 + 11111 (binary addition)B9. 1111111 – 111 (binary subtraction)F10. 1100111 – 111 (binary subtraction)D11. 1010110 – 101 (binary subtraction)EFor Exercises 12–17, mark the answers true and false as follows:A. TrueB. FalseChapter 2 Exercises 573Lewis_complete_ans 5/26/04 4:54 PM Page 57312. Binary numbers are important in computing because a binary numbercan be converted into every other base.B13. Binary numbers can be read off in hexadecimal but not in octal.B14. Starting from left to right, every grouping of four binary digits can beread as one hexadecimal digit.B15. A byte is made up of six binary digits.B16. Two hexadecimal digits can be stored in one byte.A17. Reading octal digits off as binary produces the same result whetherread from right to left or left to right.AExercises 18–45 are problems or short answer questions.18. Distinguish between a natural number and a negative number.A natural number is 0 and any number that can be obtained by repeat-edly adding 1 to it. A negative number is less than 0, and opposite insign to a natural number, although we usually do not consider nega-tive 0.19. Distinguish between a natural number and a rational number.A rational number is an integer or the quotient of integer numbers.(Division by 0 is excluded.) A natural number is 0 and the positiveintegers. (See also definition in answer to Exercise 18.)20. Label the following numbers natural, negative, or rational.a. 1.333333rationalb. – 1/3negative, rationalc. 1066naturald. 2/5rationale. 6.2rational574 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 574f. π (pi)not any listed21. If 891 is a number in each of the following bases, how many 1s arethere?a. base 10891b. base 8Can’t be a number in base 8c. base 121261d. base 131470e. base 16219322. Express 891 as a polynomial in each of the bases in Exercise 21.8 * 102+ 9 * 10 + 1Can’t be shown as a polynomial in base 8.8 * 122+ 9 * 12 + 18 * 132+ 9 * 13 + 18 * 162+ 9 * 16 + 123. Convert the following numbers from the base shown to base 10.a. 111 (base 2)7b. 777 (base 8)511c. FEC (base 16)4076d. 777 (base 16)1911e. 111 (base 8)7324. Explain how base 2 and base 8 are related.Because 8 is a power of 2, base-8 digits can be read off in binary and 3base-2 digits can be read off in octal.25. Explain how base 8 and base 16 are related.8 and 16 are both powers of two.Chapter 2 Exercises 575Lewis_complete_ans 5/26/04 4:54 PM Page 57526. Expand the table on page 40 to include the numbers from 11 through16.27. Expand the table in Exercise 26 to include hexadecimal numbers.binary octal decimal0000010100111001011101111000100110101011110011011110111110000012345671011121314151617200123456789101112131415160123456789ABCDEF20hexadecimalbinary octal decimal000001010011100101110111100010011010101111001101111011111000001234567101112131415161720012345678910111213141516576 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 57628. Convert the following binary numbers to octal.a. 111110110766b. 1000001101c. 10000010202d. 110001014229. Convert the following binary numbers to hexadecimal.a. 10101001A9b. 11100111E7c. 011011106Ed. 01121111This is not a binary number30. Convert the following hexadecimal numbers to octal.a. A9251b. E7347C. 6E15631. Convert the following octal numbers to hexadecimal.a. 7771FFb. 605185c. 443123d. 521151e. 11Chapter 2 Exercises 577Lewis_complete_ans 5/26/04 4:54 PM Page 57732. Convert the following decimal numbers to octal.a. 9011605b. 321501c. 14922724d. 10662052e. 2001372133. Convert the following decimal numbers to binary.a. 45101101b. 691000101c. 106610000101010d. 991100011e. 1134. Convert the following decimal numbers to hexadecimal.a. 106642Ab. 1939793c. 11d. 9983E6e. 432B35. If you were going to represent numbers in base 18, what symbolsmight you use to represent the decimal numbers 10 through 17 otherthan letters?Any special characters would work, as well as characters from anotheralphabet. Let’s use # for 16 and @ for 17.578 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 57836. Convert the following decimal numbers to base 18 using the symbolsyou suggested in Exercise 15.a. 1066354b. 99099#@F9c. 1137. Perform the following octal additions.a. 770 + 6651655b. 101 + 7071010c. 202 + 667107138. Perform the following hexadecimal additions.a. 19AB6 + 4319AF9b. AE9 + FAF8c. 1066 + ABCDBC3339. Perform the following octal subtractions.a. 1066 – 77670b. 1234 – 765247c. 7766 – 5544222240. Perform the following hexadecimal subtractions.a. ABC – 1119ABb. 9988 – AB98DDc. A9F8 – 14929566Chapter 2 Exercises 579Lewis_complete_ans 5/26/04 4:54 PM Page 57941. Why are binary numbers important in computing?Data and instructions are represented in binary inside the computer.42. A byte contains how many bits?843. How many bytes are there in a 64-bit machine?844. Why do microprocessors such as pagers have only 8-bit machines?Pagers are not general purpose computers. The programs in pagers canbe represented in 8-bit machines.45. Why is important to study how to manipulate fixed-sized numbers?It is important to understand how to manipulate fixed-sized numbersbecause numbers are represented in a computer in fixed-sized format.Chapter 3 ExercisesFor Exercises 1–20, mark the answers true and false as follows:A. TrueB. False1. Lossless compression means the data can be retrieved without losingany of the original information.A2. A computer represents information in an analog form.B3. A computer must use the binary number system to represent informa-tion.B4. A digital signal represents one of two values at any point in time.A5. Four bits can be used to represent 32 unique things.B6. The signed-magnitude representation of numbers has two representa-tions for zero.A7. Overflow occurs when the value that we compute cannot fit into thenumber of bits we have allocated for the result.A580 Answers to ExercisesLewis_complete_ans 5/26/04 4:54 PM Page 5808. In the ASCII character set, there is no distinction made between upper-case and lowercase letters.B9. The Unicode character set includes all of the characters in the ASCIIcharacter set.T10. Keyword e