0% found this document useful (0 votes)
33 views5 pages

Y9 - Chapter 4 Software

software notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

Y9 - Chapter 4 Software

software notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

COMPUTER SCIENCE 2210

CHAPTER 4 – SOFTWARE

4.1 Types of software and interrupts

System Software
 System software provides the services that the computer requires, including operating
system and utility software.

Operating System
 A system software running in the background of the computer system
 The operating system is run on the firmware.
 Example: Linux, Windows, Android, iOS, DOS

Functions of Operating System

Managing files Managing memory Managing user accounts


Handling interrupts Managing multitasking Managing peripherals and drivers
Providing an interface Providing system security Providing a platform for running applications

Firmware
 Firmware is defined as a computer program that is hard-coded into the hard drive and
contains its basic operational storage programming.
 Another way to think of it is that firmware is a software middleman that allows your
hardware to talk to software

Application Software
 Application software provides the services that the user requires.
 Applications are run on the operating system.

Interrupts
 An Interrupt can be defined as a signal that is sent by software or device to the processor.
 When an interrupt is received by a processor; the processor pauses whatever it was doing
and handles the interrupt.
 The interrupt can be received by the processor in many situations, few examples are given
below:
o When a disk drive is ready to receive more data.
o When an error has occurred e.g. printer paper jam.
o When the user wants to break the current process
 When the processor has received the interrupt it either stops the current process or handles
the program or device that generated the interrupt or it continues to do its current process.
 The main function of interrupts is to allow the system to perform multiple tasks at a time or to
open multiple windows simultaneously.
 Software interrupts include division by zero and two processes trying to access the same
memory location.
 Hardware interrupts include pressing a key on the keyboard and moving the mouse.

4.2 Types of programming language, translators and integrated development environments (IDEs)

High-level language

 A high-level language is a language that enables a programmer to tell the computer the
specific order of task by focusing on the problem itself.
 High-level languages consist of familiar English words as result programmers can read, write
and understand programs easily.
Prepared by: msy pg. 1
 Example:
o Python, PHP, ECMAScript, Ruby, Delphi, Java, C#

Python programming

Output

Advantages of high-level language


 read and understand as the language used is closer to human language
 write in a shorter time
 debug at the development stage
 maintain once in use

Low-level language
 Low-level languages relate to the specific architecture and hardware of a particular type
of computer.
 Low-level languages can refer to machine code, the binary instructions that a computer
understands, or an assembly language that needs to be translated into machine code.

Assembly language
 A low-level language that requires translation into machine code before it can be used
by a computer.
 Uses mnemonic codes (Pattern of letters to represent something, like short-form)
 Example:

 In order to understand this program the programmer needs to know that


o LDA means load the value of the variable into the accumulator
o ADD means add the value of another variable to the value stored in the
accumulator
o STO means replace the value of the variable by the value stored in the
accumulator.

Advantages of assembly language


 to make use of special hardware
 to make use of special machine-dependent instructions
 to write code that doesn't take up much space in primary memory
 to write code that performs a task very quickly

Machine Code
 Machine code is difficult to understand by programmers
 Therefore, programmers to not write code in machine code generally
Prepared by: msy pg. 2
 As it is difficult to manage storage and data manipulation
 Following is an example of a machine code instruction for adding two numbers in hex and
binary:

Translators
 Programs are written in languages that are easily understandable by the programmers
(humans).
 However, for the computer system to understand and perform the set of instructions given
in the programs, the programs need to be translated into machine code or binary
instructions.
 It is difficult for humans to work with binary but the computer system only understands it.
 Therefore, a translator is used to translate the programs into binary before the computer
can use it.

Three types of translators

1. Compiler
 Compiler translates the whole code at once before executing it, producing an
executable file.
 Provides an error report for the whole code if errors are detected.
 Compilers are translators that are used to translate HLL (High-Level Languages) into the
machine code.
 Once instructions written in HLL are compiled into the machine code; it can be directly
used by the computer system again and again without the need for recompilation.

2. Interpreter
 Translates and executes the code line-by-line.
 An interpreter stops execution when an error is found.
 That is, it reads a statement from the program and translates it and performs the
instructions.
 Once done, it moves to the next statement, translates, performs, and so on.

3. Assembler
 An AS.SEMBLER is a computer program that translates a program written in an assembly
language into machine code so that it can be directly used by a computer to perform
a required task.

Prepared by: msy pg. 3


Summary of three types of translators

Advantage of Compiler rather than Interpreter


 Less memory is used during running the program because it does not put the
compiler in the memory.
 Program does not need to recompile every time it is run.
 Program executes faster as statements are not re-translated every time it runs.
 Interpreters execute program loops slower than compiler.

Disadvantage of Compiler rather than Interpreter


 Compiler most likely to crash since machine code runs directly on the processor.
 More memory is used during compilation because both machine code and high-level
language is stored in it.
 Error takes longer to find as code needs to be edited and recompiled after every error.
 Program takes longer to develop because program is restarted when error is found
instead of continuing the program where the error stopped.

What happens when things go wrong in programming?


 A programmer may make a mistake when writing a program and it can cause error.
 Two types of error
1. Syntax error
- An error when a program statement does not obey the rules of a programming
language.
- Program cannot be translated if it contain syntax error
- When compiler found syntax error:
 No translated program is produced
 Error is added to a list of errors that is produced after compiling
 Programmer fix the error and recompile everything from beginning
 Repeat until program can be successfully compile without error
- When interpreter found syntax error:
 Programmer is alerted where the error is found if it fails to interpret the
specific statement.
 Programmers fix the error and then the interpreter will continue to next
statement (without needing to interpret everything from beginning).
 Repeat until next error is found or it finishes interpreting the whole
program.
Prepared by: msy pg. 4
2. Logic error
- An error when a program does not do what the programmer wants it to do.
- Logic error can only be found when program is run.

Integrated Development Environment (IDE)


 A program that includes a source code editor, compiler, interpreter and debugger in one.
 Most high-level programming languages offer the use of an IDE for program development.
This contains an editor with an interpreter and/or compiler together with debugging tools,
which can improve the speed of program development.
 Including:
o Code editors
o Run-time environment
o Translators
o Error diagnostics
o Auto-completion
o Auto-correction

Python IDE

Prepared by: msy pg. 5

You might also like