Download Standard Grade Computing Studies Unit 13 – Computer Systems

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Standard Grade Computing Studies
Unit 13 – Computer Systems
Name: . . . . . . . . . . . . . . . . .
Class: . . .
Bishopbriggs Academy
Contents:
Sys 1 – Computer Hardware
The structure of a modern computer system
The Central Processing Unit
The Main Memory
Interfaces
Common Peripherals
Sys 2 – Low Level Machine
Software Storage in main memory
Storing positive whole numbers as binary
Storing text as binary
Storing black and white graphics as binary
Storing database records in main memory
Storing programs in main memory
Sys 3 – Operating Systems
The purpose of an Operating System
Types of Operating Systems
Tasks carried out by an Operating system
Sys 4 –Systems Software
High Level Programming Languages
Portability of software
Types of translator
Interpreters compared to Compilers
End of Unit Questions
2
Bishopbriggs Academy - Standard Grade Computing Studies
3
3
5
6
8
9
12
12
13
16
19
21
25
27
27
29
30
36
36
37
38
39
41
Sys 1 – Computer Hardware
In this chapter you will learn about
•
•
•
•
•
The structure of a modern computer system
The main components of a CPU
About the types of memory – RAM and ROM
Main memory size
Commonly used input output and backing stores
The Structure of a modern computer system
You learned in the first booklet ‘Introduction to Systems’ that a
computer system could be represented as four blocks like this:
Input Device
Processor
&
Memory
Output Device
Backing Store
This model applies equally to the different types of
computer – palmtop, laptop, desktop and mainframe.
The first booklet described the different Input Devices,
Output Devices and Backing Stores in common use today.
This booklet will concentrate on the central block in the
diagram above containing the Processor and the Memory.
Unit 13 – Computer Systems
3
This diagram can be re-drawn to show more detail of the
central block like this:
Input
Devices
Central
Processing
Unit
ROM
RAM
Interfaces
Backing
Stores
Output
Devices
Address Bus
Data Bus
The central block is made up of four parts:
The Central Processing Unit (CPU) – which fetches and
executes the instructions that make up the programs.
ROM – Read Only Memory – permanent memory
whose contents cannot be changed nor lost when the power
is switched off.
RAM – Random Access Memory – memory whose
contents can be changed but which are lost when the power
is switched off.
Interfaces – used to match the signals going to and from
the input, output and backing storage devices to the
processor.
These four parts are connected together through bundles of
wires called the Address Bus and the Data Bus.
4
Bishopbriggs Academy - Standard Grade Computing Studies
The Central Processing Unit (CPU)
There are many makes and types of CPUs, but they all share
the same three basic components:
Arithmetic
Logic
Unit
(ALU)
Registers
Control
Unit
Data
Bus
Address
Bus
The Arithmetic/Logic Unit is the part where calculations
(Arithmetic) are performed on data and decisions are made
by comparing data (Logic).
Registers are storage locations inside the processor. The
number of registers varies with the CPU. Some CPUs have
only 8 while others have hundreds. Instructions are stored
in registers while the Control Unit is executing them.
Data is stored while it is being used in calculations and for
making decisions by the ALU.
The Control Unit fetches and executes the program
instructions and controls all movement of data inside and
outside of the CPU.
Unit 13 – Computer Systems
5
The Main Memory
Before a program can be run it must be stored in the main
memory. This is known as the ‘stored program
concept’.
Main memory made up of two types – ROM and RAM.
ROM – Read Only Memory – The instructions and data
in ROM are set when the chip is made. The contents are
permanent and therefore cannot be altered.
Every computer contains at least a small amount of
memory stored as ROM- if only to restart the computer
after it has been switched off. (RAM cannot be used to
restart a computer as once switched off its contents are
erased!)
The programs for embedded computers (like those
found in cars, MP3 players, etc) are usually stored in ROM
so they are ready as soon as the device is switched on.
RAM – Random Access Memory – The contents of
RAM are empty until data is stored – but the contents are
lost when power is switched off. RAM is often described as
‘volatile’ memory.
Most of the total memory in palmtop, laptop, desktop and
mainframe computers is made up of RAM. In these types of
computers, the programs and data are stored in RAM.
Every location in main memory is identified by a
unique address. To fetch data, the CPU puts this unique
address on the Address Bus and the data travels from main
memory to the CPU through the Data Bus. To store data,
the CPU puts the address on the Address Bus and the data
travels from the CPU to the main memory location with
that unique address.
6
Bishopbriggs Academy - Standard Grade Computing Studies
The amount of data that is transferred at one time along the
Data Bus is called the Word size.
Modern computers use either a 32 bit word or a 64 bit word
– that is each address is the location of 4 bytes (32 bits) or 8
bytes (64 bits)
The bigger the Word size the more powerful the CPU
Measuring Main Memory
The smallest piece of memory is called a bit.
Bit is short for ‘binary digit’ – a ‘1’ or a ‘0’.
8 bits
=
1 byte
1024 bytes
=
1 kilobyte or KB
1024 KB
=
1 megabyte or MB
1024 MB
=
1 gigabyte or GB
1024 GB
=
1 terabyte or TB
Modern desktop computers will have at least 256 MB of
memory – though they will work a lot better with more than
this!
Main memory is bought in modules of 256 MB, 512 MB or
1 GB. These are plugged into the memory connectors on
the computer motherboard to increase the size of the main
memory. (Note: you must buy the correct type of memory
for your computer – not all are the same!)
Unit 13 – Computer Systems
7
Interfaces
Input Devices, Output Devices and Backing Stores are
referred to as peripherals.
Different peripherals work at different speeds from the CPU
or memory. Some operate with different voltages from the
CPU and memory, others use different types of signals –
like analogue instead of digital.
All peripherals are connected to the CPU and memory
through an interface.
The purpose of an interface is to alter the different signals
from the peripherals to make them suitable to be used by
the CPU or to be stored in main memory – and vice versa.
To save money and to give buyers greater choice,
manufacturers have agreed to choose from the same set of
interfaces for peripherals when they design new computers
– these are called ‘standard interfaces’. For example:
USB – Universal Serial Bus – to connect printers, scanners,
digital still cameras – i.e. – relatively slow devices.
USB2 – High Speed USB – to connect external hard disks,
video cameras – i.e. – relatively high speed devices. (Also
works with the slower USB devices.)
Firewire (IEEE1394) – also for high speed devices.
High Density VGA - to connect analogue monitors.
(Monitors that use a CRT or Cathode Ray Tube)
DVI (Digital video Interface) to connect digital monitors
(Monitors that use a TFT or Thin Film Transistor flat screen
display.)
8
Bishopbriggs Academy - Standard Grade Computing Studies
Common Peripherals
The following Peripherals were described in the first
booklet – ‘Introduction to Systems’. Make sure you know
what each one is and what it is used for.
Input Device
Output Device
Backing Store
Mouse
Laser printer
Magnetic tape
Trackball
Ink jet printer
Floppy disk
Trackpad
Plotter
Hard disk
Graphics tablet
Liquid Crystal
Display (LCD)
Touch sensitive
Thin Film
screen
Transistor Display
(TFT)
Keyboard
Cathode Ray tube
display (CRT)
Joystick
Loudspeakers and
sound card
Scanner
Virtual Reality
headset
Digital still camera Graphics card
Digital video
camera
Web Cam
CD-ROM
DVD-ROM
CD-recordable
(CD-R)
CD –rewriteable
(CD-RW)
DVD – recordable
(DVD-R)
DVD – rewriteable
(DVD-RW)
USB Flash Drive
Microphone and
sound card
Unit 13 – Computer Systems
9
Homework / Written Exercise 1
1.
What does CPU stand for?
2.
What is the purpose of the CPU?
3.
What is main memory made up of?
4.
What does ROM stand for?
5.
What are two characteristics of ROM?
6.
What does RAM stand for?
7.
What are two characteristics of RAM?
8.
What is an interface used for?
9.
How are the parts of a computer connected together?
10. (Credit) Name the three main parts inside a CPU.
11.
(Credit) describe the purpose of each of these main parts
inside the CPU.
12.
What is the ‘stored program concept’?
13.
Why do all computers need at least a small amount of
ROM?
14.
What is an embedded computer?
15.
Why does an embedded computer use ROM?
16.
What is RAM used for in desktop or laptop computers?
17.
(Credit) How does the CPU tell one piece of memory
from another?
10
Bishopbriggs Academy - Standard Grade Computing Studies
18. (Credit) What is meant by the Word size of a computer?
19.
(Credit) How does Word size affect the performance of a
computer?
20. Complete this table:
Memory
A ‘0’ or a ‘1’
Equivalent
1 byte
1024 bytes
1 megabyte
1024 megabytes
1 terabyte
21.
What is a peripheral?
22. Name three input devices.
23. Name three output devices.
24. Name three backing stores.
25. (Credit) What is meant by sequential access?
26. (Credit) Name a backing store that uses sequential
access.
27. (Credit) What is meant by direct access?
28. (Credit) Name a backing store that uses direct access.
29. (Credit) What is meant by multi-access?
30. (Credit) Which type of computer is designed to use
multi-access?
Unit 13 – Computer Systems
11
Sys 2 – Low Level Machine
In this chapter you will learn about:
• Using the main memory to store :
o positive whole numbers
o text
o bit-mapped images
o a database record
• program instructions
o machine code
Software Storage in Main Memory.
You learned in chapter 1 that the smallest unit of main
memory is a bit and that it can only hold a ‘0’ or a ‘1’.
This means that all software – programs and data - are stored
as ‘1’s and ‘0’s. A system based on only two digits, ‘1’ and ‘0’, is
called a binary system.
All software – programs and data are stored in the main
memory of the computer as binary.
After we type in a number or a sentence or draw a simple
picture on the screen, the data we entered is converted into
binary to store it in the computer’s main memory.
Similarly, when data in main memory has to be displayed it
has to be converted back from binary into text, numbers or
pictures.
In addition, all of the instructions that make up a program
must be converted into binary for storage and it is the binary
instructions that are used when the program runs.
This chapter will look at how software is stored in binary.
12
Bishopbriggs Academy - Standard Grade Computing Studies
Storing positive whole numbers as binary
We are used to working with numbers that use 10 different
digits – 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 - the decimal system.
A decimal number must be converted into binary to store it in
the computer’s main memory.
For example to convert the decimal number 37 to binary:
Write down this sequence of numbers:
128 64
32
16
8
4
2
1
By adding combinations of these numbers together you can
make any decimal number up from 1 to 255 by only using
each number once.)
Decide which numbers are needed to make up our number 37
and write a ‘1’ underneath it like this:
128 64
32
1
16
8
4
1
2
1
1
That is 37 = 32 + 4 + 1
Write a ‘0’ under each of the other numbers
128 64
0
0
32
1
16
0
8
0
4
1
2
0
1
1
That is it!
37 in binary = 00100101
Unit 13 – Computer Systems
13
Converting binary numbers into decimal numbers.
To convert a binary number back to decimal you just reverse
the process!
For example to convert the binary number 01101010 to
decimal you would do this:
If the binary number has less than 8 digits then add 0s to the
front of the number to make it up to 8 digits long.
Write down the same sequence of numbers
128 64
32
16
8
4
2
1
Beneath this write down the binary number you want to
convert:
128 64
0
1
32
1
16
0
8
1
4
0
2
1
1
0
This means that the decimal number is made up of:
64 + 32 + 8 + 2 = 106
Simple!
Note: negative numbers and real numbers (ones with a
decimal point) are a little harder to deal with so they are left to
Higher Computing.
In order to store larger numbers, most modern software uses
4 bytes to store each number.
14
Bishopbriggs Academy - Standard Grade Computing Studies
Homework / Written Exercise 2a
1.
How many digits are there in the decimal number
system?
2.
How many digits are there in the binary number system?
3.
What must happen to a decimal number before it con be
stored in a computer’s main memory?
4.
Convert the following numbers from decimal to binary.
5.
a)
13
b)
29
c)
92
d)
115
Convert the following numbers from binary to decimal
a)
1011
b)
101011
c)
11101110
d)
10101
Unit 13 – Computer Systems
15
Storing text as binary
To convert text into binary, the processor takes each character
of the text as it is entered and looks up a table of binary
numbers to find the number to store.
This binary number is then stored in its memory, usually one
character number to a single byte.
The table of numbers that is most often used is called the
American Standard Code for Information Interchange or
ASCII.
Below is the table of ASCII codes used.
Binary Nº Character
00100000 a space
00100001
!
00100010
"
00100011
#
00100100
$
00100101
%
00100110
&
00100111
`
00101000
(
00101001
)
00101010
*
00101011
+
00101100
,
00101101
00101110
.
00101111
/
00110000
0
00110001
1
00110010
2
00110011
3
00110100
4
00110101
5
00110110
6
00110111
7
00111000
8
00111001
9
00111010
:
00111011
;
00111100
<
00111101
=
00111110
>
00111111
?
16
Binary Nº Character Binary Nº Character
01000000
@
01100000
`
01000001
A
01100001
a
01000010
B
01100010
b
01000011
C
01100011
c
01000100
D
01100100
d
01000101
E
01100101
e
01000110
F
01100110
f
01000111
G
01100111
g
01001000
H
01101000
h
01001001
I
01101001
i
01001010
J
01101010
j
01001011
K
01101011
k
01001100
L
01101100
l
01001101
M
01101101
m
01001110
N
01101110
n
01001111
O
01101111
o
01010000
P
01110000
p
01010001
Q
01110001
q
01010010
R
01110010
r
01010011
S
01110011
s
01010100
T
01110100
t
01010101
U
01110101
u
01010110
V
01110110
v
01010111
W
01110111
w
01011000
X
01111000
x
01011001
Y
01111001
y
01011010
Z
01111010
z
01011011
[
01111011
{
01011100
\
01111100
|
01011101
]
01111101
}
01011110
^
01111110
–
01011111
_
01111111
~
Bishopbriggs Academy - Standard Grade Computing Studies
Such a table is called a character set. It lists all of the
characters the computer will use.
(Note: You don’t have to remember this table!)
You may have noticed that only 96 codes have been used.
The ASCII code actually defines 128 codes.
The missing 32 codes are called control codes or nonprinting codes. These are used for such things as…
return;
line feed;
page feed or clear screen;
move the cursor up a line;
move the cursor left one character;
move the cursor right one character;
move the cursor down a line.
Control characters can all be accessed by using the ‘ctrl’ key on
the keyboard, for example ctrl - M is the same as pressing the
‘return’ key.
Notice that the ASCII code is very useful for exchanging data
- provided you use English. It was never designed for any
other language.
Notice also, that the eighth bit in the code is always 0, so only
128 codes are actually defined.
Computer manufacturers have taken advantage of this fact
and used all 256 of the codes.
The 128 extra codes are used for storing characters that
foreign languages might use such as å; ç; é; !; ß; etc., or
symbols £, ©; ¥ etc.
Unit 13 – Computer Systems
17
These extra codes are not fixed, so every manufacturer uses
them for different characters.
Every group of these 256 characters is called its character
set. There are thousands of such character sets, each one
different from the others.
The ‘Alt’ key is used to access these. However, you must know
which combination of keys produces which characters. This
becomes very confusing because the combination is different
for every character set used!
256 codes are not really enough, so the major manufacturers
have developed a single, super set of characters called
‘Unicode’, which includes most current written languages
and most often used graphic characters (up to 65,536
characters!). Two bytes are used to store each character when
Unicode is used.
Homework / Written Exercise 2b
1.
How is each character in a text message stored in a
computer’s main memory?
2. What does ASCII stand for?
3. Use the table to write your first name in ASCII.
4. What other use is made of ASCII?
5. Give two examples of non-printing codes.
6. What is the disadvantage of ASCII?
7.
What is Unicode?
8. What is the disadvantage of Unicode over ASCII?
18
Bishopbriggs Academy - Standard Grade Computing Studies
Storing black and white bit-mapped graphics
You learned that the picture you see on the computer screen is
made up of ‘pixels’ or picture elements. These pixels are
also represented inside the computer as binary numbers.
In a simple ‘black and white’ display, each pixel is represented
by one bit:
a ‘1’ turns the pixel white
a ‘0’ turns the pixel black
A special section of memory called the ‘screen’ memory or
‘video’ memory holds the pattern of 1’s and 0’s that make up
the picture.
For example:
This part of the screen
memory holds
and you see on
the monitor
000000000000000000000000000
001000111000110001110011110
010100100101001001001010000
011100111001000001001011000
010100100101001001001010000
010100111000110001110011110
000000000000000000000000000
Graphics or pictures are also represented this way, for
example:
This part of the screen
memory holds
and you see on
the monitor
111111111111111111111111111
111111111110011111111111111
111111111111011111111111111
111111111100000111111111111
111111111100100111111111111
111111111100000111111111111
111100000000000000000000111
111000100010001000100010011
111100000000000000000000111
111111111111111111111111111
Unit 13 – Computer Systems
19
It should be obvious that the bigger the image, the greater the
amount of memory needed to store it.
To find out how much memory a graphic image will use you
need to know the size of the image in pixels.
For example the original Apple Macintosh computer used a
black and white screen that was 640 pixels across and 480
pixels high.
So the screen used 640 x 480 pixels.
Each pixel needed 1 bit
So the memory needed was 640 x 480 x 1 bits
= 307,200 bits
divide by 8 to get bytes
= 307,200/8 bytes
= 38,400 bytes
divide by 1024 to get KB = 38,400/1024 KB
Total memory needed
= 37.5 KB
Calculating how much memory is needed to store a colour
image is dealt with in Higher Computing.
Homework / Written Exercise 2c
1.
How are black and white images stored in a computer’s
main memory?
2.
(Credit) How much memory is needed to store an image
32 x 32 pixels?
3.
(Credit) How much memory is needed to store an image
128 x 96 pixels?
20
Bishopbriggs Academy - Standard Grade Computing Studies
Storing flat-file database records
Each record in a flat-file database is made up of fields.
These fields can be of different types, for example:
Text
Number
Date
Graphic
Calculated
The contents of each of these types of fields must be turned
into binary to be stored in the computer’s main memory.
Text fields
Each character in a text field must be converted to its ASCII
binary number and stored character per byte.
However this would take too long to work out in a large
database so we use a ‘worst case scenario’ where we assume
that every text field would be the longest likely to be found.
For example allow 15 bytes for a first name
15 bytes for a last name
30 bytes for a street name
12 bytes for a telephone number
Number fields
Each number is converted to its binary equivalent.
Allow 4 bytes for each number field.
Date fields
Allow 8 bytes to hold a date (2 day, 2 month, 4 year)
Unit 13 – Computer Systems
21
Graphic fields
Calculate the size of the graphic by multiplying the number of
horizontal pixels by the number of vertical pixels (width x
height). That is the size in bits. Divide this by 8 to get the size
in bytes.
Calculated fields
If the calculation returns a number then treat it as a number
field and allow 4 bytes for the answer – do not calculate the
size of the formula – it is not stored in the record.
If the calculation returns text like “Pass” or “Fail” then treat
the answer like a text field and estimate the maximum number
of characters that needs to be stored.
Record size
Once an estimate has been made for size of each field that
makes up a record then the size of one record is found by
simply adding up the sizes of each field in the record to get a
total.
File size
To calculate the size of a file you must first know the size of
one record and the number of records that will be stored.
File size = size of one record x number of records
This answer will be in bytes so divide by 1024 to get kilobytes
and if necessary again by 1024 to get megabytes.
22
Bishopbriggs Academy - Standard Grade Computing Studies
Example:
This is an example of one record from a second-hand car sales
database.
Make:
Model:
First reg.
Price £:
Car Tax £:
Total £
Mercedes-Benz
A-class SE
1/4/2004
7,600
136
7,736
You must now estimate the size of each field:
Draw up a table – it makes it easier.
Field Name
Make
Model
First reg.
Price £
Car Tax £
Total £
Picture
Type
Text
Text
Date
Number
Number
Calculated number
Graphic
Record size =
Size
15
15
8
4
4
4
200 x 120 = 24000 bits
= 24000/8 byte
= 3000 bytes
3050 bytes
If the garage stores 200 cars in its database then the file size
would be:
= size of one record x number of records
= 3050 x 200 bytes
= 610,000 bytes
= 610,000/1024 KB
= 595.7 KB
Unit 13 – Computer Systems
23
Homework / Written Exercise 2d
1.
(Credit) Calculate the storage requirements of the
following database records:
a)
Address Book
Field Name
Title
First name
Last name
Street
Town
Post Code
Date of Birth
Telephone Number
Field Type
Field Size
Total =
b)
If the above Address book file contains 56 entries,
how big is the file?
c)
Class Record
Field Name
Field Type
First name
Last name
Class
150 x 100 photograph
Graphics test
Database test
Word Processing test
Spreadsheet test
Average
Field Size
Total =
d)
24
If the above class Record file contains 120 entries,
how big is the file?
Bishopbriggs Academy - Standard Grade Computing Studies
Storing Programs in main memory
Not only is all data stored in the computer’s main memory as
binary, but the programs must be stored as binary as well.
Fortunately the Central Processing Unit (CPU) can only
deal with very simple instructions such as:
• LOAD data from the memory to the processor
• ADD the next byte in memory to the byte held in
the processor
• STORE the result back in memory.
However, processors do not actually understand ‘human’
commands like LOAD and STORE. All the processor
understands are patterns of bits (1s and 0s)
for example:
10010111 might mean LOAD
10011001 might mean ADD
10011010 might mean STORE.
This pattern of bits that the processor understands as
instructions is called its machine code.
Unfortunately, every make and model of processor
understands different patterns of bits - so one set of bits for
one processor might mean ADD, while for another the same
set of bits might mean STORE!
Therefore the machine code for one processor will rarely work
with another processor.
Unit 13 – Computer Systems
25
Homework / Written Exercise 2e
1.
What is machine code?
2.
How is machine code stored in a computer’s main
memory?
3.
Why will machine code written for one computer rarely
work on another one?
4.
Why then will machine code for an Intel Pentium 3 run
on an Intel Pentium 4?
5.
Why might machine code for an Intel Pentium 4 not run
on an Intel Pentium 3?
26
Bishopbriggs Academy - Standard Grade Computing Studies
Sys 3 – Operating Systems
In this chapter you will learn about:
• The purpose of an operating system
• Types of operating systems
• Tasks carried out by the operating system
The purpose of an Operating System
An Operating System is a computer program.
It runs all of the time that the computer is switched on. The
Operating System controls every process that runs on the
computer.
• The Operating System is the first program to load and
run when a computer is switched on.
• The Operating System is the last program to quit when
you shut a computer down.
• Every other program depends on the Operating System
to run.
• The Operating System isolates the application programs
(such as a database or game) from the computer
hardware.
This means that the same application program can be loaded
and runs on computers that use different types of memory,
different hard disks, different keyboards, etc. provided the
Operating System the application has been design to work
with is the same.
Unit 13 – Computer Systems
27
This means that applications are written to work with a
particular Operating System.
When an application wants to load a file it asks the Operating
System to do it for it, or when it wants to print it asks the
Operating System to print, or when it wants to check which
menu item has been chosen it asks the Operating System to
check for it, etc.
This means, for example, an application written to work with
Mac OS X will not run on Windows XP or Linux.
Types of Operating Systems
The most widely used operating systems are interactive
systems.
An interactive system will display something on the screen
and wait for the user to do something about it. It will then
process the user’s input and put something else on the screen
for the user to do something about. And so on. This is
referred to as the Input-Process-Output (IPO) cycle.
In an interactive operating system, processing only occurs
after the user makes an input.
However, all modern interactive Operating Systems have what
is known as ‘background job capability’.
A background job is a program that once started running does
not require any input from the user so it can process and
output without waiting for the user to do anything.
Common examples of this are printing, playing music or
videos in the background at the same time that the user is
using a word processor or browsing the World Wide Web –
applications which do require an input from the user.
28
Bishopbriggs Academy - Standard Grade Computing Studies
Some Operating Systems use real-time systems.
In real-time systems processing and output will continue
without any user input. When the user does make an input
the program will respond to it almost instantly.
Real-time systems are often used for simulation programs
where the simulation continues with or without any input
from the user. For example a simulated patient’s health will
continue to deteriorate while the trainee doctor decides what
do, but when the doctor does do something the program will
respond and adjust the patients condition in line with the
doctor’s actions.
Industrial processes depend on real-time systems to control
them. For example real-time systems are used to control
nuclear power stations and to manage the operation of all
modern car engines.
Homework / Written Exercise 3a
1.
What is a computer Operating System?
2. Why do applications depend on the Operating System?
3. What is the main characteristic of an interactive Operating
System?
4. (Credit) What is meant by ‘background job capability’?
5. (Credit) Give a common example of a background job.
6. What are the main characteristics of real-time systems?
7.
Why are real-time systems used to control nuclear power
stations?
Unit 13 – Computer Systems
29
Tasks carried out the Operating System (Credit only)
Modern Operating Systems carry out several common tasks:
• Provide the Human Computer Interface (HCI)
• Manage the user’s files
• Manage Inputs and Outputs
• Manage how the memory in a computer is allocated
• Manage error detection and reporting
1
Provide the Human Computer Interface (HCI)
The HCI is the only part of the Operating System that the user
comes directly in contact.
Modern Operating Systems all use Graphical User
Interfaces (GUI).
The Operating System is responsible for drawing the GUI and
handling all of the users interactions with it (clicking on icons
and buttons, moving scroll bars, opening and closing windows
or choosing items from menus).
The user has some limited control in allowing the choice of
colour scheme or arranging icons.
The modern GUI is designed to make it easy for the user to
work with the computer – if the user was given too much
control then they could make it unusable!
30
Bishopbriggs Academy - Standard Grade Computing Studies
2
Manage the user’s files
The File manager is the part of the Operating system that
takes care of all filing tasks. These include:
• locating and loading files from the backing store on
request from an application or directly by the user.
• saving files to backing store.
• deleting files from backing store.
• copying files
• moving files from one location in the backing store to
another or from one backing store to a different backing
store.
• controlling access to files (e.g. some files may be ‘readonly’)
• keeping track of every file on every backing store in the
computer.
Modern Operating Systems use a hierarchical filing
system to keep track of the files the backing stores.
Any hierarchical filing system can be thought of as an
upside down tree structure with the root at the top and the
branches below it as shown below.
Unit 13 – Computer Systems
31
On screen, different icons are used to show directories
(shown as a folder icon) and files so the user can tell them
apart.
To help further, different types of files will also have different
icons.
It should be obvious that as the hierarchical structure
becomes larger and larger, it is very easy to lose files in it.
It is common for home computers to have hundreds of
thousands of files in the backing store. The file manager
must keep track of them all!
It is therefore very important that the hierarchical structure is
constructed in some sort of logical manner.
3
Manage Inputs and Outputs
The Input/Output Manager controls the hardware devices
connected to the computer.
Every peripheral connected to a computer is connected
through an interface. However the same interface can be
connected to many different types of peripheral. It is the job
of the Input/Output Manager to make sure that the correct
signals are sent through the interface to the peripheral to
make it work.
For example: an ink jet printer works completely differently
from a keyboard – but they can both be connected to the
computer through the same USB interface.
Every peripheral that is connected to a computer must have a
device driver – that is a piece of software that the
Input/Output Manager uses to send the peripheral the correct
signals to operate.
32
Bishopbriggs Academy - Standard Grade Computing Studies
It is the device drivers that determine how data will be
accessed.
For example:
• Data on a magnetic tape is always accessed
sequentially, that is in strict order from the first
through to the last.
• Data on hard disks, USB Flash Drives, CD-ROMs and
DVD-ROMs can be accessed directly – that is data can
be loaded from the media in a random order.
When you buy a new peripheral you must load the new device
driver before you can use it.
4
Manage Memory
The Memory Manager controls how the main memory is
used.
• Before a file is loaded into the main memory, the
Memory Manager will check to see if there is enough
memory available to load it –if there isn’t then the file is
not loaded.
• When an application quits, the Memory Manager deletes
it from the main memory and allows that space to be
used by another application.
• The Memory Manager protects the applications so that
one user application will not accidentally store data in
memory that is already used by the Operating System or
another application.
Unit 13 – Computer Systems
33
5
Manage error detection and reporting
All of the time that the Operating System is running it is
checking the hardware, the applications and itself for errors.
When it finds a problem it first try to correct it itself or if that
is not possible it will alert the user.
Computer errors are described as being ‘fatal’ or ‘non-fatal’.
Non-fatal errors are easily corrected by the Operating
System itself or by asking the user to do something.
For example:
“The printer is out of paper – please add more paper.”
Once a non-fatal error has been corrected then the programs
can continue as normal and no unsaved data is lost.
A Fatal error is one which neither the operator nor the user
can correct.
“Stack overflow – program quitting”
This fault would require the program to be restarted and all
unsaved data is lost.
or
“Memory fault at &H43A56F”
This is due to a hardware fault and the faulty memory module
must be replaced before the computer can be used again. This
type of error would normally be detected when the computer
is starting as a memory check is one of the first error checks
carried out.
Many fatal errors give no warning – the program just quits!
34
Bishopbriggs Academy - Standard Grade Computing Studies
Homework / Written Exercise 3b (All Credit)
1.
What does HCI stand for?
2. What does GUI stand for?
3. Give three examples of parts of a GUI.
4. Why do modern operating systems use a GUI?
5. Describe three tasks carried out by the Filing system.
6. Describe a hierarchical filing system for keeping track of
files on computer backing store.
7.
Why is it important to keep the hierarchical structure
organised?
8. What does the Input/Output Manager in an operating
system do?
9. Each peripheral connected to a computer needs a device
driver. What is the purpose of a device driver?
10. Describe three tasks carried out by the memory manager.
11. What task does the operating system carried out all of the
time it is running?
12. What is the difference between a non-fatal and a fatal
error.
13. Give an example of non-fatal error and how it would be
corrected.
14. Give an example of a fatal error and its cause.
Unit 13 – Computer Systems
35
Sys 4 –Systems Software
In this chapter you will learn about:
• High level programming languages
o Common features
o Their need for translation
• Portability of software
• Types of translators
o Interpreters
o Compilers
Systems software are applications which are not part of the
Operating System but do something to work with or help the
Operating System.
A common example of systems software would be anti-virus
software. However this chapter is going to concentrate on
another type of software – High Level Programming
Languages.
High Level Programming Languages
A High Level Programming Language is an application that is
used to create new programs to run with a particular
Operating System (or indeed a new Operating System!)
You learned in Sys2 earlier that all program instructions are
stored in the computer’s main memory as binary patterns.
(Machine Code)
When digital computers were first invented they were
programmed by storing the machine code directly into the
main memory, but this took a very, very long time.
36
Bishopbriggs Academy - Standard Grade Computing Studies
High Level Programming Languages were invented so that it
would take less time to make new programs.
Examples of High Level Programming Languages are Algol,
Fortran, C++, Java, Cobol, Real Basic, Visual Basic, etc.
These languages share these common features
• They all use ‘English’ like commands so they are
much closer to our ‘natural’ language. For example:
Print "Hello"
This makes them much easier to follow than patterns of 1’s
and 0’s so finding errors in a program is much easier than
finding one wrong bit amongst thousands!
• Unlike ‘English’, all high level programming languages
have special ‘constructs’. For example:
Conditions like
If mark > 50 Then Print “Pass”
Repetitions like
For counter = 1 To 100
• The High Level Programming Language must translate
the ‘English’ commands making up the program into the
machine code that the microprocessor can use.
Each processor has its own machine code. A High Level
Programming Language designed for use on one type of
computer will probably not produce machine code which will
work on another computer as its processor will not be able to
understand the machine code that the High Level
Programming Language has produced. This means that
machine code is not portable.
However the ‘English-like” code typed in by the user (the
source code) is a plain text file and can be read by software
on different computers. The source code is portable.
Unit 13 – Computer Systems
37
A portable program is one that can run on different
hardware or Operating System.
The Java High Level Programming Language has been
developed to create programs that will run on almost any
hardware or Operating system – even mobile phones!
Types of Translators
Once the program has been written in the High level
Programming Language using its ‘English-like’ commands
(the source code) it must be translated into binary (the
machine code) before the program can be run.
There are two ways of translating source code into machine
code:
• Interpreter
• Compiler
Interpreters
An interpreter works like this:
• Fetch one line of source code
• Translate it into machine code
• Is it the halt instruction?
No!
• execute the code
• throw it away
• return to the beginning
Yes!
• Stop.
38
Bishopbriggs Academy - Standard Grade Computing Studies
Compilers
A compiler works like this:
• Translate all of the source code into machine code
• Save the machine code as a separate file
• Run the machine code.
Interpreters compared to compilers
Interpreters
Compilers
Only one line of machine code
ever exists at a time.
No machine code is kept
permanently
The entire program is
converted into machine code
The machine code (or object
code) is saved after
translation as a separate file.
Translation happens all
No translation is carried
the time that the program is out when the machine code is
running – this slows it
running – so the program
down.
runs faster!
The interpreter program
The compiler is not
must be present in memory needed when the program is
to run the program so
running so the code can be
someone can only run your
copied to other computers.
program if they also have the
same interpreter running on
their machine.
It is easy to find errors in the
If an error occurs in the
source code because the
machine code it is very
program will stop at the
difficult to track down which
source code line with the
line in the source code caused
error. This speeds up
the error. This slows down
development time
development time.
• Interpreters are used to develop new software.
• Compilers are used to make the finished program for
distribution.
Unit 13 – Computer Systems
39
Homework / Written Exercise 3
1.
What is a High Level Programming Language?
2. Give an example of High Level Programming Language.
3. One feature of a High Level Programming Language is that
it uses ‘English’ like commands. Give an example of an
‘English’ like command.
4. Why is this easier to use than machine code?
5. Give two examples of the special ‘constructs’ that a High
Level Programming Language might use.
6. What must happen to a program written in a High Level
Programming Language before it can run?
7.
(Credit) What is meant by a program being ‘portable’?
8. (Credit) Why is machine code not portable?
9. (Credit) Why is the High Level Programming Language
source code sometimes portable?
10. (Credit) What two types of translators are there?
11. (Credit) Describe how an interpreter works.
12. (Credit) Describe how a compiler works
13. (Credit) Why do compiled programs run faster than
interpreted programs?
14. (Credit) When is it best to use an interpreter and why?
15. (Credit) When is it best to use a compiler and why?
40
Bishopbriggs Academy - Standard Grade Computing Studies
End of Unit Questions
Look at these two adverts for two computers.
Jazz Senior
Jazz Junior
Barion, 1.6 GHz
Meson 1.6 GHz
16 bit word
32 bit word
Doors XL OS
Floors PL OS
128 MB RAM
256 MB RAM
2 MB ROM
4 MB ROM
20 GB HD
40 GB HD
CD-ROM drive
DVD-R/W drive
CRT Monitor
TFT Monitor
Mouse
TouchPad
Extended Keyboard
Compact Keyboard
Unit 13 – Computer Systems
41
Foundation
1.
How much main memory does the Jazz Senior come
with?
2.
What input devices does the Jazz Junior have?
3.
What backing stores does the Jazz Senior have?
4.
Why do computers need backing stores?
5.
What is a back-up copy?
6.
What must happen to a program in backing store before
it can be run?
7.
Jazz Junior is a laptop computer – what is the main
difference between a laptop computer and a desktop
computer?
8.
Is the Operating System a program or a piece of
hardware?
General
9.
The Floors PL Operating System is an interactive
Operating System – What does this mean?
10. A program written to run on the Jazz Junior will might
not run on the Jazz Senior. Why might this be?
11.
What does CRT stand for?
12. What does TFT stand for?
13. What is the advantage of the Jazz Junior being equipped
with DVD-R/W drive compared to the Jazz Senior’s
CD-ROM drive?
42
Bishopbriggs Academy - Standard Grade Computing Studies
14. Programs for the Jazz Senior are written using a High
Level Programming Language called Sofi. What
must happen to programs written in Sofi before they can
run on the Jazz Senior?
15.
Why do programmers prefer High Level
Programming Languages to programming in
machine code?
16. How would the image of the Jazz Junior be stored in a
computer’s main memory?
Credit
17.
If the image of the Jazz Junior is 240 pixels high by 180
pixels wide, how much memory would be needed to store
the image?
18. The Barion processor contains a Control Unit, an
Arithmetic Logic Unit and Registers. What is the
purpose of each of these?
19. Which is the more powerful processor – The Barion or
the Meson - and why?
20. Both operating systems have a GUI. What is this and
how does it help the user?
21. Printers can be connected to both computers. A device
driver must be added before the printers can be used.
What is a device driver?
22. Both Operating Systems offer background job
capability. What is this?
23. When would a programmer use (a) an interpreter and
(b) a compiler?
24. How is a program described if it can run on both Jazz
computers?
Unit 13 – Computer Systems
43