所屬科目:研究所、轉學考(插大)、學士後-計算機概論
(a) Show a truth table for the following circuit diagram. (5%)
(b) Draw a circuit diagram that is logically equivalent to the following circuit and uses only one NAND gate and one NOT gate. (10%)
2. (a) Convert decimal number 106.35 into binary. (5%)
(b) Show how to compute 5−18 using 2's complementation representations and an addition (each number is represented by 8 bits). (5%)
3. (a) (10110110)2 XOR (01101010)2 = ? (5%)
(b) What is the result of executing printf(“%d”, 55 << 3); in C language? (5%)
(a) Write an if-statement that checks whether bits 0, 4, 7 of x are all 1’s using one of these operators. (5%)
(b) Write an if-statement that checks whether any of the bits 0, 4, 7 of x is 1 using two of these operators. (10%)
5. A computer has 64MB of memory. Each word in this computer is 4 bytes. How many bits are needed to address any single word in memory? (10%)
6. Write a function in C that right rotates the contents of a given integer array. For example, if A = {45, 23, 11, 87, −4, 6, 26, 10}, then we have A = {23, 11, 87, −4, 6, 26, 10, 45} after it has been left rotated. (10%)
7. Write a function in C that accepts integer n as an input and returns the following result. (15%)\[ \frac{1}{1} + \frac{1}{1 \times 2} + \frac{1}{1 \times 2 \times 3} + \cdots + \frac{1}{1 \times 2 \times 3 \times \cdots \times n} \]
8. Represent -30.5625 in IEEE single precision format. Show your workings. (15%)