You are on page 1of 5

Assignment # 2

Name: Fatima shams

Roll no: 201393

Teacher name: mam noshina tariq

Department: bs psychology 1

University: air university

Q.no.1: Take 8-digit number and convert into decimal number.


Ans: 10101010 is binary number.
1 128 * 1 = 128
0 64 * 0 = 0
1 32 * 1 = 32
0 16 * 0 = 0
1 8 * 1 = 8
0 4 * 0 = 0
1 2 * 1 = 2
0 2 * 0 = 0
170

Q.no.2: Differentiate between assemblers, compilers and


interpreters.
Types of Translators

ASSEMBLERS COMPILERS INTERPRETERS

 Translate low level  Translate generic high level  Translate high language
language into machine or language into machine into machine language and
binary code. language. execute it.
 Convert entire assembly  Covert entire source code at  Convert one line of source
language. a time. and execute immediately
 The machine code is object  More memory is required before moving to next line.
code which can be to produce object code.  Less memory required
understandable by  Give lists of errors at the because no object code is
Q
computer. end of compilation. produced.
 More simplistic type since  Report errors when they
it converts basic are found.
commands and operations
before running.
Q.no.3: Discuss in detail the services provided by operating
system.
Ans: An operating system provide services to both the users and programs for execution. The
different services are provided to different operating systems. It makes the processing task easier.
The common services are listed below:
i. Programs execution
ii. I/O operations
iii. File system manipulations
iv. Communication
v. Error detection
vi. Resource allocation
vii. Accounting
viii. Protection

Program Execution
Operating system perform many kinds of process like loading, then
execute the content completely (code to execute, data to manipulate, registers). Following
are the major activities of operating system.
 Load program into memory
 Execute program
 Running processes like allocating, synchronization, and communication.
Input / Output Operations
This system comprises of I/O devices to make convenient for the
users to run program. For efficiency and protection users usually cannot control I/O
devices so it hides details of hard ware devices.
I/O operation means read or write with any file or any specific I/O device.
File System Manipulation
The collected or formed output of a program is stored in new files
whether on computer or secondary storage devices.
 This system normally organizes information into respective files.
 Program is required to read or write a file.
 System also provide user to create/delete files, directories and to create backup of
files.
Communication
It is required for data transfer between multiple process during execution. The
process can be on one computer or more than one computer.
 The OS handles connection strategies, problems of connection and security.
 Communication can be in two methods, Shared Memory and Message Passing.
Error Detection
Error can be in CPU, I/O devices, secondary storage devices and hardware.
This system constantly checking possible errors and ensure to take appropriate action for
correct and consistent computing.
Resource Allocation
In multi-users organization where multi jobs are running at same time,
resources such as main memory, must be allocated to one another. CPU scheduling
algorithms is a major activity used for better utilization of CPU.
Accounting
OS keep record of status of each resource and decides who get a resource for how
long and when. This record keeping is used for accounting and simply for accumulating.
Protection
When multiple users execute multiple processes, it must be protected from each
other activities. It also prevents interference of process with others. It is responsible for
security, ensuring that unauthorized user do not access system.

Q.no.4: List down the differences among Batch, Multi


Programming, and Real-Time Operating Systems.
Ans:
Batch Processing System

 It is a technique in which data and programs are collected and group by operating system
before starting processing.
 Computer execute them one by one i.e. it loads next job when one is terminated.
 When job is done, output is copied into output spool for later printing and further
processing.
Example: Printing of report cards of students of a school as a batch.
Multiprogramming System
 Multi users can execute multiple jobs by CPU simultaneously at a same time on large
scale.
 The user give instruction to operating system and receive response immediately.
 It is also known as Time Sharing Systems.
 Mini computers, mainframe computers support Time Sharing.
Example: Hundreds of students access the university’s mainframe computer at the same
time to check results, date sheets etc.
Real-Time Systems
 This system process information and grantee to give response within specific time period
to ensure correct performance.
 Develop for special applications which read and react to sensor data.
Example: Real-Time operating system is used to monitor the position of rocket.

You might also like