Vous êtes sur la page 1sur 4

Introduction to Computers and Programming Midterm (2011)

Student id:

Name:

Total 4 pages, including problem set (A, B, C) and Appendix C totally 105 points.

A. Blank-filling problems [27%, 3% for each problem]


1. __________ uses a unique pattern of 16 bits to represent each symbol, which is enough to allow text written in such languages as Chinese, Japanese, and Hebrew to be represented. __________ means that the device or information is connected and readily available to the machine without human intervention. A __________ is a circuit that produces an output value of 0 or 1, which remains constant until a pulse from another circuit causes it to shift to the other value. The process of comparing the performance of different machines when executing the same program is called . The general instruction sets in any typical machine could usually be classified into three groups: (1) the group; (2) the arithmetic/logic group; (3) the control group. The CPU performs its jobs by continually repeating a three-step process: fetch, , and execute. An _______________ is the software that controls the overall operation of a computer and provides the interface by which a user can request the execution of programs. A large fictional memory space created by paging is called _______________. In multiprogramming, the procedure of changing from one process to another is called a _______________.

2. 3. 4. 5.

6. 7. 8. 9.

B. Short answer problems [48%]


10. Rewrite each of the following values. [8%] (1) 7 (base 10) into binary value (2) 2A (hexadecimal) into base 10 value (3) 2 1/4 (base 10) into binary value (4) 11010110 (binary) into hexadecimal value 11. What is the output O1 and O2, if the input (A, B, C) is (1, 0, 1)? [4%]:

12. What is the answer of a binary number 11010110 after [4%] (1) right shift (2) rotate left.

13. [4%] What are the differences in the use of the following storage systems: general-purpose registers, main memory, mass-storage?

Mass Storage
Figure P5: Typical Architecture of an Imaginary Computer System 14. [2% for each sub-problem] What are the functions of the following instructions (expressed in hexadecimal) in the machine language of Appendix C? (a) 1234 ; (b) 2234 Answer by writing a short description of each instruction in English or Chinese. 15. Suppose the memory cells at addresses AF through B1 in the machine described in Appendix C contain the flowing bit pattern (expressed in hexadecimal): Address Content AF B0 B0 B0 B1 AF If we started the machine with its program counter containing AF, (a) What would the first instruction do? [2%] (b) After instruction 1, what would happen (i.e., if the program keeps running to the end, or something else)? [2%] 16. Classify the following software into three categories: operating systems, applications, and utilities. [8 %] (1) Words

(2) UNIX (3) Minesweeper () (4) (5) (6) (7) System monitor Windows 7 DOS File Explorer ()

(8) Linux. 17. What are the full terms of the following abbreviations? [8%, 2% for each] (1) BIOS (2) GUI (3) ROM (4) FIFO

C. General / Computing problems [30%]


18. What is the difference between physical record, logical record, field, and key field?[5%] 19. A half adder adds two one-bit binary numbers A and B. It has two outputs, S and C (the value theoretically carried on to the next addition). The half adder can be constructed by fundamental logic gates. Suppose that there are two inputs and two outputs with the following input and output values: Input A Input B Output S Output C 0 0 1 1 0 1 0 1 0 1 1 0 0 0 0 1

Please construct a half adder by fundamental logic gates. [5%] 20. Suppose the memory cells at addresses 00 through 05 in the machine described in Appendix C contain the following bit patterns (expressed in hexadecimal): Address Content 00 12 01 02 02 32 03 42 04 C0 05 00 Assume that the machine starts with its program counter equal to 00: a. Translate each of the instructions that are executed into English. [6%] b. What bit pattern is in the program counter when the machine halts? [2%]

c. What bit pattern is in the memory cell at address 42 when the machine halts? [2%] 21. What is an interrupt handler? Please describe its function. [3%] 22. What is the main purpose of time-sharing? [3%] How does time-sharing work? Please use three processes to describe it. [4%]

Appendix (From Append C of the Text Book)


Opcode Operand Description ---------------------------------------------------------------------------------------------------------------------1 RXY LOAD the register R with the bit pattern found in the memory cell whose address is XY. Example: 14A3 would cause the contents of the memory cell located at address A3 to be placed in register 4. RXY LOAD the register R with the bit pattern XY. Example: 20A3 would cause the value A3 to be placed in register 0. RXY STORE the bit pattern found in register R in the memory cell whose address is XY. Example: 35B1 would cause the contents of register 5 to be placed in the memory cell whose address is B1. 0RS MOVE the bit pattern found in register R to register S. Example: 40A4 would cause the contents of register A to be copied into register 4. RST ADD the bit patterns in registers S and T as though they were twos complement representations and leave the result in register R. Example: 5726 would cause the binary values in registers 2 and 6 to be added and the sum placed in register 7. RST ADD the bit patterns in registers S and T as though they represented values in floating-point notation and leave the floating-point result in register R. Example: 634E would cause the values in registers 4 and E to be added as floating-point values and the result to be placed in register 3. RST OR the bit patterns in registers S and T and place the result in register R. Example: 7CB4 would cause the result of ORing the contents of registers B and 4 to be placed in register C. RST AND the bit patterns in register S and T and place the result in register R. Example: 8045 would cause the result of ANDing the contents of registers 4 and 5 to be placed in register 0. RST EXCLUSIVE OR the bit patterns in registers S and T and place the result in register R. Example: 95F3 would cause the result of EXCLUSIVE ORing the contents of registers F and 3 to be placed in register 5. R0X ROTATE the bit pattern in register R one bit to the right X times. Each time place the bit that started at the low-order end at the high-order end. Example: A403 would cause the contents of register 4 to be rotated 3 bits to the right in a circular fashion. RXY JUMP to the instruction located in the memory cell at address XY if the bit pattern in register R is equal to the bit pattern in register number 0. Otherwise, continue with the normal sequence of execution. (The jump is implemented by copying XY into the program counter during the execute phase.) Example: B43C would first compare the contents of register 4 with the contents of register 0. If the two were equal, the pattern 3C would be placed in the program counter so that the next instruction executed would be the one located at that memory address. Otherwise, nothing would be done and program execution would continue in its normal sequence. 000 HALT execution. Example: C000 would cause program execution to stop.

2 3

4 5

Vous aimerez peut-être aussi