Chapter 4 Note
Chapter 4 Note
Software:
- A set of instructions, data or programs used to operate computers and execute specific tasks.
- There are two types of software. They are System software and Application software.
System software:
- System software provides the services that the computer requires
- For examples: operating system, device drivers, utilities, linkers, compilers, interpreters, assemblers
etc.
Application software:
- Application software provides the services that the user requires
- For example, word processing, web browser, video-editing software, Control and measuring
software etc.
Operating system:
- The operating system (OS) is essentially software running in the background of a computer system
- It manages the computer's memory and processes, as well as all of its software and hardware
- It also allows us to communicate with the computer without knowing how to speak the computer's
language
Firmware: Firmware refers to software that has been permanently installed in a machine, device, or
microchip, usually by the manufacturer. Without it, the electronic device will not work. Unlike standard
software, firmware is meant to control, operate, or maintain the hardware in the background, and not interact
with human users. The BIOS is an example of firmware. Firmware is defined as a program that provides
low level control for devices. A personal computer (PC) needs firmware to load the operating system and
make sure everything is ready for use.
Examples of firmware:
• Bootstrap
• Bootloader
• BIOS
• Operating system (in embedded system)
• Programs (in embedded systems)
• Handles interrupts:
o The operating system needs to identify the interrupt type and also establish the level of
interrupt priority.
o The operating system will have interrupt service routines (ISRs) (or interrupt handlers)
designed to process each interrupt
Page 2 of 11
• Peripheral / input/output device / hardware management
o Installs device drivers to allow communication between peripherals and computer
o Sends data and receives data to and from peripherals such as to an output device and from an
input device
o Handles buffers for transfer of data to ensure smooth transfer between devices that transmit
and receive at different speeds
o Manages interrupts / signals from the device
o Control of hardware usage by processes
o Device detection
o Power management
o Keep track of device status whether free or busy
• Manages multitasking: Multitasking allows computers to carry out more than one task (i.e., a
process) at a time
o the operating system needs to constantly monitor the status of each of the processes under its
control
o Each of the processes will share the hardware resources under the control of the operating
system software
o resources are allocated to a process for a specific time limit
o the process can be interrupted while it is running
o the process is given a priority so it can have resources according to its priority
• Provides system security: the function of security management is to ensure the integrity,
confidentiality and availability of data. This can be achieved by:
o carrying out operating system updates as and when they become available
o ensuring that anti-virus software (and other security software) is always up to date
o by maintaining access rights for all users
Consider the role of the printer management when printing out a document:
• first of all, the printer driver is located and loaded into memory
• then the data is sent to a printer buffer ready for printing
• if the printer is busy then the data is sent to a printer queue before it can be sent to the printer buffer
• it will send various control commands to the printer throughout the printing process
• it receives and handles error messages and interrupts from the printer
Peripheral: The term peripheral device refers to all hardware components that are attached to a computer
and are controlled by the computer system, but they are not the core components of the computer, such as
the CPU, power supply unit, memory unit etc. That means all the input, output and storage devices are
peripherals.
Interrupt:
- An interrupt is a signal sent from a device or from software to the processor.
- This will cause the processor to temporarily stop what it is doing and service the interrupt.
Page 4 of 11
Why interrupts are needed?
• To indicate that something requires the attention of the processor
• Used to attend to certain tasks/issues
• Used to make sure that vital tasks are dealt with immediately
• It enables multi-tasking to be carried out on a computer
Device drivers:
- Device drivers are system software that communicate with the operating system and translate data
into a format understood by a hardware peripheral device.
- As soon as a device is plugged into the USB port of a computer, the operating system looks for the
appropriate driver
- Without device drivers, a hardware device would be unable to work with a computer – a message
such as ‘device not recognised’ would appear on the screen.
- Examples of drivers include: printers, memory sticks, mouse, CD drivers, and so on.
Buffers:
- Buffers are used in computers as a temporary memory area within the RAM.
- These are essential in modern computers since hardware devices operate at much slower speeds than
the processor.
- If it wasn’t for buffers, processors 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.
Utility software
Utility software is a type of system software. Utility software is software designed to help analyze,
configure, optimize or maintain a computer. It is used to support the computer infrastructure - in contrast to
application software, which is aimed at directly performing tasks that benefit ordinary users.
Low-level languages:
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 assembly
language that needs to be translated into machine code.
• Close to the language processed by computers
• May use mnemonics
• An example is assembly language/machine code
Assembly language:
- is known as the mnemonic of Machine language.
- It uses some symbols for example, LDD, ADD, STO etc. which has meaning in particular computer
architecture.
- There is a one-to-one relationship between machine language and assembly language which means
that one assembly language instruction is represented as one machine language instruction. However,
assembly language instructions need to be translated into machine language to get executed.
Programs can be written using high-level or low-level languages. Some features of each method:
High-level language:
• no need to understand registers/computer architecture
Page 7 of 11
• instructions nearer to human language/English so easier to read/write/understand
• It is easier / quicker to debug
• The program is machine independent / portable
• Easier for programmer to read/write/understand/edit therefore, the programmer is less likely to make
mistakes
• easier to maintain once in use
Translators
- a computer program that converts the programming instructions written in High Level Language or
Assembly Language into machine language codes that the computers understand and process.
- A program must be translated into binary / machine language before a computer can use it
- Types of translators: Compiler, Interpreter and Assembler
- There are two different types of translators for high level language. They are: Interpreter and
Compiler. There is one type of translator for Assembly language and that is Assembler.
Compiler
• Translates a program written in high-level language into machine code
• Translates the whole program before attempting to run it
• Creates an executable file/object code if there are no errors
• Generates a report of all the errors
• The compiler is not required to run the program
• The program can be distributed without the source code
• A compiler produces code that executes faster than the equivalent for an interpreter
• One high-level language translated into several machine code instructions
• Used for general use after development is done
Page 8 of 11
• Converts high level language code into machine code
• Translates and runs one line at a time
• Stops when an error occurs
• Allows errors to be corrected in real time // errors can be corrected and translation continued from
that point
• No executable file of machine code produced
• One high-level language program statement may require several machine code instructions to be
executed
• Cannot be used without interpreter as the source code needs to be present all the time
• Used when program is being developed
Assembler
• Translates a program written in Assembly language code into machine code
• Translates the whole program before attempting to run it
• Creates an executable file/object code if there are no errors
• Generates a report of all the errors
• The assembler is not required to run the program
• The program can be distributed without the source code
• One assembly language code is translated into one machine language code
• One low-level language translated into one machine code instructions
Explain the reasons why the programmer uses an interpreter while writing the program code.
• Programmer can test sections of the code without every part working / being written
• Programmer can debug in real time so that errors can be fixed and the program continued from that
point
• The effect of any changes made by the programmer can be seen immediately
• To avoid dependent errors
Explain the reasons why the programmer uses a compiler when the program has been written.
• The compiler produces an executable file so the user cannot access / edit / sell the code and users do
not need the translator to run the program
• The program can be compiled for different hardware specifications and then used to generate more
income for the programmer
• The program can be tested multiple times without having to retranslate each time
Compiler Interpreter
translates whole code in one go translates and executes each statement one by one
translates source code into executable file of object no executable file of machine code is produced
code/machine code
produces error list at end of compilation only finds errors as each instruction executed
compiled programs can be used without the compiler Interpreted programs cannot be used without the
interpreter
A compiled program is usually distributed for An interpreter is often used when a program is
general use being developed
a compiler needs to retranslate the code each time An interpreter allows correction of errors in real-
after errors are found and corrected time
Page 9 of 11
a compiler will not execute any code if there are An interpreter will execute the code until it finds an
errors present error
difficult to edit/debug easier to edit/debug
Disadvantages of Interpreter:
- programs cannot be run without the interpreter
- programs can take longer to execute
Advantages of Compiler:
- a compiled program can be stored ready for use
- a compiled program can be executed without the compiler
- a compiled program takes up less space in memory when it is executed
- a compiled program is executed in a shorter time
Disadvantages of Compiler:
- it takes a longer time to write, test and debug programs during development
Linkers: A linker is a computer program that takes one or more object file produced by a compiler or
assembler and combines them into a single executable file which can be run on a computer. For example,
many programming languages allow programmers to write different pieces of code, called modules,
separately. This simplifies the programming task since it allows the program to be broken up into small,
more manageable sub-tasks. However, at some point, it will be necessary to put all the modules together to
form the final program. This is the job of the linker.
• Translator:
o usually provide a translator, this can be a compiler and/or an interpreter, to enable the
program to be executed
• Run-time environment:
o A runtime environment is where the program will be executed
• Error diagnostics:
o describes the error
o gives line number of error
• Auto-documenter:
o may automatically create documentation about the code as it is being written, including what
variables, arrays and subroutines are used for
o explains the function and purpose of programming code
Page 10 of 11
• Presentation features:
o Pretty print: Colours key words in different colours and lay out the program in a meaningful
way
o Auto-indentation: Moves the code to the correct location
o Collapse/expand modules: Allows you to hide / expand sections of code to make it easier to
read the code you are focused on
Page 11 of 11