Tnou Study Center

Blog Owner: Vignesh A





Search This Blog

Sunday, December 9, 2012

BCA-03 (Introduction to System Software) TNOU first year assignment 2012 batch



BCA-03
Introduction to System Software
Answer all Questions: - (3 x 5= 15 marks) with 150 words
1.      Write the different types of Translators?
Answer:
Types of  translator:
1.      Assembler
2.      Compiler
3.      Interpreter

1.     Assembler

An assembler translates assembly language into machine code. Assembly language consists of mnemonics for machine opcodes so assemblers perform a 1:1 translation from mnemonic to a direct instruction. For example:
LDA #4 converts to 0001001000100100
Conversely, one instruction in a high level language will translate to one or more instructions at machine level.

2.     Compiler

A Compiler is a computer program that translates code written in a high level language to a lower level language, object/machine code. The most common reason for translating source code is to create an executable program (converting from a high level language into machine language).

3.     Interpreter

An interpreter program executes other programs directly, running through program code and executing it line-by-line. As it analyses every line, an interpreter is slower than running compiled code but it can take less time to interpret program code than to compile and then run it — this is very useful when prototyping and testing code. Interpreters are written for multiple platforms, this means code written once can be run immediately on different systems without having to recompile for each. Examples of this include flash based web programs that will run on your PC, MAC, games console and Mobile phone.

2.     Write Short notes on Lexical Analysis.

Lexical Analysis:

Lexical analysis is the process of analyzing a stream of individual characters (normally arranged as lines), into a sequence of lexical tokens (tokenization. for instance of "words" and punctuation symbols that make up source code) to feed into the parser. Roughly the equivalent of splitting ordinary text written in a natural language (e.g. English) into a sequence of words and punctuation symbols. Lexical analysis is often done with tools such as lex, flex and jflex.
Strictly speaking, tokenization may be handled by the parser. The reason why we tend to bother with tokenising in practice is that it makes the parser simpler, and decouples it from the character encoding used for the source code.
For example given the input string:
integer aardvark := 2, b;

output the following tokens:

keyword integer
word aardvark
assignment operator
integer 2
comma
word b
semi_colon
 
The lexical analyzer is the first phase of compiler. Its main task is to read the input characters and produces output a sequence of tokens that the parser uses for syntax analysis. As in the figure, upon receiving a get next token command from the parser the lexical analyzer reads input characters until it can identify the next token. 
Tokenized in the following table:
Lexeme
Token type
sum
Identifier
=
Assignment operator
3
Integer literal
+
Addition operator
2
Integer literal
;
End of statement
 


3.      Write the advantages of Virtual memory ?
 
Answer:
 
Virtual memory is a memory management scheme that allows the execution of processes even without loading them into the main memory. Where there is virtual memory in use, there is no need to load the entire process into the expensive main memory.

Advantages of Virtual Memory :

         Translation:
        Program can be given consistent view of memory, even though physical memory is scrambled
        Makes multithreading reasonable (now used a lot!)
        Only the most important part of program (“Working Set”) must be in physical memory.
        Contiguous structures (like stacks) use only as much physical memory as necessary yet still grow later.
         Protection:
        Different threads (or processes) protected from each other.
        Different pages can be given special behavior
          (Read Only, Invisible to user programs, etc).
        Kernel data protected from User programs
        Very important for protection from malicious programs
=> Far more “viruses” under Microsoft Windows
         Sharing:
        Can map same physical page to multiple users
(“Shared memory”)

Part B
Answer the Following Questions:

1.      Explain the Types of Operating System ?
Answer:

An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is a vital component of the system software in a computer system. Application programs usually require an operating system to function.
Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting for cost allocation of processor time, mass storage, printing, and other resources.
For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware,[1][2] although the application code is usually executed directly by the hardware and will frequently make a system call to an OS function or be interrupted by it. Operating systems can be found on almost any device that contains a computer—from cellular phones and video game consoles to supercomputers and web servers.

Real-time Operating System: It 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 object of real-time operating systems is their quick and predictable response to events. They either have an event-driven or a time-sharing design. An event-driven system switches between tasks based of their priorities while time-sharing operating systems switch tasks based on clock interrupts.

Multi-user and Single-user Operating Systems: Computer operating systems of this type allow multiple users to access a computer system simultaneously. Time-sharing systems can be classified as multi-user systems as they enable a multiple user access to a computer through time sharing. Single-user operating systems, as opposed to a multi-user operating system, are usable by only one user at a time. Being able to have multiple accounts on a Windows operating system does not make it a multi-user system. Rather, only the network administrator is the real user. But for a Unix-like operating system, it is possible for two users to login at a time and this capability of the OS makes it a multi-user operating system.

Multi-tasking and Single-tasking Operating Systems: When a single program is allowed to run at a time, the system is grouped under the single-tasking system category, while in case the operating system allows for execution of multiple tasks at a time, it is classified as a multi-tasking operating system. Multi-tasking can be of two types namely, pre-emptive or co-operative. In pre-emptive multitasking, the operating system slices the CPU time and dedicates one slot to each of the programs. Unix-like operating systems such as Solaris and Linux support pre-emptive multitasking. If you are aware of the multi-threading terminology, you can consider this type of multi-tasking as similar to interleaved multi-threading. Cooperative multitasking is achieved by relying on each process to give time to the other processes in a defined manner. This kind of multi-tasking is similar to the idea of block multi-threading in which one thread runs till it is blocked by some other event. MS Windows prior to Windows 95 used to support cooperative multitasking.

Distributed Operating System: An operating system that manages a group of independent computers and makes them appear to be a single computer is known as a distributed operating system. The development of networked computers that could be linked and made to 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.

Embedded System: The operating systems designed for being used in embedded computer systems are known as embedded operating 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, FreeBSD and Minix 3 are some examples of embedded operating systems.

Mobile Operating System: Though not a functionally distinct kind of operating system, mobile OS is definitely an important mention in the list of operating system types. A mobile OS controls a mobile device and its design supports wireless communication and mobile applications. It has built-in support for mobile multimedia formats. Tablet PCs and smartphones run on mobile operating systems.

Batch Processing and Interactive Systems: Batch processing refers to execution of computer programs in 'batches' without manual intervention. In batch processing systems, programs are collected, grouped and processed on a later date. There is no prompting the user for inputs as input data are collected in advance for future processing. Input data are collected and processed in batches, hence the name batch processing. IBM's z/OS has batch processing capabilities. As against this, interactive operating requires user intervention. The process cannot be executed in the user's absence.

Online and Offline Processing: In online processing of data, the user remains in contact with the computer and processes are executed under control of the computer's central processing unit. When processes are not executed under direct control of the CPU, the processing is referred to as offline. Let's take the example of batch processing. Here, the batching or grouping of data can be done without user and CPU intervention; it can be done offline. But the actual process execution may happen under direct control of the processor, that is online.

No comments:

Post a Comment