You are on page 1of 18

Part 1

 Computer systems and sub-systems


• Top-down design
• Structure diagrams
• Flowcharts
• Pseudocode
• Library routines
• Sub-routines

 Algorithms
 Test data
 Validation and verification
 Using trace tables
 Identifying and correcting errors
 Producing algorithms
 In order to build a computer system that performs a specific task or
solves a given problem, the task or problem has to be clearly
defined, showing what is going to be computed and how it is going
to be computed.

 This lecture introduces the tools and techniques that are used to
design a software solution that together with the associated
computer hardware will form a computer system.
 A COMPUTER SYSTEM is made up of software, data, hardware,
communications and people; each computer system can be divided
up into a set of sub-systems.

 Each subsystem can be further divided into sub-systems and so on


until each sub-system just performs a single action.
 Computer systems can be very large or very small or any size in
between; most people interact with many different computer
systems during their daily life without realizing it.

 For example, when you wake up in the morning you may use an app
on your smart phone for your alarm, you may then check the
weather forecast on your computer before you drive to school. The
alarm program is a very small computer system; when you check the
weather forecast you obtain information from one of the largest
computer systems in the world.
 In order to understand how a computer system is built up and how it
works, it is often divided up into sub-systems. This division can be
shown using top-down design to produce structure diagrams that
demonstrate the modular construction of the system.

 Each sub-system can be developed by a programmer as sub-routine


or an existing library routine may be already available for use. How
each sub-routine works can be shown by using flowcharts or
pseudocode.
 TOP-DOWN DESIGN is the breaking down of a computer system into
a set of subsystems, then breaking each sub-system down into a set
of smaller sub-systems, until each sub-system just performs a
single action.

 This is an effective way of designing a computer system to provide a


solution to a problem, since each part of the problem is broken
down into smaller more manageable problems.
 The process of breaking down into smaller sub-systems is called
‘stepwise refinement’. This structured approach works for the
development of both large and small computer systems.

 When large computer systems are being developed this means that
several programmers can work independently to develop and test
different subsystems for the same system at the same time. This
reduces the development and testing time.

Stepwise refinement
Stepwise refinement is the process of developing a modular design by splitting
a problem into smaller sub-tasks, which themselves are repeatedly split into
even smaller sub-tasks until each is just one element of the final program.
 In order to show top-down design in a diagrammatic form, structure
diagrams can be used. The STRUCTURE DIAGRAM shows the design
of a computer system in a hierarchical way, with each level giving a
more detailed breakdown of the system into sub-systems.

 A structure diagram is a pictorial representation of a modular


system.
 Consider the alarm app computer system for a smart phone. This
could be divided into three sub-systems, setting the alarm, checking
for the alarm time, sounding the alarm.

 These sub-systems could then be further sub-divided; the structure


diagram makes the process clearer.
 What is an Algorithm?

An algorithm is a sequence of steps, which perform a specific task. In


computing, algorithms are usually represented as a program flowchart,
or in pseudocode.

 What is a program flowchart?

A program flowchart is a pictorial representation of an algorithm.


Program flowcharts consist of special symbols.
 Have a look at a flowchart for the checking-for-the-alarm-time
sub-system
 PSEUDOCODE is a simple method of showing an algorithm, using
English-like words and mathematical operators that are set out to
look like a program.

 It is a simplified form of programming code that uses common


programming terminologies, but does not use the strict syntax rules
of a programming language.

 Have a look at the pseudocode for the checking-for-the-alarm-time


algorithm.
 A LIBRARY ROUTINE is a set of programming instructions for a given
task that is already available for use.

 It is pre-tested and usually performs a task that is frequently


required.

 For example, the task ‘get time’ in the checking-for-the-alarm-time


algorithm would probably be readily available as a library routine.
 A SUB-ROUTINE is a set of programming instructions for a given
task that forms a subsystem, not the whole system.

 Sub-routines written in high-level programming languages are


called ‘procedures’ or ‘functions’ depending on how they are used.

You might also like