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

INT G005 (Intro.

to Programming) Cairo University    


....................................................................... :‫اإلسم‬
Quiz 1, Fall 2023 Faculty of Engineering    
Time: 20 minutes Preparatory Year
    Section: ………… BN: ………… code: …………..
.‫ حافظ على نظافة ورقتك‬.‫ظلل اجاباتك بوضوح فى الدوائر المخصصه فقط‬  
‫بوضوح‬
 ‫ظلل إجاباتك‬ 
Shade your answers clearly in the bubble sheet only. Keep your paper clean.

1- How many bits are needed to represent 1024 different bit patterns?
Shade
 your answers 
(a) 3 (b) 10 (c) 20 (d) none of the above  A B C D  
1 O O O O
2- For a logical circuit there are 'n' binary inputs. Then the number of different
input combinations in the truth table is 2 O O O O
(a) 2n (b) 2𝑛 (c) 2/n (d) 2(n+1) 3 O O O O
3- What is the result of the following subtraction problem (using two's 4 O O O O
compliment notation)?
5 O O O O
00001111
-10101010 6 O O O O
7 O O O O
(a)10111001 (b) 011000101 (c) 01010101 (d) 10110101
8 O O O O

4- Which of the following is a means of encoding music? 9 O O O O


(a) ASCII (b) MIDI (c) JPEG (d) GIF 10 O O O O
   
5- which of the following is true
   
(a) Overflow problems occur in storing fractions and truncation errors
occur in storing integers.    
(b) Both Overflow problems and truncation errors occur in storing
integers and occur in storing fractions.
(c) Both Overflow problems and truncation errors occur in storing
integers and does not occur in storing fractions.
(d) none of the above
6- The greatest negative number which can be stored in a computer that has
8-bit wordlength and uses 2's complement arithmetic is

(a)-256 (b) -255 (c) -128 (d) -127


7- Which of the following values cannot be stored accurately using a floating-point format
3
(a) 2.5 (b) (c) 6.25 (d) none of the above
16

8- What is the decompressed message for the following code


22123113431213536
if LZW compression, starting with the dictionary whose first, second and third entries are x , y and space.

(a) yyxy yy yyyx xxy xx xyx (b) yyyx xx yyyx xyx xx xyx
(c) xxyx xx xxyx yyx xx yyx (d) yyxy xx yyxy xyx xx xyx

9- which of the following is an implementation of OR gate in figure below


a)

b)

C)

d)

10 -Which of the following bit patterns (represented in hexadecimal notation) represents a positive number in two's complement notation?
(a) 7F (b) F7 (c) A8 (d) 8A

You might also like