Cs - Unit 1 Notes Software
Cs - Unit 1 Notes Software
Computer Languages
A program is a set of instructions that tells a computer what to do in order to come up with a
solution to a particular problem. Programs are written using a programming language.
A programming language is a formal language designed to communicate instructions to a
computer.
Over the years, computer languages have been evolved from Low-Level to High-Level
Languages. In the earliest days of computers, only Binary Language was used to write
programs. The computer languages are classified as follows:
Low-Level language is the only language which can be understood by the computer. Low-level
language is also known as Machine Language. The machine language contains only two
symbols 1 & 0. All the instructions of machine language are written in the form of binary
numbers 1's & 0's. A computer can directly understand the machine language and it does not
need to be translated.
Technically speaking, this is the only language computer hardware understands. However,
binary notation is very difficult for humans to understand. This is where assembly languages
come in.
Middle-level language is a computer language in which the instructions are created using
symbols such as letters, digits and special characters. Assembly language is an example of
middle-level language. In assembly language, we use predefined words called mnemonics.
Binary code instructions in low-level language are replaced with mnemonics and operands in
middle-level language. But the computer cannot understand mnemonics, so we use a
translator called Assembler to translate mnemonics into machine language.
Assembler is a translator which takes assembly code as input and produces machine code as
output. That means, the computer cannot understand middle-level language, so it needs to
be translated into a low-level language to make it understandable by the computer.
Assembler is used to translate middle-level assembly language into low-level language.
High-level language is a computer language which can be understood by the users. A high-
level language is a programming language that uses English and mathematical symbols, like
+, -, % and many others, in its instructions and has a set of grammar rules that are used to
make instructions more easily. Every high-level language has a set of predefined words known
as Keywords and a set of rules known as Syntax to create instructions. The high-level language
is easier to understand for the users but the computer cannot understand it. High-level
language needs to be converted into the low-level language to make it understandable by the
computer. We use Compiler or interpreter to convert high-level language to low-level
language.
Languages like FORTRAN,C, C++, JAVA, Python, etc., are examples of high-level languages.
Translators
The most general term for a software code converting tool is “translator.” A translator, in
software programming terms, is a generic term that could refer to a compiler, assembler, or
interpreter; anything that converts higher level code into another high-level code (e.g.,
Basic, C++, Fortran, Java) or lower-level (i.e., a language that the processor can understand),
such as assembly language or machine code.
1. Assembler
The Assembler is used to translate the program written in Assembly language
into machine code. The source program is an input of an assembler that contains
assembly language instructions. The output generated by the assembler is the
object code or machine code understandable by the computer.
2. Compiler
The language processor that reads the complete source program written in high-
level language as a whole in one go and translates it into an equivalent program
in machine language is called a Compiler. Example: C, C++, C#, Java.
In a compiler, the source code is translated to object code successfully if it is free
of errors. The compiler specifies the errors at the end of the compilation with
line numbers when there are any errors in the source code. The errors must be
removed before the compiler can successfully recompile the source code again
3. Interpreter :
The translation of a single statement of the source program into machine code is
done by a language processor and executes immediately before moving on to the
next line is called an interpreter. If there is an error in the statement, the
interpreter terminates its translating process at that statement and displays an
error message. The interpreter moves on to the next line for execution only after
the removal of the error. An Interpreter directly executes instructions written in
a programming or scripting language without previously converting them to an
object code or machine code.
Example: Perl, Python and Matlab.
System Software and programming techniques
Compiler Interpreter
The compiler takes a large amount of time to An interpreter takes less amount of
analyze the entire source code but the overall time to analyze the source code but
execution time of the program is comparatively the overall execution time of the
faster. program is slower.
The compiler generates the error message only Its Debugging is easier as it continues
after scanning the whole program, so translating the program until the error
debugging is comparatively hard as the error is met.
can be present anywhere in the program.
The compiler requires a lot of memory for It requires less memory than a
generating object codes. compiler because no object code is
generated.
For Security purpose compiler is more useful. The interpreter is a little vulnerable in
case of security.
SOFTWARE
Software is a set of instructions, programs which enable the computer to perform specified
task. OR
Software is a set of instructions or mechanism which provides to the computer system, by
this mechanism user interacted with the system.
Computer software is divided in to two broad categories: system software and application
software.
System Software and programming techniques
SYSTEM SOFTWARE: consists of programs that controls and manage the hardware resources
of a computer and perform required information processing tasks System software consists
of programs that assist the computer in the efficient control, support, development and
execution of application programs. The system software controls the execution of the
application software and provides other support functions such as data storage. The purposes
of system software are:
hardware, manages all of the devices connected to the computer, allows data to be saved to
and retrieved from storage devices, and allows other programs to run on the computer
Between the user and the computer hardware, an operating system serves as a
communication bridge (interface). An operating system’s objective is to provide a platform
for a user to run programs in an efficient and convenient manner.
Functions of Operating Systems
1. Memory Management
The operating system is in charge of managing the primary memory, often known as
the main memory. The main memory consists of a vast array of bytes or words, each
of which is allocated an address. Main memory is rapid storage that the CPU can
access directly. A program must first be loaded into the main memory before it can
be executed. For memory management, the OS performs the following tasks:
The OS keeps track of primary memory – meaning, which user program can
use which bytes of memory, memory addresses that have already been
assigned, as well as memory addresses yet to be used.
The OS determines the order in which processes would be permitted memory
access and for how long in multiprogramming.
It allocates memory to the process when the process asks for it and
deallocates memory when the process exits or performs an I/O activity.
2. Process Management
The operating system determines which processes have access to the processor and
how much processing time every process has in a multiprogramming environment.
Process scheduling is the name for this feature of the operating system. For
processor management, the OS performs the following tasks:
3. Device Management
A file system is divided into directories to make navigation and usage more efficient.
Other directories and files may be found in these directories. The file management
tasks performed by an operating system are: it keeps track of where data is kept,
user access settings, and the state of each file, among other things. The file system is
the name given to all of these features.
4. Security
To safeguard user data, the operating system employs password protection and
other related measures. It also protects programs and user data from illegal access
System Software and programming techniques
Utility program A utility program performs a specialized task that enhances the computer’s
operation or safeguards data. Examples of utility programs are virus scanners, file
compression programs, and data backup programs.
Device drivers: software that enables the communication between hardware and OS.
Questions
What is a program?
What fundamental set of programs control the internal operations of the computer’s
hardware?
System Software and programming techniques
What do you call a program that performs a specialized task, such as a virus scanner, a file
compression program, or a data backup program?
Word processing programs, spreadsheet programs, email programs, web browsers, and game
programs belong to what category of software?