Figure 4: A distributed computer system

BIT 1204/CSC 1101
INTRODUCTION TO
PROGRAMMING IN JAVA:
OVERVIEW OF COMPUTER
SYSTEMS.
LESSON 1
CONTENTS
1. Computer systems - an overview
2. Computer memory
2.1. Secondary storage
3. Computer programs
4. The computer system within the Department
of Computer Science at the University of
Liverpool
5. Software applications
6. Operating systems
6.1. Logging in
6.2. Changing your password
1. COMPUTERS SYSTEMS - AN OVERVIEW
Question: "What is a Computer?"
Answer: "A Computer is a machine that can store and process data.
An overview of the basic constituents of a computer, assuming a PC (Personnel Computer)
configuration, is given in Figure 1.
Figure 1: Constituent parts of a computer.
Points to note:
The computer is fed information (the
input data). The computer manipulates
this data and then produces information
as a result (the output data). In the
above diagram solid arrows indicate
the flow of input data and dashed
arrows the flow of output data.
Input may be supplied by the user
(typically via the keyboard or a
mouse), or may be taken from an
external data store, or may be supplied
by some other external devices (e.g.
remote sensors, cameras etc).
Output may be to the computer screen;
or to secondary storage or to other
external devices (e.g. printers, plotters,
control signals for machinery etc).
The computer's behaviour is controlled
by a program. By changing the
program or replacing it with another
program we can influence this
behaviour.
A program comprises a series of
instructions which is applied to data.
Collectively the components of a computer
are referred to as hardware.
The computer has two types of memory
associated with it:


Primary memory is used to stote
the program that a computer is
currently running. The primary
memory also provides the
additional temporary storage
required during the execution of a
program.
Secondary storage is used to store
programs when they are not being
executed (and the data that might
be required by programs or
produced as output). Common
types of secondary storage include:
hard dives, CDs, DVDs, "floppy"
discs, magnetic tape, etc.
There is always at least one program
running in a computer (when it is switched
on), this is the operating system (more on
this below). This is permanently stored in
The central part of a computer is its
CPU (Central Processing Unit) which
in turn comprises a Control Unit (CU)
and an Arithmetic and Logic Unit
(ALU):


This is the "administrative"
section of the computer. It
controls and coordinates all the
computers activities including
the "execution" (i.e. running) of
programs. It controlls the
reading of input into memory,
tells the ALU when information
from memory should be used in
calculations and sends
information from memory to
output devises.
The ALU contains electronic
circuits that can carry out
various operations on data, e.g.
addition and subtraction, and
compare items in memory.
primary memory and (amongst other
things) facilitates communication with the
user.
Pieces of equipment that supply data
(input) to the computer, e.g. the keyboard,
or take output from the computer, e.g.
secondary storage, are referred to as
peripheral units.
Programs and data contained in primary
memory and secondary storage are
collectively referred to as software.
Generally we can identify two categories
of software:


System software - programs which
support the use and operation of the
computer itself, e.g. the operating
system and its related programs.
Applications software - programs
concerned with using the computer
as a tool to solve a particular
problem.
2. COMPUTER MEMORY
Computer memory, primary or secondary, is
composed of storage cells sometimes referred to
as words. Each cell has a unique numeric
address associated with it which identifies its
location in the memory. The number of memory
cells in a computer varies but is usually
measured in millions of cells. Each memory cell
contains a binary number made up of a series of
binary digits or bits (binary digits), usually 8,
16, 32 or 64. This is why we sometimes use the
term digital to describe a computer, i.e. a digital
computer.
Despite all information being stored in the
computer in a binary format, binary
numbers are usually represented using
hexadecimal notation (numbers to the base
16 as opposed to the base 2 used by the
binary number system, or to the base 10
used in the general purpose decimal
system). The hexadecimal system
comprises 16 distinct digits. Hexadecimal
digits 0 to 9 are the same as those for a
decimal number. To represent the 6 extra
digits the letters a through to f are used;
these are equivalent to the decimal numbers
A binary digit has two possible values 0 or 1. A 10 through to 15. A binary number can be
binary number is therefore comprised of a
converted to a hexadecimal number by
sequence of 0s and 1s. The digits contained in partitioning the binary number into groups
each cell are represented by voltage levels
of four bits and evaluating each group as a
hexadecimal digit. For example the binary
(Figure 2), with peaks representing 1s and
number 0100110111010000 would be split
troughs 0s.
into 0100|1101|1101|0000 which would
evaluate to 4dd0 in hexadecimal form.
Table 1 represents the fragment of
computer memory given in Figure 2.
Addresses are listed on the left, followed by
a series of 16 bit words each containing
binary digits. The hexadecimal and decimal
equivalents are also given to the right.
Figure 2: Computer memory organisation.
Note that each address is represented by a
unique number - in practice this is usually a
hexadecimal number. The lower end of the
memory addresses range is often referred to
as low memory (the other end is high
memory). The operating system is normally
located in low memory.
A group of 8 bits is called a byte. The size of
Binary Hexadecim Decimal
memory is usually expressed in the unit kilobyte,
Addres
sequenc
al
Equivale
shortened to Kb, which is 1024 (210) bytes.
s
e
Equivalent
nt
Storage capacity can also be expressed as a
number of megabytes (Mb) approximately a
0100
million (220 = 1048576) bytes, or gigabytes (Gb)
1101
50004
4DD0
19760
approximately a (US) billion (230 =
1101
1073741824) bytes.
0000
50003
0000
1100
0111
0110
0C76
3190
50002
0100
0001
0000
1001
4109
16649
50001
0010
0001
1111
1101
21FD
8701
50000
0100
1100
0000
0010
4C02
19458
Table 1: Computer memory organisation.
2.1 Secondary storage
Data in secondary storage is organised into files. Conceptually a file is a named container in
which a collection of data that belongs together can be stored. It might contain, for example,
a program or input data for a program. Each file is given its own name so that it can be easily
referred to. It is good practice to organise related files into directories and sub-directories
according to (say) the nature of their application or the type of file. Use of directories allows
users to organise their file store in a logical manner to prevent it from getting cluttered (more
on this later).
3. COMPUTER PROGRAMS
Essentially, a computer program takes some input from an input
stream, translates it into some application dependent output, and sends
this ourput to an output stream (Figure 3). The term stream refers to
any input source or output destination. Input can be from the key
board, from secondary storage or from some other external device.
Output can be to the screen, to secondary storage or to some other
external device. If there was no output there would be no point in
having the program --- it must do something to be useful!
Figure 3: Conceptualisation of a computer program
To carry out the required translation the computer program comprises a
series of instructions. An instruction tells the computer that it should
perform a particular task. Examples included arithmetic instructions
such as addition and subtraction, and logic instructions which evaluate
to true or false. One measure of a computer's performance is the
number of millions of basic instructions which are performed per
second (MIPS - Millions Instructions Per Second).
When a program is running in a computer, it is said to be executing. At
this time a copy is contained in primary memory where it occupies a
number of consecutive memory cells.
Each instruction
contained in the
program is stored in
a memory cell (or a
group of such cells)
and comprises a
number of bits.
Different
instructions are
represented by
different
combinations of bits
in the cells (currently
computers cannot
operate using any
other form of
instruction
encoding). As a
program executes the
CU (Control Unit)
reads the instructions
contained in primary
memory and carries
them out. This will
involve operations
such as moving the
contents of primary
memory cells to the
CPU (Central
Processing Unit)
and, if appropriate,
invoking the ALU
(Arithmetic and
Logic Unit) to, for
example, add two
numbers together.
The command to
execute a program
(regardless of the
nature of the
program) includes
the name of the file
in which the
program is stored --in many cases this is
all that is required.
The command
causes the operating
system to search for
the required file in
secondary memory
and (if found) copy it
into primary memory
where it is then
executed under the
control of the CU.
On completion
control is returned to
the operating system.
4. THE COMPUTER SYSTEM WITHIN THE
DEPARTMENT OF COMPUTER SCIENCE AT THE
UNIVERSITY OF LIVERPOOL
The Department of Computer Science at the
University of Liverpool operates what is
known as a distributed computer system.
1. A Linux network comprising some 30
The resources required by the users such as
work stations.
software, files, memory, printers, etc. are
2. A PC network of some 300 HP Pentiumdistributed amongst a number of machines
based PCs, running Windows 2000.
in a variety of physical locations. All the
Note that all PCs are configured so that
components are connected via a network
they can also access the Linux network.
which transports information and requests
between any two machines on the network Both the Linux workstations and PCs provide
(see Figure 4). Thus, all resources are shared access to a unified personal filespace, held
between all the users.
centrally on HP series 800 UNIX file servers
and backed up daily. Files can be viewed from
At the time of writing the department
any system within the department.
operates what can be conceptualised as two
networks:
Figure 4: A distributed computer system
For further information regarding the facilities available within the department refer to the
equipment section in the "Computer Science Introductory Guide".
5. SOFTWARE APPLICATIONS
Embedded software
Software may be applied in any situation for
which a previously specified set of
procedural steps (i.e. an algorithm) has been Embedded software is used to control products
defined. Potential applications include the and systems for consumer and industrial
markets. For example the key pad control on a
following:
micro wave oven, or fuel control in a
sophisticated engine.
Real-time Software
Software that measures, analyses or controls Artificial Intelligence software
real-world events as they occur in real time.
Artificial Intelligence (AI) software makes use
Examples include plant monitoring and
of non-numerical algorithms to solve complex
control systems.
problems that are not amenable to computation
or straightforward analysis. Example
Business software
application areas include: pattern recognition,
theorem proving and game playing.
Business information processing is the
largest single software application area.
Expert system software
Examples include payroll and stock
maintenance systems.
Expert systems (also known as Knowledge
Based Systems or KBS) are a branch of AI.
Engineering and scientific software They are designed to mimic the behaviour of an
expert in some well defined field. Example
Engineering and scientific software is often applications include: medicine, geology and
chemical analysis.
characterised by "number crunching"
algorithms. Example applications include:
astronomy, molecular biology, space shuttle
orbital dynamics and volcanology.
6. OPERATING SYSTEMS
As noted in Section 1 above, apart from a
program that is being executed there is
always one more program permanently
stored in primary memory called the
operating system. This is the program (or set
of programs) that is always running when no
"ordinary" program is being run. Operating
systems are advanced pieces of software
provided by the manufacturers of
computers. We say that a particular
computer system "runs under" a certain
operating system. Computers are designed
to put the operating system directly into
operation when the computer is "switched
on". The operating system (amongst other
things):
Windows' 2000 developed by Microsoft,
designed for Intel processors and the
standard operating system found on PCs.
UNIX manufactured by AT&T (and its
derivative --- LINUX) which is designed to
run on a range of computers (including
PCs and MacIntoshes).
MAC-OS used by Macintosh computers.
We will be using two operating systems: (1)
Windows' 2000(for PCs), and (2) LINUX.
Using Windows' 2000 user commands are
typically passed to the computer via the mouse
(through clicking and dragging operations). In
the case of LINUX, user commands are passed
to the the computer using the keyboard. Typical
commands supported by operating systems
Checks that the computer's contact with include:
peripherals are working.
1. Copying, removing, listing and printing
Keeps track of all the files stored in
of files.
secondary storage.
2. Creation, deletion and inspection of
directories.
Provides the means whereby a user can
3.
System queries, e.g. "how much storage
communicate with the computer, i.e. it
space have I got left?".
provides a user interface.
4. Execution of programs.
5. Monitoring input and output (I/O).
Some operating systems are specific to
6. Security.
certain types of computer while others are
designed to run on a range of different
Commands are simply calls to system programs
designs:
which run in the same way as any other
programs.
6.1. Logging in
To begin using an operating system on a
shared network such as that supported by
the Department of Computer Science at the
University of Liverpool you must first log
in. When you login you will be prompted
for your username and password. Your user
name identifies you as a valid user of the
system. You can not log in if you do not
have a user name. Usernames are assigned
by the system administrators - the people
who manage the department's computer
facilities.
A password is an "invisible" codeword
known only to its owner and helps to ensure
security - it prevents unauthorised users
from logging in to your file space. Again,
you will initially be issued a password by
the system administrators.
To start a widows session you simply login at a
PC. Instructions on how to do this will be made
available to you for your first tutoraial.
Once you have logged onto a PC you can start a
LINUX session (UNIX) by selecting (clickingon) the "unix session" icon that will be on your
PC desk top. You will then be prersented with a
list of available machines, select one of these
and then log on in a similar manner to that
described for starting a windows session.
6.2. Changing your password
One of the first things you should do once you have got used to the logging on process is to
change your password. A valid password must:
Contain between 6 and 8 characters
At least two characters must be letters (upper or lower case)
At least one must be:


numeric (the digits 0 through 9), or
special (neither letter nor numeric - for example, -, _, @ or $).
Created and maintained by Pius Nyaanga Momanyi. Last updated 18 July 2013