CF &C Unit 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

UNIT 1

A computer system is not a single device or setup that functions on its own. It is made of several components which have specific functions and features to support the entire system.

While there are many devices under one system, they are divided into three basic components of the computer system.

The main three components are – Input Unit, Output Unit, and Central Processing Unit. The central processing
unit is further divided into memory or storage unit, control unit, and arithmetical and logical unit. Each unit has
its own special feature to assist the system.
The input unit is mandatory for taking in the instructions, the processing unit is important for understanding them
and the output unit enables the delivery of results.

Input Unit of Computer System


The computer system responds to the instruction it receives from the users. And to get those instructions, a
computer needs an input unit.

Functions of Input Unit of a Computer System

 Takes in user commands in the form of data.


 Converts data in a digital language format.
 Sends over the data to the processing unit for the next step.

Examples of Input Unit

 Keyboard
 Mouse
 JoyStick
 Light pen
 Track Ball
 Scanner
 Graphic Tablet

.
Output Unit

The user, when sending a set of instructions to the computer, reaches the output device in the end. The execution
of command takes place here and the users get their results.

Functions of Output Unit of Computer

 Receives the instructions in machine language to execute a task.


 Coordinates with the processor to get the instruction on time.
 Converts the machine language back into a user-friendly one by completing tasks.

Central Processing Unit (CPU)


UNIT 1

The data that the input unit accepts goes to the processing unit before execution. This unit understands what the
command actually is and how they can achieve it. It converts data accepted in human language into machine
language for computers to understand. It has a main board with a central chip which is the primary part of the
processor.
The processor coordinates with both input and output devices to make things done. It has three main components

a. Memory Unit

This component of the CPU deals with strong data. When the data reaches the processor from the input devices,
the memory unit saves it immediately. It has some pre-existing programs which help in transmitting the data to
the other parts of the CPU.

Functions of Memory Unit In Computer

 Responsible for storing data coming from input devices.


 Storing the result data coming from output devices.
 Storing all the steps that the system goes through while task execution.

b. Control Unit

Functions of Control Unit in Computer

 Coordinate information transfer between the memory and I/O devices.


 Converts the instruction into machine language.
 It decodes the instruction and sends it to the correct device.
 Prepare a data sequence making it easier for processing.
 Maintains a flow of data inside the system.
 Transfer the commands/issues to the arithmetic and logic unit.

c. Arithmetic & Logical Unit (ALU)

This unit of processor takes care of mathematical calculations and issues that the computer system faces while
functioning.

Functions of ALU in Computer

 Responsible for all calculations and mathematical issues.


 Allows the computer to compare data easily.
 Enables the data transfer between primary and secondary memory by decoding it.
 Acts as a decision-maker in case of any trouble.

Operating System:

An operating system is responsible for managing and controlling all the activities and sharing of computer resources. An operating system is a low-level Software

that includes all the basic functions like processor management, memory management, Error detection, etc.

Functions of Operating Systems

Security
UNIT 1

The operating system uses a password protection to protect user data it also prevents unauthorized access to programs and user data, but for external

functionality we need to install malware software to protect the system.

Control over system performance

The operating system monitors overall system setup to help in improving the performance and it also records the response time between service requests

and system response so that it has a complete view of the system. This can help improve performance by providing important information that is needed

at the time of troubleshooting problems.

Job Accounting

Operating systems always keep track of time and resources that are used by various tasks and users, this information can be used to track resource usage

for a particular user or a group of users.

Error detecting aids

Operating systems constantly monitor the system which helps us to detect errors and also avoid the malfunctioning of computer systems.

Coordination between other software and users

Operating systems help in coordinate and assign interpreters, compilers, assemblers, and other software to the various users of the computer systems.

Memory Management

The operating system controls the primary memory or main memory. Primary memory is a large array of bytes or words where each byte or word is

assigned a certain address. It is a fast storage, and it can be accessed directly by the CPU which is present inside the system. If a program wants to be

executed, it should be first loaded in the main memory.

The following activities are performed by operating system for memory management −

 It keeps track of primary memory.

 Memory addresses that have already been allocated and the memory addresses of the memory that has not yet been used.

 In multiprogramming, the OS decides for how long the process must stay and the order in which processes are granted access to memory.

 It allocates the memory to a process when the process requests it and deallocates the memory when the process has terminated.

Processor Management

The OS manages the order in which processes have access to the processor, and how much processing time that each process must stay in the

multiprogramming environment. This is called process scheduling.

The following activities are performed by operating system for processor management −

 Keeps track of the status of processes.

 The program to track the status is known as traffic controller.

 It allocates the CPU and deallocates the processor when it is not required.

Device Management
UNIT 1

An OS manages device communication through respective drivers.

The following activities are performed by the operating system for device management.

 Keeping track of all devices connected to the system.

 The OS designates a program that is responsible for every device which is called the Input/output controller.

 It decides which process gets access to which device and for how long. It then allocates the devices in an effective and efficient way and de-allocates

devices when they are not required.

File Management

A file system is arranged into directories for efficient navigation and usage. These directories contain other directories and other files.

The role of the operating system

Abstraction of hardware

The fundamental operation of the operating system (OS) is to abstract the hardware to the programmer and user. The operating system provides generic
interfaces to services provided by the underlying hardware.
In a world without operating systems, every programmer would need to know the most intimate details of the underlying hardware to get anything to run.
Worse still, their programs would not run on other hardware, even if that hardware has only slight differences.

Multitasking

We expect modern computers to do many different things at once, and we need some way to arbitrate between all the different programs running on the
system. It is the operating systems job to allow this to happen seamlessly.
The operating system is responsible for resource management within the system. Many tasks will be competing for the resources of the system as it runs,
including processor time, memory, disk and user input. The job of the operating system is to arbitrate these resources to the multiple tasks and allow
them access in an orderly fashion. You have probably experienced when this fails as it usually ends up with your computer crashing (the famous "blue
screen of death" for example).

Standardised Interfaces

Programmers want to write programs that will run on as many different hardware platforms as possible. By having operating system support for
standardised interfaces, programmers can get this functionality.

Security

On multi-user systems, security is very important. As the arbitrator of access to the system the operating system is responsible for ensuring that only
those with the correct permissions can access resources.
For example if a file is owned by one user, another user should not be allowed to open and read it. However there also need to be mechanisms to share
that file safely between the users should they want it.
Operating systems are large and complex programs, and often security issues will be found. Often a virus or worm will take advantage of these bugs to
access resources it should not be allowed to, such as your files or network connection; to fight them you must install patches or updates provided by your
operating system vendor.

Performance

As the operating system provides so many services to the computer, its performance is critical. Many parts of the operating system run extremely
frequently, so even an overhead of just a few processor cycles can add up to a big decrease in overall system performance.

Multiprogramming Operating System

Multiprogramming is the fast switching of the CPU between several programs. A program is generally made up of several tasks. A task ends with some request to move data
which would require some I/O operations to be executed. Multitasking is commonly used to keep the CPU busy while the currently running program is doing I/O operations.
Compared to other executing instructions, I/O operations are extremely slow.

Advantages of Multiprogramming OS
Multiprogramming operating system has the following advantages:
o No CPU idle time
o Multiprogramming system can monitor fastest as entire tasks run in parallel.
o Shorter response time
UNIT 1

o Maximizes total job throughput of a computer


o Increases resource utilization

Disadvantages of Multiprogramming OS
Here are some disadvantages of multiprogramming operating system:
o Sometimes long time jobs have to wait a long time
o Tracking of all processes is sometimes difficult
o Requires CPU scheduling
o Requires efficient memory management
o No user interaction with any program during execution

Time-Sharing Operating System


Time-sharing is a technique that enables many people located at various terminals to use a particular computer system simultaneously. Time-Sharing is the logical extension of
multiprogramming. In this time-sharing Operating system, many processes are allocated with computer resources in respective time slots. In this, the processor's time is shared
with multiple users. That's why it is called a time-sharing operating system. It has a fixed time slice for the different processes. Its main purpose is interactive response time.
Features of Time-Sharing OS
Time-sharing OS provides the following features for users:
o Each user grabs dedicated time for all operations.
o Multiple online users can use the same computer at the same time.
o End-users feel that they monopolize the computer system.
o Better interaction between users and computers.
o User requests can make in small-time responses.
o It does not need longer have to wait for the last task to end to get processor.
o It can make quick processing with a lot of tasks.

Advantages of Time-Sharing OS
The time-sharing operating system has the following advantages:
o It provides a quick response
o Reduces CPU idle time
o All the tasks are given a specific time
o Less probability of duplication of software
o Improves response time
o Easy to use and user friendly

Disadvantages of Time-Sharing OS
Below are some disadvantages of the time-sharing operating system, such as:
o It consumes many resources
o Requires high specification of hardware
o It has a problem of reliability
o An issue with the security and integrity of user programs and data
o Probability of data communication problem

o Filesystem Directory
o A directory is a data structure that contains references to files and other directories. They are typically
organized in a hierarchical tree structure called a directory tree.
o Working Directory
o A working directory, also called a current directory, is the directory associated with the execution of a
process.
o File Attributes
o File attributes are a collection of metadata that determine how files behave, such as if they are hidden or
compressed.
o File Permissions
o File permissions determine which users and groups can read, write, and execute the file.

o
o File Control Block
o A file control block contains the metadata for a file, such as permissions and access times.
o Filesystem Layers
o The filesystem has multiple layers of abstraction: The applications, logical file system, File-organization
module, basic file system, IO control, and devices.

o
o File and Directory Operations
UNIT 1

o Both files and directories can be created, opened, read, written, deleted, closed, linked, unlinked, listed
and truncated. It is possible to move across directories as well as find files within directories.

Problem Solving Using Computer (Steps)

Computer based problem solving is a systematic process of designing, implementing and using

programming tools during the problem solving stage. This method enables the computer system to be

more intuitive with human logic than machine logic. Final outcome of this process is software tools

which is dedicated to solve the problem under consideration.

The following six steps must be followed to solve a problem using computer.
1. Problem Analysis
2. Program Design - Algorithm, Flowchart and Pseudocode
3. Coding
4. Compilation and Execution
5. Debugging and Testing
6. Program Documentation

Problem Analysis

Problem analysis is the process of defining a problem and decomposing overall system into smaller

parts to identify possible inputs, processes and outputs associated with the problem.

Program Design

The second stage in software development or problem solving using computer cycle is program

design. This stage consists of preparing algorithms, flowcharts and pseudocodes. Generally, this stage

intends to make the program more user friendly, feasible and optimized. Programmer just requires a

pen and pencil in this step in which the tasks are first converted into a structured layout without the

involvement of computer. In structured programming, a given task is divided into number of sub-tasks

which are termed as modules. Each process is further divided until no further divisions are required.

This process of dividing a program into modules and then into sub-modules is known as “top down”

design approach. Dividing a program into modules (functions) breaks down a given programming task

into small, independent and manageable tasks.


UNIT 1

Algorithms
An algorithm is an effective step-by-step procedure for solving a problem in a finite number of
steps. In other words, it is a finite set of well-defined instructions or step-by-step description of
the procedure written in human readable language for solving a given problem.
Flowchart:

Flowchart is basically a pictorial or diagrammatic representation of an algorithm using standard

symbols.

In other words, flowchart is a graphical representation that explains the sequence of operations to be

performed in order to solve a problem under consideration.

Coding:

Process of writing actual program takes place. A coded program is most popularly referred
to as a source code. The coding process can be done in any language (high level and low
level). The actual use of computer takes place in this stage in which the programmer writes
a sequence of instructions ready for execution. Coding is also known as programming.

Compilation and Execution Process

Generally coding is done in high level language or low level language (assembly language). For the

computer to understand these languages, they must be translated into machine level language. The

translation process is carried out by a compiler/interpreter (for high level language) or an assembler

(for assembly language program). The machine language code thus created can be saved and run

immediately or later on.

Debugging and Testing (Error and Types Included)

To understand debugging and testing more intuitively, lets first consider learning about different types

of error that occurs while programming.


UNIT 1

Debugging

Debugging is the process of finding errors and removing them from a computer program, otherwise

they will lead to failure of the program. Even after taking full care during program design and coding,

some errors may remain in the program and these errors appear during compilation or linking or

execution. Debugging is generally done by program developer.

Testing

Testing is performed to verify that whether the completed software package functions or works

according to the expectations defined by the requirements. Testing is generally performed by testing

team which repetitively executes program with intent to find error. After testing, list of errors and

related information is sent to program developer or developmen team.

You might also like