所屬科目:研究所、轉學考(插大)、學士後-計算機概論
(a) Why is it ideal to store a bit of data using a flip-flop?
(b) If we want to set the output to be 1, how should input 1 and input 2 be set?
2. Convert the following base ten integers to their equivalent two's complement representations in 5 bits. (12%)(a) -1, (b) 3, (c) -7.
(a) the program counter and
(b) the instruction register?
(c) What are the fetch, decode, and execute steps of the machine cycle? (12%)
4. When a computer is turned on, booting is conducted. What is the aim of the booting process? Usually, what kind of memory is used to store the bootstrap program? (8%)
(a) a domain name server and
(b) a gateway in the Internet? (8%)
6. What are cache memory, main memory, and virtual memory? Where are they inside a PC? (10%)
(a) What does the procedure Prog1 print for a positive integer n?
(b) If n=9, what is the result from Prog1?
(c) How to modify this procedure Prog1 into a new procedure Prog2 that returns 1 if n is of odd parity or 0 if n is of even parity? (20%)
8. Use C or Java to write a subroutine of argument n that prints a diamond shape, for example, n=5:(10%)
9. The number of derangements, \( d_n \), is \( n! \times \left[ \frac{1}{2!} - \frac{1}{3!} + \frac{1}{4!} + \dots + (-1)^n \frac{1}{n!} \right] \). Use C or Java to write a subroutine of argument n that computes \( d_n \). (10%)