• 沒有找到結果。

Homework 2 RELEASE DATE: 2015/10/19 DUE DATE: 2015/11/02 (Mon.) 12:10pm

N/A
N/A
Protected

Academic year: 2022

Share "Homework 2 RELEASE DATE: 2015/10/19 DUE DATE: 2015/11/02 (Mon.) 12:10pm"

Copied!
3
0
0

加載中.... (立即查看全文)

全文

(1)

Introduction to Computer (NTU, Fall 2015)

Homework 2

RELEASE DATE: 2015/10/19

DUE DATE: 2015/11/02 (Mon.) 12:10pm

 Please hand in your handwriting assignment after class.

 Each question is 10 point, and the total point is 100 point.

 Please write the solution in detail and clearly for each question; otherwise, you will lose partial point.

 Penalty for late parts:

90% of value for one-day late, 80% two-day late, ...

The following questions are from “Chapter 2 review problem” in “Computer Science: An Overview”, 12th Edition by J. Glenn Brookshear.

4. What is the value of the program counter in the machine described in Appendix C immediately after executing the instruction B0CD?

7. The following are instructions written in the machine language described in Appendix C.

Translate them into English.

a. 7123 b. 40E1 c. A304 d. B100 e. 2BCD

9. Translate the following instructions from English into the machine language described in Appendix C.

a. LOAD register 6 with the hexadecimal value 77.

b. LOAD register 7 with the contents of memory cell 77.

c. JUMP to the instruction at memory location 24 if the contents of register 0 equals the value in register A.

d. ROTATE register 4 three bits to the right.

e. AND the contents of registers E and 2 leaving the result in register 1.

12. Suppose the memory cells at addresses 00 through 03 in the machine described in Appendix C contain the following bit patterns:

a. Translate the first instruction into English.

b. If the machine is started with its program counter containing 00, what bit pattern is in register 6 when the machine halts?

(2)

Introduction to Computer (NTU, Fall 2015)

17. Suppose the memory cells at addresses 00 through 0D in the machine described in Appendix C contain the following bit patterns:

Assume that the machine starts with its program counter containing 00.

a. What bit pattern will be in register 0 when the machine halts?

b. What bit pattern will be in register 1 when the machine halts?

c. What bit pattern is in the program counter when the machine halts?

20. Suppose the memory cells at addresses 20 through 28 in the machine described in Appendix C contain the following bit patterns:

Assume that the machine starts with its program counter containing 20.

a. What bit patterns will be in registers 0, 1, and 2 when the machine halts?

b. What bit pattern will be in the memory cell at address 30 when the machine halts?

c. What bit pattern will be in the memory cell at address B0 when the machine halts?

(3)

Introduction to Computer (NTU, Fall 2015)

22. Suppose the memory cells at addresses 00 through 05 in the machine described in Appendix C contain the following (hexadecimal) bit patterns:

If we start the machine with its program counter containing 00, when does the machine halt?

28. Suppose the following program, written in the machine language of Appendix C, is stored in main memory beginning at address 30 (hexadecimal). What task will the program perform when executed?

34. Perform the indicated operations:

42. What would be the result of performing a 2-bit right circular shift on the following bytes represented in hexadecimal notation (give your answers in hexadecimal notation)?

a. 3F b. 0D c. FF d. 77

參考文獻

相關文件

• The Java programming language is based on the virtual machine concept. • A program written in the Java language is translated by a Java compiler into Java

Homework 4: Methods of Estimation, Asymptotic Distribution, Probability and Conditioning Due Date: December 1st.. What is the resulting

(18%) Determine whether the given series converges or diverges... For what values of x does the series

3) Consider the following reaction at equilibrium.. 10) In a reaction mixture containing reactants and products, each at a concentration of 1M, what is the value of Q?. A) 0 B) 1 C)

12) Calculate the maximum concentration (in M) of silver ions (Ag+) in a solution that contains 0.025 M of CO32-.. 24) What is the equilibrium constant for a reaction at 25 °C.. 30)

The masses (amu) and % abundances of the isotopes are given in the table below.. 32) A certain mass of carbon reacts with 23.3 g of oxygen to form

11) Carbon-11 is used in medical imaging. The half-life of this radioisotope is 20.4 min.. 31) If each of the following represents an alkane, and a carbon atom is located at each

The temperature is raised (at constant pressure) until the volume reaches 211 mL. The total pressure of the sample is 725 mmHg and the partial pressure of argon is 231 mmHg. An