Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CPSC 1050 – Introduction to Computer Science

Practice Midterm


Part I - Multiple choice questions (1-9). Each question has 1 mark.

1.   What is the largest digit in the octal number system?

A.   1

B.   2

C.   7

D.  8

E.   9

2.   Using this Huffman encoding chart:

101111101001011 is the encoded version of which message?

A.   DREAR

B.   DREAD

C.   BREAD

D.   DOORBELL

E.   cannot be determined

3.   What is a single binary digit called?

A.   byte

B.   nibble

C.   bit

D.  word

E.   block

4.   What is a group of eight binary digits called?

A.   byte

B.   nibble

C.   bit

D.  word

E.   block

5.   Which Super Simple CPU instruction loads the value 6 into the accumulator?

A.   0101 0000 0000 0110

B.   0011 0000 0000 0110

C.   0111 0000 0000 0110

D.  0101 0000 0000 0100

E.   0100 0000 0000 0110

6.   Which text compression technique replaces a long series of repeated characters with a count of the repetition?

A.   Run-length encoding

B.   Character-set encoding

C.   Keyword encoding

D.   Huffman encoding

E.   ASCII encoding

7.   In the CPU, which register holds the address of the instruction which is required to be fetched next?

A.   program counter

B.   instructor register

C.   index register

D.  accumulator

E.   none of the above registers

8.   How many things can be represented using four bits?

A.   4

B.   8

C.   12

D.   16

E.   32

9.  What  is  the  smallest  number  system  (base)  in  which  430  could  be  a  valid  symbolic representation?

a) Base-2

b) Base-8

c) Base-10

d) Base-5

Part II - Problem solving (11 questions, 46 marks)

10.  [3 marks] Perform the following Binary subtraction directly, without converting to another base.

11000100

- 00111111

----------------

11. [3 marks] Perform the following Hexadecimal addition directly, without converting to another base.

1066

+  ABCD

-----------------

12. [2 marks] Convert the unsigned Binary number 1100111110100 to Hexadecimal?

13.  [2 marks] If 11110010 is in 2’s complement notation, what signed decimal number does it represent?

14.  [3 marks] Convert the decimal number 5.73 to binary. Stop after 4 decimal places. Show your work.

15.  [9 marks] Complete the following table. Each row is the same number written in different bases. Each column is the same base. All values are positive.

Binary

Octal

Decimal

Hexadecimal

01100111

 

 

 

 

65

 

 

 

 

226

 

16.  [3 marks] Simplify the Boolean Expression :  C(AC)' + BCA'.  Show all the steps. 

17.  [3 marks] Show the behavior of the following circuit with a truth table (draw the table):

A

B

AB

A'

A'   AB

0

0

 

 

 

0

1

 

 

 

1

0

 

 

 

1

1

 

 

 

18.  Consider the following truth table for a circuit where A, B, C are the inputs and X is the sole output.

A

B

C

X

0

0

0

0

 

0

0

1

0

 

0

1

0

0

 

1

0

0

0

 

0

1

1

0

 

1

0

1

1

 

1

1

0

1

 

1

1

1

1

 

b)   [3 marks] Draw a circuit implementing this expression using logic gates.

19.  Given the following Huffman encoding table:

Character

Huffman Code

 

Character

Huffman Code

A

00

 

O

10010

E

11

 

I

10011

T

010

 

N

101000

C

0110

 

F

101001

L

0111

 

H

101010

S

1000

 

D

101011

R

1011

 

 

 

a)   [2 marks] What word does the following bit sequence represent?

1010111001010010101110101000101000101011011111

b)    [2 marks] How many bits would it take to represent the word from part a) using ASCII characters assuming that one would use 8 bits per character?

c)    [2 marks] What is the compression ratio between parts a) and b)?

20. [5 marks] Consider the following "Super Simple CPU" program. Trace the code and determine what the values in Accumulator, Mem[14] (memory location 14) and Mem[15] will be after the program has executed (show the intermediate values too).  The original values are given in the following table.

Original Values

Accumulator

Mem[14]

Mem[15]

0

12

16