Introduction To Computer Science: Mid-Term Exam: November 16, 2012
Introduction To Computer Science: Mid-Term Exam: November 16, 2012
Introduction To Computer Science: Mid-Term Exam: November 16, 2012
Name: Question 4
Student ID: During World War II, which of the following
country did not have an electronic computer?
Question 1 (a) France
If the hardware of a computer is analog to the (b) Germany
body of a human being, which of the following is
the best description of the software. (c) England
1
(c) meaningless and useless to information sys- Question 11
tems
Which of the following items are part of infor-
mation technologies ?
(d) meaningful and useful to information sys-
tems (i) Digital camera
(ii) Mobile phone
Question 8 (iii) Internet
Data is a stream of representing events Answer :
occurring in organization.
(a) (i) & (ii)
(a) raw fact (b) (ii) & (iii)
2
Diagram for Questions 14-18 Question 17
The following schematic diagram is for Question What are the output values 𝑋 and 𝑌 if A is an
14 to Question 18. It is a circuit consisting of OR gate and B is an NAND gate.
two logic gates. (a) 𝑋 = 0, 𝑌 = 0.
X Y (b) 𝑋 = 0, 𝑌 = 1.
(c) 𝑋 = 1, 𝑌 = 0.
(d) 𝑋 = 1, 𝑌 = 1.
A B
Question 18
Question 14 (a) 𝑋 = 0, 𝑌 = 0.
(b) 𝑋 = 0, 𝑌 = 1.
What are the output values 𝑋 and 𝑌 if A is an
XOR gate and B is an AND gate. (c) 𝑋 = 1, 𝑌 = 0.
(a) 𝑋 = 0, 𝑌 = 0. (d) 𝑋 = 1, 𝑌 = 1.
(b) 𝑋 = 0, 𝑌 = 1. Question 19
3
Question 22 The implementation of this half adder can be
done by two logic gates, say 𝑋 and 𝑌 . Logic gate
Convert −2010 in 16-bit 2’S complement for-
𝑋 is with 𝐴 and 𝐵 as input and 𝐶 as output,
mate.
while logic gate 𝑌 is with 𝐴 and 𝐵 as input and
(a) 10000000000101002 𝐷 as output. What should logic gates 𝑋 and 𝑌
are?
(b) 00000000000101002
(a) 𝑋 is a OR gate, while 𝑌 is an AND gate.
(c) 10000000011010112
(b) 𝑋 is a XOR gate, while 𝑌 is an AND gate.
(d) 11111111111011002
(c) 𝑋 is a AND gate, while 𝑌 is an OR gate.
Question 23 (d) 𝑋 is a AND gate, while 𝑌 is an XOR gate.
𝑥 and 𝑦 are two binary numbers which are in
4-bit 2’s complement formate, where Question 26
The following is the truth table of a full adder.
𝑥 = 00102 and 𝑦 = 11012 .
What are the values 𝑋 and 𝑌 ?
Clearly, 𝑦 is a negative number. What is the
result of 𝑥 + 𝑦 in decimal formate? A B D C Z
0 0 0 0 0
(a) 110 0 0 1 0 1
0 1 0 0 1
(b) −110
0 1 1 1 0
(c) 010 1 0 0 0 1
1 0 1 X 0
(d) −710 1 1 0 1 0
1 1 1 1 Y
Question 24
(a) 𝑋 = 0, 𝑌 = 0.
𝑥 and 𝑦 are two binary numbers which are in
4-bit 2’s complement formate, where (b) 𝑋 = 0, 𝑌 = 1.
4
Question 28 Question 32
To execute an instruction, the CPU will first de- #include<stdio.h>
code the instruction into a sequence of electrical #include<stdlib.h>
signals controlling the connections amongst the
logic gates. Which of the following unit is re- int main(void){
sponsible for generating such signals? printf("Hello world!\n");
5
Question 35
----------------
MOV IA M1
MOV IB M2
ADD/SUB ADD IA IB
MOV IA OUT
MOV IB M3
SUB IA IB
MOV M4 OUT
----------------
---------------- Question 36
MOV IA M1
MOV IB M2 Which of the following is the language for use in
ADD IA IB the first generation electronic computer?
MOV IA OUT (a) Natural language.
MOV IB M3
ADD IA IB (b) High level language.
MOV M4 OUT
(c) C language
----------------
(d) Machine code.
Suppose the initial contents of M1, M2, M3 and
M4 are given by Question 37
𝑀 1 = 0010, 𝑀 2 = 0001, 𝑀 3 = 0010, 𝑀 4 = 0000. The logic function of the following truth table is
given by
¯
𝑍 = 𝐴𝐵𝐶 + 𝐴𝐵 ¯ 𝐶.
¯
What is the content of M4 once the program is
finished? A B C Z
0 0 0 0
(a) 0010 0 0 1 0
0 1 0 0
(b) 0011 0 1 1 X
1 0 0 0
(c) 0111 1 0 1 1
1 1 0 0
(d) 0101 1 1 1 Y
6
What are the values of 𝑋 and 𝑌 ? (iii) WiFi is another name for 3G telcom net-
work.
(a) 𝑋 = 0, 𝑌 = 0.
Answer:
(b) 𝑋 = 0, 𝑌 = 1.
(a) (i) only.
(c) 𝑋 = 1, 𝑌 = 0.
(b) (ii) only.
(d) 𝑋 = 1, 𝑌 = 1.
(c) (i) and (ii) only.
Answer:
Question 39
For a binary number which is represented in 6-bit
2’s complement formate, what are the smallest
and the largest numbers that can be represented?
(d) 0 to 63.
Question 40
Which of the following statement(s) is(are) true?