0% found this document useful (0 votes)
46 views11 pages

Chapter 4 Note

Uploaded by

valopls123
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)
46 views11 pages

Chapter 4 Note

Uploaded by

valopls123
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/ 11

Computer Science

Teacher: Maruf Ahmed


Chapter 4 (Software)

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.

General features of system software:


• set of programs to control and manage the operation of computer hardware
• provides a platform on which other software can run
• required to allow hardware and software to run without problems
• provides a human computer interface (HCI)
• controls the allocation and usage of hardware resources

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.

General features of application software:


• used to perform various applications (apps) on a computer
• allows a user to perform specific tasks using the computer’s resources
• may be a single program or a suite of programs
• user can execute the software as and when they require
• Examples include databases, word processing, spreadsheets, animation software, video editing
software etc.

Describe the difference between system software and application software.


• System software manages/maintains the hardware/software
• Applications software allows the user to perform tasks

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

Purposes of the operating system:


- It performs the basic functions of a computer
- To hide the complexities of the hardware from the user
- It manages the hardware
- It provides a platform to run software
- It provides a user interface
- It performs tasks such as memory management, file management, multitasking etc.

Explain why a personal computer (PC) needs an operating system (OS)


• The hardware is unusable without an OS // hides complexity of hardware from user
Page 1 of 11
• Acts as an interface / controls communications between user and hardware / hardware and software
• Provides software platform / environment on which other programs can be run

How does the computer load Operating System in RAM?


When a computer is first switched on, the basic input/output system (BIOS) – which is often stored on the
ROM chip – starts off a bootstrap program. The bootstrap program loads part of the operating system into
main memory (RAM) from the hard disk/SSD and initiates the start-up procedures.

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.

State the purpose of firmware:


• Permanently store instructions (in ROM)
• Stores instructions to boot up/start up the computer
• Provides the operating system with a platform to run on
• Controls/manages/allows communication with hardware
• Store instructions securely (to stop them being easily corrupted)

Examples of firmware:
• Bootstrap
• Bootloader
• BIOS
• Operating system (in embedded system)
• Programs (in embedded systems)

Functions provided by operating system:


• File management / Storage / Secondary storage management
o Storage space is divided into file allocation units
o Space is allocated to particular files
o Maintains / creates directory structures
o Specifies the logical method of file storage (e.g., FAT or NTFS)
o Provides file naming conventions
o Controls access // implements access rights // implements password protection // Makes file
sharing possible
o Specifies tasks that can be performed on a file (e.g., open, close, delete, copy, create, move
etc.)

• 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

• Provides Human computer interface (HCI)


o Allows a user to communicate with the hardware // vice-versa
o by making navigation around the system easier
o Provides facility for user inputting data
o Provides facility for outputting to the user
o By example e.g., command line / GUI / menu-driven

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

• Main memory / Memory Management


o Prevents two processes occupying the same memory space
o Organises memory e.g., paging/segmentation
o Makes uses of virtual memory
o Keeps track of allocated and free memory locations
o Allocates memory to processes
o Ensures fair use of memory
o Releases memory when a process finishes

• 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 a platform for running applications:


o allows application software to run on the computer
o The application software will be under the control of the operating system and will need to
access system software such as the device drivers while it is running
o Different parts of the operating system may need to be loaded in and out of RAM as the
software runs

• 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

• Manages user accounts:


o In a multi-user system, each person logging onto the computer will be given a user account
protected by a user name and password
o The operating system has to maintain accounts for several users

Human computer interface (HCI): GUI and CLI interfaces


Advantages of command line interface (CLI):
- the user is in direct communication with the computer
- the user is not restricted to a number of pre-determined options
- it is possible to alter computer configuration settings
Page 3 of 11
- uses a small amount of computer memory

Disadvantages of command line interface (CLI):


- the user needs to learn a number of commands to carry out basic operations
- all commands need to be typed in which takes time and can be errorprone
- each command must be typed in using the correct format, spelling, and so on

Advantages of graphical user interface (GUI):


- the user doesn’t need to learn any commands
- it is more user-friendly; icons are used to represent applications
- a pointing device (such as a mouse) is used to click on an icon to launch the application – this is
simpler than typing in commands or a touch screen can be used where applications are chosen by
simply touching the icon on the screen

Disadvantages of graphical user interface (GUI):


- this type of interface uses up considerably more computer memory than a CLI interface
- the user is limited to the icons provided on the screen
- needs an operating system, such as Windows, to operate, which uses up considerable memory

Who would use each type of interface?


CLI: a programmer, analyst or technician; basically, somebody who needs to have a direct communication
with a computer to develop new software, locate errors and remove them, initiate memory dumps (contents
of the computer memory at some moment in time), and so on
GUI: the end-user who doesn’t have or doesn’t need to have any great knowledge of how the computer
works; a person who uses the computer to run software or play games or stores/manipulates photographs, for
example.

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.

Interrupts can be caused by:


• a timing signal (Electrical pulses generated in the processor or in external devices in order to
synchronize computer operations)
• an input/output process (for example, a disk drive or printer requiring more data)
• a hardware fault (for example, a paper jam in the printer)
• user interaction (for example, the user presses a key (or keys) on a keyboard, such as
<CTRL><ALT><BREAK>, which causes the system to be interrupted)
• software errors that cause a problem (for example, an .exe file that cannot be found to initiate the
execution of a program, two processes trying to access the same memory location, or an attempt to
divide by zero).

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

Some examples of when an interrupt signal could be generated.


• peripheral is connected/disconnected
• A key on a keyboard is pressed
• A mouse button clicks
• A phone/video call is received
• A buffer requires more data
• A printer has a paper jam
• A printer runs out of paper
• A printer runs out of ink
• When switching from one application to another

How interrupt is serviced?


• Check for interrupt at start/end of a F-E cycle
• Priority is checked
• If lower priority than current process continues with F-E cycle
• If higher priority than current process then state of current process is / registers are stored on stack
• Location/type of interrupt identified
• Appropriate Interrupt Service Routine (ISR) is called to handle the interrupt
• When ISR resolves interrupt, check for further interrupts (of higher priority)
• Otherwise load data from stack and continue with next F-E cycle (of process)

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.

Purpose of utility software in a computer:


- To help users to set-up / configure / analyse / optimise / maintain the computer by for example,
making memory allocation more efficient, checking the system for faults etc.
Page 5 of 11
Computer users are provided with a number of utility programs that are part of the system software.
Utility programs offered by most computer system software include:
• defragmentation software
• disk contents analysis and repair
• file compression and file management
• back-up software
• virus checkers
• security
• screensavers

Different types of utility software are as follows:


• Back-up:
o Creates a copy of the contents of a disk / partition. Can be set up to automatically backup //
schedules backups
o Allows the user to decide what is backed up, e.g., all data // all files that have changed since
the last backup
o Allows the user to set up an off-site backup
o May encrypt the backup files
o Restores the data if necessary
• Defragmentation software:
o Re-organises the disk contents
o Moves split files so they are contiguous
o Creates a larger area of (contiguous) free space
o Improves disk access time
Why Defragmentation software is needed?
o because over time saving and deleting of small files fragments the disk
o the software makes (individual) files contiguous
o As a result, access time to the files is improved
o because head movement is reduced
• File Compression software:
o Reduces the file size by using algorithms to change the data which can be either lossy or
lossless
o To compress/decompress the contents of the disc, thus increasing capacity
Why File Compression software is needed?
o to reduce the size of files
o which saves storage and memory space
o and reduces transmission time
• (Hard) disk formatter:
o Sets up a disk so it is ready to store files / Initialise a disk for first use
o Reformat a previously used disk (erases contents of whole disk)
o Disk needs to be checked for errors
o Partition a hard drive
o Disk surface divided into tracks and sectors
o A new file system needs to be generated on the disk
o Tracks and sectors checked to ensure correct format / identifies bad sector
o The file allocation table needs to be set up
Why disk formatter is needed?
o to prepare a disk for use // set up the file system
o to partition the disc
o to delete all the data from the disc
• Virus checker:
o Scans files stored on a computer system for malicious code
o Scans files when they enter the system / memory stick inserted / download etc.
Page 6 of 11
o Sets up a schedule for virus-checking
o Isolates / quarantines / deletes viruses
o Regularly updates the virus definitions
• Disk contents analysis / Disk repair software:
o Checks for any errors / inconsistencies / bad sectors on the disk
o Resolves any errors on the disk
o Retrieves files / data from a damaged disk // re-constructs directory
o Recovers disc when data corrupt
o Marks bad sectors on the disk // marks bad sectors as unusable
Why Disk contents analysis / Disk repair software is needed?
o to identify and mark bad sectors
o to restore corrupted files
o to recover lost data (due to hardware failure)
• Security:
o manages access control and user accounts (using user IDs and passwords)
o links into other utility software, such as virus checkers and spyware checkers
o protects network interfaces (for example, through the use of firewalls)
o uses encryption and decryption to ensure any intercepted data is meaningless without a
decryption key
o oversees the updating of software (does the update request come from a legitimate source, for
example)
• Screensavers:
o Screensavers are programs that supply moving and still images on the monitor screen after a
period of inactivity by the computer

Types of programming languages


- High Level Language
- Low Level Language

High Level Language:


- High-level languages enable a programmer to focus on the problem to be solved and require no
knowledge of the hardware and instruction set of the computer that will use the program.
- High-level programming languages are portable and can be used on different types of computers.

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

Low-level language (assembly language):


• gain knowledge of how a computer works
• can directly manipulate the hardware
• more control over how registers (etc.) are accessed
• can access registers (etc.) directly
• less space in primary memory needed so program will be more memory efficient
• performs a task very quickly / Quicker to execute
• can use specialised hardware

Scenario based question:


Suggest some disadvantages to the programmer of using a high-level language instead of a low-level
language.
• not able to directly manipulate the hardware
• needs to wait for translation before running
• program may be less efficient

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

How the compiler translates the computer program


• It translates the high-level language to low-level language/object code/machine code
• It translates all the code before it is executed
• It creates an executable file

How the compiler reports errors.


• If there is any error while compilation, it creates an error report and displays all errors in the code
that require correction before execution can take place
Interpreter

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

Give similarities between a compiler and an interpreter.


• They both translate high-level language into machine code
• They both check for errors
• They both report errors

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

Differences between compilers and interpreters:

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

The advantages and disadvantages of interpreters and compilers:


Advantages of Interpreter:
- easier and quicker to debug and test programs during development
- easier to edit programs during development

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.

Integrated Development Environment (IDE)


- Software that provides useful functions for a programmer writing a computer program
- Specific programming languages have their own IDEs or one can download a third-party IDE

IDEs usually have the following features:


• Source Code editors:
o allows a program to be written and edited without the need to use a separate text editor
o these speeds up the program development process, as editing can be done without changing
to a different piece of software each time the program needs correcting or adding to

• 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

• Initial error detection features:


o Context-sensitive prompt: Displays predictions of the code being entered / Suggest the code
to add // automatically complete statements
o Dynamic syntax check: Underlines or highlights statements that do not meet the rules of the
language // Highlight / underline / colour syntax errors as the code is entered
o Auto-completion: automatically adds closing statements / Code editors can offer context-
sensitive prompts with text completion for variable names and reserved words.
o Auto-correction: Changes spelling mistakes to reduce syntax errors / finds possible errors as
the program code is being typed, alerts the programmer at the time and provides a suggested
correction.

• Testing / debugging features:


o Breakpoint: To stop the code at a specific line to check the current progress / values
o Single stepping: allows the programmer to execute the program one line at a time // Run the
code one line at a time so that the effects of each statement can be seen
o Report window: Outputs the contents of variables and data structures

Page 11 of 11

You might also like