Software (CH#4)
Software (CH#4)
Software
It refers to a set of Computer Programs, Procedures and associated documents describing the programs,
and how they are to be used. Software acts as the bridge between the user and the hardware. So,
without software hardware is useless. There are two types of Software i.e. System Software &
Application Software
Hierarchy Of Software’s
Operating System
Utility Software
Device Driver
Virus Checker
Defragmenter
Disk repair
A small program that replicates
Defragmentation software tides up
itself and can delete or modify Disk repair software verifies if an
the hard disk drive as it begins to
important files. Antivirus software error has been found in the desk
reach its maximum capacity. A disk
looks for malware ‘clues’ or directory; it will then attempt to
defragmenter works by rearranging
recognises it from a database of correct the error if possible. The
blocks of data (by removing space
known viruses. Virus checkers run in repair process will remove or
left from the earlier deletion of data)
the background and need to be bypass damaged/corrupted data/
So that they can now become
regularly updated. They make use disk sectors and then link blocks
Contiguous (rather than randomly
of heuristic checking (this looks for of data together to allow files to
stored across various sectors). This
software behaviour that could be read (some data may be lost in
frees up disk space and also makes
indicate a possible virus). Once an the process).
location of data a faster process.
infected files is discovered it is
quarantined and then deleted
File compression can either be lossy Back-up files are essential in case
or lossless. With lossy file Utility Programs files/data become corrupted or
compression, the original file lost and are needed to recover the
cannot be reconstructed following Software tools that allow data. They are either done
the compression process. With the user and computer to automatically or initiated by the
lossless file compression, the specific tasks to maintain user. Many OS offer the ability to
original file can once again be the computer restore a computer status to a
reconstructed. Lossy file sizes are point in the past using backed up
much smaller than lossless files. data
Device drivers
Most computers store the operating system on a hard disk drive (HDD) or solid state drive (SSD) since
they tend to be very large programs. Mobile phones and tablets store the operating system on a solid
state device since they are too small to accommodate an HDD.
Security Management
Security management ensures the integrity, confidentiality and availability of data.
File Management
File management maintains file directories and file naming conventions. It can perform file maintenance
tasks such as open, close, delete, rename, copy and so on. File management also ensures access rights
are maintained as part of security and correct memory allocation of the data when it is read from the
HDD/SSD and saved temporarily in RAM.
Multitasking
Multitasking allows a computer to carry out more than one task simultaneously. To allow this to happen,
the OS needs to constantly monitor the status of each process by ensuring:
A CLI requires a user to type in instructions in order to choose options from menus, open software, etc.
There are often a number of commands that need to be typed in, for example, to save or load a file. The
user has to therefore learn a number of commands just to carry out basic operations. It is also slow
having to key in these commands every time an operation has to be carried out. However, the advantage
of CLI is that the user is in direct communication with the computer and is not restricted to a number of
pre-determined options.
A GUI allows the user to interact with a computer (or MP3 players, gaming devices, mobile phone, etc)
using pictures or symbols (icons) rather than having to type in a number of commands.
More recently, devices such as mobile phones and tablets increasingly use touch screens and use post-
WIMP interactions. With this system, fingers are in contact with the screen allowing actions such as
pinching and rotating, which would be difficult to do using a single pointer and a device such as a mouse.
OR
A signal sent to a processor which may cause a break in execution of the current routine according to
priorities
OR
Interrupt
An interrupt is a signal sent from a device or software (or it can be an internal signal) to the
microprocessor. This will cause cause the microprocessor to temporarily stop what is doing so it can
service the interrupt. Causes of interrupts include those shown below.
Cause Of Interrupt
Interrupts allow computers to carry out many tasks or to have several windows open at the same time
An example would be downloading a file from the internet at the same time as listening to some music
from the computer library. Whenever an interrupt is serviced, the status of the current task being run is
saved. This is done using an INTERRUPT HANDLER and once the interrupt has been fully serviced, the
status of the interrupted task is reinstated and it continues from the point prior to the interrupt being
sent
Buffers
BUFFERS are used in computers as a temporary memory area.
These are essential in modern computers since hardware devices operate at much slower speeds than
the processor.
If it wasn’t for buffers, processor would spend the majority of their time idle, waiting for the hardware
device to complete its operation. Buffers are essentially filled from the processor or memory unit and
whilst these are emptied to the hardware device, the processor carries on with other tasks. Buffer are
used, for example, when streaming a video from the internet. This ensures that the video playback
doesn’t keep on stopping to wait for data from the internet.
Program
A computer program is a set of instructions to perform a certain task.
OR
Programs are our way of telling a computer what to do. How to do it and when to do it. This enables a
single computer to perform many different types of task
A Program can be written in High Level Language (Java, Python, C-Language, C# and Basic etc)
A program can also be written in Low Level Language (Assembly Language and Machine codes)
It is a portable language
OR
Assembly language is the first step to improve the programming structure and make machine language
more readable by humans.
Mnemonics
“Mnemonics is a instruction code used in assembly language”
Assembly language assigns mnemonics code to sets of machine code to make them more
understandable.
ADD means add the value of another variable to the value stored in the accumulator
In Low Level Language each line of code will perform only one task.
The following code is an example of a simple addition program in assembly language with a command
and its explanation on the right (after #)
ADD ONE #adds the second input to the number stored in ONE
Code editor Allows a program to be written and edited without the need to use a separate
text editor, speeding up the program development process
Allows a programme to step through the the program a line at a time (single stepping)
Runtime and
debugger Allows a programmer to set a breakpoints
A report window shows the contents of variables and expressions, which allows the
programmer to check for logic errors in the program
Features
Error Finds possible errors as the program code is being typed
diagnostics
Auto- Context-sensitive prompts with text completion for variable names and
completion reserved
OR
Features Of Compiler
Translate a whole High Level Language Program into machine code in one go
Once translated the compiler does not need to be present for the program to run
Produces an executable file of machine code
Once High Level Language statement can be translated into several machine code instructions
Once a program is compiled, there is no need for recompilation
An executable program is usually distributed for general use
Generates an error report at the end of translation of the whole program
Provides error diagnostics
An executable file is produced
The program will not run at all if an error is detected
Optimize the source code (to run efficiently)
Benefits Of Compiler
1. Produces executable file
This creates a smaller file size
More saleable
2. Program will be machine independent / portable
It can be used on any hardware
3. No need for compiler to run executable file
It will be quicker to run
Customers can just execute the program
4. Source code cannot be accessed
Therefore, code cannot be stolen / plagiarised
OR
An interpreter executes a program written in a High Level Language in one line at a time.
Features Of Interpreter
Translates High Level Language to Low Level Language
Executes one line at a time
Translates source code line by line
Runs error diagnostic
Produces error messages to tell user location of error
Stops execution when encounters errors
Continues translating when an error is fixed
Assembler
A program which converts assembly language into machine code is called assembler
OR
A program which translates Low Level Language into machine code is called assembler
Features Of Assembler
Translates of Low Level Language into machine code
Produces an executable file of machine code
One Low Level Language statement is usually translated into one machine code instruction
Once a program is assembled, there is no need for reassembly
An assembled program is usually distributed for general use
Syntax
The structure of language statements in a computer program is called Syntax
Syntax Error
“A word Syntax means rules and regulations of writing a program in a language”
“A syntax error occurs when a user (or programmer) has put words in an order that a program does
not understand”
Since computer programs must follow strict syntax to compile correctly, any aspects of the code that do
not confirm to the syntax of the programming language will produce a Syntax error
Logical Error
“A logic error (or logical error) is a mistake in a program’s source code that results is incorrect or
unexpected behaviour”
OR
“In computer programming, a logic error is a bug in a program that causes it to operate incorrectly, but
not to terminate abnormally (or crash)”
It is a type of runtime error that may simply produce the wrong output or may cause a program to crash
while running
Filename.exe
Bug
In computer technology, a bug is a “Coding Error” in a computer program
Debugging
The process of finding bugs (errors) before program users do is called Debugging
OR
OR
OR
Object code is a set of instructions codes that is understood by a computer at the lowest
hardware level
Q10. Five statements about interpreters and compilers are shown in the table below.
Q9. (a) Five statements about interpreters and compilers are shown in the table below.
(b) State why a compiler or an interpreter is needed when running a high-level program on a computer.
........................................................................................................................................................................
........................................................................................................................................................................
....................................................................................................................................................................[1]
(c) Give one benefit of writing a program in a high-level language.
........................................................................................................................................................................
........................................................................................................................................................................
....................................................................................................................................................................[1]
(d) Give one benefit of writing a program in a low-level language.
........................................................................................................................................................................
........................................................................................................................................................................
....................................................................................................................................................................[1]
A: 1 0 1 0 1 1 0 1
11001110
10110111
B: LDA X
INC X
STA Y
C: FOR x ← 1 TO 10
READ n
ENDFOR
Identify, using the letters A, B or C, which of the above codes is an example of assembly code, high-level
language code or machine code:
Q1. Complete the following by writing either compiler, interpreter or assembler in the spaces provided.
an error. [3]
Q1. (a) Give two reasons why a programmer would choose to write code in a low-level language.
1 .....................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
2 .....................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [2]
1 …………….......................................................................................................................................................
2 .....................................................................................................................................................................
3 .....................................................................................................................................................................
4 ................................................................................................................................................................ [4]
Q6. High-level or low-level languages can be used when writing a computer program.
State two advantages of using a high-level language and two advantages of using a low-level language.
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [4]
Draw lines to indicate which descriptions refer to a compiler and which descriptions refer to an
interpreter.
(c) Describe how your answer to part (b) translates this program.
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [3]
Q7. Translators, such as a compiler and an interpreter, are used when writing and running computer
programs. Describe how a compiler and an interpreter translates a computer program.
Compiler..........................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
Interpreter .....................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [6]
He needs to send just the machine code for the program to his friend, electronically.
Identify which translator will be most suitable for Dimitri to use. Explain your choice.
Q6. (a) Many programmers write computer programs in high-level languages. The programs need to be
translated into machine code to be read by the computer.
Translator 1 ……………………..............................................................................................................................
Translator 2 ............................................................................................................................................... [2]
Reason 1 .........................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
Reason 2 .........................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [4]
Q7. David is writing a program using a high-level language. The program will be published and sold for
profit.
Feature 1 ........................................................................................................................................................
........................................................................................................................................................................
Feature 2 ........................................................................................................................................................
........................................................................................................................................................................
Feature 3 ........................................................................................................................................................
....................................................................................................................................................................[3]
Benefit 1 .........................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
Benefit 2 .........................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [4]
(c) David needs to send a large section of the programming code as an email attachment.
Q7. Annie writes a paragraph of text as an answer to an examination question about programming
languages.
Using the list given, complete Annie’s answer by inserting the correct six missing terms. Not all terms will
be used.
Assembly
Converter
Denary
Hexadecimal
High-level language
Low-level language
Machine Code
Source Code
Syntax
Translator
Feature 1 ........................................................................................................................................................
Feature 2 ........................................................................................................................................................
Feature 3 ................................................................................................................................................... [3]
Example 1 .......................................................................................................................................................
Example 2 ................................................................................................................................................. [2]
(c) Give one drawback of writing programs in a low-level language, instead of a high-level language.
........................................................................................................................................................................
................................................................................................................................................................... [1]
Q2. Both an interpreter and a compiler can be used when writing a program in a high-level language.
(a) Explain why a programmer would make use of both an interpreter and a compiler.
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [4]
(b) Give three reasons why a programmer would choose to write a program in a high-level language,
instead of a low-level language.
Reason 1 .........................................................................................................................................................
........................................................................................................................................................................
Reason 2 .........................................................................................................................................................
........................................................................................................................................................................
Reason 3 .........................................................................................................................................................
....................................................................................................................................................................[3]
Leonard connects his printer to his computer using the USB port.
(i) Give two examples of when a printer would generate an interrupt signal.
Example 1 .......................................................................................................................................................
Example 2 ................................................................................................................................................. [2]
Identify the software in the computer that will receive and manage all interrupt signals.
................................................................................................................................................................... [1]
Q6. A programmer can use translators, such as an interpreter and a compiler, when developing a
computer program.
Difference 1 ....................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
Difference 2 ....................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [4]
An interrupt is generated to inform the Central Processing Unit (CPU) that the application has been
opened.
(a) Give three other examples of when an interrupt signal could be generated.
1 ……………………..............................................................................................................................................
2 ....................................................................................................................................................................
3 ................................................................................................................................................................ [3]
(a) One similarity between a compiler and an interpreter is that they both translate high-level language
into machine code.
(c) The mobile phone has a USB port to allow a USB connection to a computer.
(ii) One benefit of a USB connection is that the cable can only be inserted into the port one way, so an
incorrect connection cannot be made.
Give three other benefits of using a USB connection to connect a mobile phone to a computer.
Benefit 1 .........................................................................................................................................................
........................................................................................................................................................................
Benefit 2 ........................................................................................................................................................
........................................................................................................................................................................
Benefit 3 .........................................................................................................................................................
....................................................................................................................................................................[3]
(d) When a user is reading a text on the mobile phone, they may also get a telephone call on the mobile
phone. An interrupt signal is generated that results in an output to inform the user that a person is
calling them.
Describe how the interrupt signal is processed to inform the user that a person is calling them.
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
................................................................................................................................................................... [4]