所屬科目:研究所、轉學考(插大)、學士後-計算機概論
(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%) A B X
(a) Convert decimal number 102.75 into binary. (5%)
(b) Show how to compute 3 15 using 2's complementation representations and an addition (each number is represented by 8 bits). (5%)
(a) (10110110)2 XOR (01101010)2 = ? (5%)
(c) What is the result of executing printf(“%d”, 56 << 2); in C language? (5%)
(a) Write an if-statement that checks whether bits 0, 5, 6 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, 5, 6 of x is 1 using two of these operators. (10%)
5. Suppose we are to digitize an audio signal. If the sampling rate (the number of times per second we sample the amplitude of the sound wave) is 8 kHz and the bit depth (the number of bits used to encode each sample) is 16, how many storage space is required for a 10-minute uncompressed audio signal? What is the number of distinct amplitude levels that can be represented by this setting? (10%)
6. Write a function in C or Java 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 = {10, 45, 23, 11, 87, 4, 6, 26} after it has been right rotated. (10%)
7. Write a function in C or Java that accepts integer n as an input and returns the following result.(15%)
8. Let C(n, k) denote the number of ways to select k out of n items without order. It is known that C(n ,1) = n, C(n, n) = 1, and C(n, k) = C(n 1, k 1)+C(n 1, k). Please write a recursive function comb(int n, int k) that computes C(n ,k) based on the above-mentioned knowledge.(15%)