Vous êtes sur la page 1sur 5

AglaSem Schools

Sample Question PaperA


1. (a) PROM-Programmable Read Only Memory. (b) William Bradford Shockley introduced the concept of Transistors. (c) Relational Database Management System (d) 1. 2. Low Level Language The programming is done in binary. Programs are machine specific High Level Language The programming is done in human understandable language Programs are machine independent (1 mark for each difference) (e) (i) Real-time : A real-time operating system is a multitasking operating system that aims at executing real-time applications. Real-time operating systems often use specialized scheduling algorithms so that they can achieve a deterministic nature of behavior. The main objective of real-time operating systems is their quick and predictable response to events. They have an event-driven or timesharing design and often aspects of both. An event-driven system switches between tasks based on their priorities or external events while time-sharing operating systems switch tasks based on clock interrupts. (ii) Multi-user : A multi-user operating system allows multiple users to access a computer system at the same time. Time-sharing systems and Internet servers can be classified as multi-user systems as they enable multiple-user access to a computer through the sharing of time. Single-user operating systems have only one user but may allow multiple programs to run at the same time. (iii) Distributed : A distributed operating system manages a group of independent computers and makes them appear to be a single computer. The development of networked computers that could be linked and communicate with each other gave rise to distributed computing. Distributed computations are carried out on more than one machine. When computers in a group work in cooperation, they make a distributed system. (iv) Embedded : Embedded operating systems are designed to be used in embedded computer systems. They are designed to operate on small machines like PDAs with less autonomy. They are able to operate with a limited number of resources. They are very compact and extremely efficient by design. Windows CE and Minix 3 are some examples of embedded operating systems. (4) 2. (a) Level 1 Cache : Level 1 cache, often called primary cache, is a static memory integrated with processor core that is used to store information recently accessed by a processor. Level 1 cache is often abbreviated as L1 cache. The purpose of level 1 cache is to improve data access speed in cases when the CPU accesses the same data multiple times. For this reason access time of level 1 cache is always faster than access time of system memory. The processor may have additional level 2 and level 3 caches, albeit those caches are always slower then the L1 cache. (1) (1) (1)

h c s

l o o

a . s

a l g

m e s

.c

m o

In modern microprocessors primary cache is split into two caches of equal size - one is used to store program data, and another is used to store microprocessor instructions. Some old microprocessors utilized unified primary cache, which was used to store both data and instructions in the same cache. (2) (b) MIMD-Multiple Instruction and Multiple Data : MIMD computer system has a number of independent processors operate upon separate data concurrently. (2) (c) math.cos(x) returns the cosine value of the entered number. Example: math.cos(60) returns 0.5 (2)

(d) (i) (ii) (iii) (iv)

109 100101110111 747402 1111101

AglaSem Schools (1)


(1) (1) (1)

3. (a) Static Binding At translation Determined by programmer bind type to variable name, value to constant. Determined by translator bind global variable to location (at load time), bind source program to object program representation. (2) (b) Assume variable a holds 10 and variable b holds 20 then: l Operator == Description Checke if the value of two operands are equal or not, if yes then condition becomes true. Checks if the value of two operands are equal or not, if values are not equal then condition becomes true. Example (a == b) is not true.

!=

(c) ABC+ABC+ABC+ABC+ABC =BC(A+A)+AB(C+C)+AB(C+C) =BC+AB+AB =AB+B(A+C) (d) Four functions performed by compression tools are:

(i) Reduce the file size (ii) Provides faster access (iii) Makes file transfer easy over web (due to small file size) (iv) Prevents any data loss in files. (4) 4. (a) List is a data structure to store homogeneous data. Like string indices, list indices start at 0, and lists can be sliced, concatenated and so on: >>> a[0] spam >>> a[3] 1234 >>> a[-2] 100 >>> a[1:-1] [eggs, 100] >>> a[:2] + [bacon, 2*2] [spam, eggs, bacon, 4] >>> 3*a[:3] + [Boe!] [spam, eggs, 100, spam, eggs, 100, spam, eggs, 100, Boe!] (2) (b) input() is used to get string input while raw_input() is used to get integer input. Example: >> name=input(Enter a Name) >>age=raw_input (Enter Age) (2) (c) Python basically has three datatypes: dict, list and set

h c s

l o o

a . s

a l g

m e s

.c

(a != b) is true.

m o

(2)

(3)

AglaSem Schools list([iterable]) : Return a list whose items are the same and in the same order as iterable s items. iterable may be either a sequence, a container that supports iteration, or an iterator object.
class dict(iterable, **kwarg) Return a new dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments. class set([iterable]) Return a new set or set object whose elements are taken from iterable. The elements of a set must be hashable. To represent sets of sets, the inner sets must be frozenset objects. If iterable is not specified, a new empty set is returned. (3) (d) (i) math.ceil(x) Return the ceiling of x as a float, the smallest integer value greater than or equal to x. (ii) math.fabs(x) Return the absolute value of x. (iii) math.floor(x) Return the floor of x as a float, the largest integer value less than or equal to x. (iv) math.factorial(x) Return x factorial. Raises ValueError if x is not integral or is negative. (4) 5. (a) for and while loops are supported in python (b) a=10, b=30 (c) Defining a Function

You can define functions to provide the required functionality. Here are simple rules to define a function in Python: l l l l l Function blocks begin with the keyword def followed by the function name and parentheses ( ( ) ). Any input parameters or arguments should be placed within these parentheses. You can also define parameters inside these parentheses. The first statement of a function can be an optional statement - the documentation string of the function or docstring. The code block within every function starts with a colon (:) and is indented. The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return None.

Syntax :

def functionname( parameters ): function_docstring function_suite return [expression]

.s

o h c

s l o

g a .

s a l

em

.c

m o

(1) (1)

(d) x = 0 while True: try: x = int(raw_input(input a decimal number \t)) if x in xrange(1,1000000001): y = bin(x) rev = y[2:] print(the reverse binary soln for the above is %d) %(int(0b+rev[::-1],2)) break except ValueError: print(Please input an integer, thats not an integer) continue

(3)

(e)

Name Oval Flow line Parallelogram Rectangle Diamond

Symbol

Use in flowchart

AglaSem Schools

Denotes the beginning or end a program. Denotes the direction of logic flow ina program. Denotes either an input operation (e.g., INPUT) or an output operation (e.g., Print) Denotes a process to be carried out (e.g., an addition) Denotes a decision (or branch) to be made. The program should continue along one of two routes (e.g., IF/THEN/ELSE) (4)

6. (a) isdigit() checks if entered character is a digit. Returns false otherwise. isalpha() checks if entered character is a alphabet. Returns false otherwise. (1) (b) Keywords are reserved words that are used for special purpose in a program provided by the programming language. Some of the keywords in Python are: and assert break class continue def (2) (c) When you want to extract part of a string, or some part of a list, you use a slice. Other languages use the termsubstring for a string slice, and may have no mechanism for extract a list slice. Pythons slice syntax is easy and elegant: slicedString = aString[beginIndex:endIndex] slicedList = aList[beginIndex:endIndex] Slices Examples Line 1 2 Code

alphabet = abcdefghij

h c s

l o o

a . s

a l g

m e s

.c

m o

Meaning Making an alphabet variable. Slicing from subscript 1 thru subscript 2. slice1 = bc Slicing from subscript 0 (empty beginlndex) through subscript slice2 = abc

slice1 = alphabet[1:3]

3. slice2 = alphabet[3]

(3) (d) (i) Large uniform register set (ii) minimal number of addressing modes (iii) no/minimal support for misaligned accesses (iv) Fixed length instructions (4) 7. (a) System software is a type of computer program that is designed to run a computers hardware and application programs. (1)

(b)

AglaSem Schools
CPU Main Memory

Buses

Input Devices

Auxiliary Storage Input-Output System

Output Devices
(2)

(c) #program to find factorial of a number n=int(raw_input(Enter the number )) fact = 1 while n : fact = fact * n n=n-1 print Factorial of number is ,fact (d) line 1 : def sin(x,n) : line 2 : for (i in range[n]): line 3: sign=(-1)*i*i

h c s

o o

ls

g a .

la

m e s

.c

m o
(2)

(3)

qq