Introduction To Computer Science: Mid-Term Exam: November 16, 2012

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

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

(a) Language (d) USA

(b) Blood Question 5

(c) Mind What is the name of the first commercial com-


puter in US?
(d) Neuron
(a) IBM System/360

Question 2 (b) UNIVAC

What was the original use of computers? (c) Macintosh

(a) For playing game. (d) ENIAC

(b) For data storage. Question 6

(c) Computation. What is the contribution of Xerox in the evolu-


tion of computer?
(d) Factory automation.
(a) Window

Question 3 (b) Mouse

Which of the following electronic technologies is (c) A4 paper


the key technology for making the first genera-
(d) Touch screen
tion electronic computer?

(a) Transistor Question 7


Information is a set of data that have been
(b) Integrated circuit
shaped into a form that is .
(c) Vacuum tube (a) meaningless and useless to human being
(d) Dual Core CPU (b) meaningful and useful to human being

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)

(b) meaningful information (c) (i) & (iii)


(d) (i), (ii) and (iii)
(c) information
Question 12
(d) numbers
In terms of management level, how can the fol-
lowing information systems are ranked (from
Question 9 high level to low level) ?
An information system is a set of interrelated (1) Transaction processing systems
components that , , and
(2) Executive information systems
distribute information to in an organi-
zation. (3) Management information systems
Which of the following should NOT be put in the
blanks ? (4) Decision support systems
Answer :
(a) collect
(a) 1, 2, 3, 4
(b) process (b) 2, 3, 4, 1

(c) store (c) 2, 4, 1, 3


(d) 2, 4, 3, 1
(d) make decision
Question 13
Question 10 Which of the following operation(s) a computer
is(are) able to perform?
The mission of an information system is to im-
prove the performance of through the (i) Arithmetic operation.
use of information technology.
(ii) Logic operation.
(a) computers in organizations Answer :
(a) (i) only
(b) people in organizations
(b) (ii) only
(c) computer network
(c) (i) & (ii)
(d) people network (d) None of them

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

1 1 What are the output values 𝑋 and 𝑌 if A is an


NAND gate and B is an NAND gate.

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

(c) 𝑋 = 1, 𝑌 = 0. Convert 2010 in 8-bit 2’S complement formate.


(a) 100101002
(d) 𝑋 = 1, 𝑌 = 1.
(b) 000101002

Question 15 (c) 100010102

What are the output values 𝑋 and 𝑌 if A is an (d) 000010102


OR gate and B is an OR gate.
Question 20
(a) 𝑋 = 0, 𝑌 = 0.
Convert −2010 in 8-bit 2’S complement for-
(b) 𝑋 = 0, 𝑌 = 1. mate.
(a) 100101002
(c) 𝑋 = 1, 𝑌 = 0.
(b) 000101002
(d) 𝑋 = 1, 𝑌 = 1. (c) 111010112
(d) 111011002
Question 16
What are the output values 𝑋 and 𝑌 if A is an Question 21
AND gate and B is an XOR gate.
Convert 2010 in 16-bit 2’S complement for-
(a) 𝑋 = 0, 𝑌 = 0. mate.
(a) 10000000100101002
(b) 𝑋 = 0, 𝑌 = 1.
(b) 00000000000101002
(c) 𝑋 = 1, 𝑌 = 0. (c) 10000000000010102
(d) 𝑋 = 1, 𝑌 = 1. (d) 00000000000010102

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.

𝑥 = 00102 and 𝑦 = 00012 . (c) 𝑋 = 1, 𝑌 = 0.

Clearly, both of them are positive. What is the (d) 𝑋 = 1, 𝑌 = 1.


result of 𝑥 + 𝑦 in decimal formate?
Question 27
(a) 110
Which of the following items are part of infor-
(b) −110 mation technologies ?
(c) 310 (i) Programming language
(d) −310 (ii) Operating system
(iii) Database
Question 25
Answer :
The truth table of an half adder is shown below.
(a) (i) & (ii)
A B C D
(b) (ii) & (iii)
0 0 0 0
0 1 0 1 (c) (i) & (iii)
1 0 0 1
1 1 1 0 (d) (i), (ii) and (iii)

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");

(a) Register system("PAUSE");


return 0;
(b) Control unit
}
(c) ALU
After compiling the above C program. What will
(d) Cache
you see on the computer screen?

Question 29 (a) ”Hello world”


What does MBytes stand for ?
(b) ”Hello world!”
(a) 100 Bytes (or 20 Bytes)
(c) Hello world
(b) 103 Bytes (or 210 Bytes)

(c) 106 Bytes (or 220 Bytes) (d) Hello world!

(d) 109 Bytes (or 230 Bytes)


Question 33
Question 30
In the above program, the files stdio.h and
C Programming language is for writing stdlib.h are commonly called files.
software. They .

(a) a communication scheme


(a) help; help
(b) a coding scheme
(b) header; help
(c) a Visual Basic interface
(c) help; define the operations of the functions
(d) a .NET interface
like printf and system

Question 31 (d) header; define the operations of the func-


To convert a C program to machine code, we tions like printf and system
need to use a .

(a) DevC compiler Diagram for Questions 34-35

(b) Java Development Kit Below is a simple circuit. It consists of a mem-


ory with 16 memory spaces (from M1 to M16),
(c) Visual Basic Compiler an ADD/SUB block, 2 input registers (IA
and IB) and one output register (OUT). M1
(d) Dictionary to M16, IA, IB and OUT are all 4 bits long.

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
----------------

Memory Suppose the initial contents of M1, M2, M3 and


M4 are given by
To control the above circuit, three commands
(MOV, ADD and SUB) are provided. The syn- 𝑀 1 = 0011, 𝑀 2 = 0010, 𝑀 3 = 0001, 𝑀 4 = 0000.
tax and the descriptions of these commands are What is the content of M4 once the program is
depicted in the following table. finished?
Syntax Description (a) 0010
MOV X Y Moving the content of Y to X
ADD X Y 𝑂𝑈 𝑇 = 𝑋 + 𝑌 (b) 0011
SUB X Y 𝑂𝑈 𝑇 = 𝑋 − 𝑌
(c) 0100

Question 34 (d) 0101

---------------- 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.

Question 38 (d) (i), (ii) and (iii).


Which of the following statement(s) is(are) true?

(i) All logic circuits can be built by using


NAND gates only.

(ii) All logic circuits can be built by using AND


gates only.

(iii) All logic circuits can be built by using XOR


gates only.

Answer:

(a) (i) only.

(b) (ii) only.

(c) (iii) only.

(d) None of them.

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?

(a) −15 to 15.

(b) −31 to 31.

(c) −63 to 63.

(d) 0 to 63.

Question 40
Which of the following statement(s) is(are) true?

(i) Smartphone is able to connect to the Inter-


net via 3G telcom network.

(ii) Smartphone is able to connect to the Inter-


net via WiFi.

You might also like