6
Software
Ch.6: Software Eng. Omar El Safty
1. Examples of Software
Software programs can be System software or Application software.
1.1 Application Software
Definition and Purpose:
Programs that provide the services that the user requires to perform tasks.
Examples:
• Spreadsheet
• Word Processor
• Database
• Web browser
• Image-editor
• Game
1.2 System Software
Definition and Purpose:
Programs that provide the services that the computer requires to manage/maintain the
hardware.
Examples:
• Operating System
• Utility software
• Compiler / Interpreter / Assembler
75
Ch.6: Software Eng. Omar El Safty
1.2.1 Operating System
Definition and Main Purpose:
A piece of system software that performs many basic tasks and allows the user to
communicate with the computer hardware.
Functions:
• Providing a platform for running applications
• Memory management
• Managing peripherals and drivers
• Manage multitasking
• Handling interrupts
• Provides an interface
• Provides system security
• Manages user accounts
• Managing Files
Provides a platform for running applications:
• Allows software applications to run on the computer
Tasks of operating system related to managing memory:
• Managing the movement of data to and from RAM
• Manage the transfer of pages between virtual memory and RAM
• Allows multitasking
• Checks that processes have enough memory allocated to them
• Makes sure that two processes don’t try to access the same memory location
Tasks of operating system related to managing peripherals:
• Transmits data to hardware
• Receives data from hardware
• Allocates data to buffers
76
Ch.6: Software Eng. Omar El Safty
Tasks of operating system related to multitasking:
• Gives the process a priority
• Allocates resources for each process for a specific time limit
• Interrupts the running process when it exceeds its time limit
Tasks of operating system related handling interrupts:
• Gives the interrupt a priority
• Includes the Interrupt Service Routine (ISR)
• … which is a piece of software that contains the code that handles the interrupts
Provide a user interface:
• Allows the user to interact with the computer
• Examples: GUI (Graphical User Interface) and CLI (Command Line Interface)
Tasks of operating system related to providing security:
• Carries out operating system updates when they become available
• Ensures anti-virus is always up-to-date
• Communicates with the firewall
• Helps prevent hacking
• Offers the ability for the recovery of data when it has been lost/corrupted
Tasks of operating system related to managing user accounts:
• Allows the user to customize their screen layout
• Uses separate folders and files to allow users to manage them
Tasks of operating system related to managing files:
• Create/Copy/Open/Close/Delete/Rename/Save a file
77
Ch.6: Software Eng. Omar El Safty
1.2.2 Utility software
Definition:
A program that performs a specific task required for the operation of a computer system.
Examples of utility programs include:
• Antivirus
• Disk repair
• Backup software
• Screensaver
2. Firmware
Definition:
A piece of software that runs directly on the hardware.
Purpose:
• Controls/Allows communication with hardware
• Stores instructions to boot up/start up the computer
• Provides the operating system with a platform to run on
Examples of firmware:
• Bootloader/Bootstrap
- Software that is responsible for loading the operating system into the RAM
• BIOS (Basic Input/Output System)
- Carries out a hardware check to find out if all the devices are present and
whether they are functional
How hardware, firmware and an operating system are required to run applications
software:
• Application software runs on the operating system
• The operating system runs on the firmware
• The firmware runs on the hardware
78
Ch.6: Software Eng. Omar El Safty
3. Types of programming languages
3.1 High-level language
Definition and features:
• A type of programming language that is close to human language
• Machine-independent (a portable language)
• One line of high-level language code can perform several low level-language
operations
• It has built-in functions which save time when writing a program
Example of code written in high-level language:
for (int i = 0; i < 5; i++) {
cout << i << "\n";
}
IMPORTANT
High-level language code must be translated to machine code to be
executed by the computer.
3.2 Low-level language
Definition and features:
• A type of programming language that is close to the native language of
the computer
• Machine-dependent (code is specific to the type of computer)
• Allows direct manipulation of memory
• Allows for use of specialized hardware
For example: assembly language and machine code
79
Ch.6: Software Eng. Omar El Safty
3.2.1 Machine Code
Definition:
The binary instructions that a computer understands and executes directly.
Example of code written in machine code:
10101101
11001110
10110111
3.2.2 Assembly Language
Definition and features:
• A form of low-level language that uses mnemonics
• An assembler is needed to translate an assembly language program into machine code
Example of mnemonic code written in assembly language:
INP
STA X
INP
ADD X
Advantages of writing code in high-level language compared to low-level language:
• Closer to human language..
- .. so faster to write code
- .. so, the programmer is less likely to make mistakes while writing the code
• Easier to debug..
- ..so programmers can find and correct errors in less time
• Machine independent // Portable ..
- .. so the program can be used on any computer without a need for
understanding of the hardware
• One line of code can carry out multiple commands..
- .. so the code is more compact
• It has built-in functions ..
- .. so faster to write code
80
Ch.6: Software Eng. Omar El Safty
Advantages of writing code in low-level language compared to high-level language:
• Allows direct manipulation of memory
• Code executes faster
• Code requires less memory
• Allows for use of specialized hardware
4. Instruction Set
Definition:
A list of all machine code commands that can be processed by a CPU.
Purpose:
• Used to define the commands that can be carried out by the CPU
• Used by the control unit to decode instructions during processing
IMPORTANT
Instruction set is not a programming language.
81
Ch.6: Software Eng. Omar El Safty
5. Language translators
Definition and purpose:
Software used to convert programming language code to machine code to be executed by
the computer.
Type Description Full steps
1 The whole source code is checked before
translation
2 An error report is produced after trying to
A program that translates a high-
compile with all errors found in the
level language code to machine
Compiler code require correction before
code
execution can take place
3 After fixing all the errors, the code is
translated all at once
4 An executable file is then produced
1 Interpreter translates one line of code and
A program that translates a high- then executes it before moving on to the
level language code to machine next line
Interpreter
code 2 Interpreter stops when an error is found
3 After fixing the error, the program can
continue running from the same position
1 The whole source code is checked before
translation
A program that translates a low- 2 An error report is produced with all errors
level language code to machine found in the code require correction
Assembler
code before execution can take place
3 After fixing all the errors, the code is
translated all at once
4 An executable file is then produced
Watch a video about the difference between compilers and interpreters:
82
Ch.6: Software Eng. Omar El Safty
How the compiler translates the computer program:
1 It translates the high-level language to low-level language/machine code
2 It translates all the code before it is executed
3 It creates an executable file
How the compiler reports errors:
1 It creates an error report after trying to compile
2 … displaying all errors in the code
3 … that require correction before execution can take place
IMPORTANT
When using a compiler, the code will not run at all if there are errors
Advantages of compiling a code compared to using an interpreter:
• Produces executable file..
- .. this creates a smaller file size
- .. so the compiler is no longer needed to run the code
• Program will be machine-independent/portable
- .. this means it can be used on any hardware
• Code is not re-translated every time the program is used..
- .. this means it will execute faster
• The code cannot be accessed/viewed.
- .. therefore, code cannot be stolen
Disadvantages of compiling a code:
• Changes to the code will require the code to be recompiled, which makes programs
take longer time to develop
• Comments in the code are not visible, making it more difficult to debug the code
How the interpreter translates the computer program:
1 Interpreter translates one line of code..
2 ..and then executes it..
3 ..before moving on to the next line
83
Ch.6: Software Eng. Omar El Safty
How the interpreter reports errors:
1 Interpreter stops when an error is found
2 After the programmer fixes the error..
3 .. the program can continue running from the same position
Advantages of interpreting a code:
• Easier to debug a program ..
- .. as errors are immediately reported when detected
• Easier to understand and modify the source code
Disadvantages of interpreting a code:
• Interpreted code tends to run slower than compiled code ..
- ..as the interpreter is needed each time the program is executed
• Code can be stolen as source code can be accessed
IMPORTANT
- Interpreter is best used when writing a program
- Compiler is best used after completion and when distributing
the program
6. IDE (Integrated Development Environment)
Definition:
Software that provides useful functions for a programmer writing a computer program.
Common functions of IDE:
• Code Editor
• Run-time environment
• Translator (Compiler / Interpreter)
• Error Diagnostics
• Auto-completion
• Auto-correction
• Prettyprint (Syntax highlighting)
KEY TERMS
Syntax – The structure of language statements in a computer program.
84