Download 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
Transcript
Higher Computer Systems
Theory Notes
Computer Systems
Topic 1 – Data Representation
The Binary System
In a computer system all data, no matter the type, is stored as binary
numbers. Binary is used as it is very easy for the computer to represents
the two numbers (1 and 0) inside the machine by using the two states ‘on’ and
‘off’ (1 = on, 0 = off).
Advantages of Binary
There are 3 main reasons binary is used rather than decimal to represent
data in a computer system. They are:
1. Fewer rules for calculations are needed when only using two digits.
2. Changes in voltage inside the machine will not change the data as any
voltage, from 1-5 volts, still represents the value ‘1’.
3. The two states are easy to represent inside storage devices, for
instance the presence or absence of a pit on the surface of a CDROM.
Disadvantage of Binary
There is one disadvantage to the binary system and it is that a large number
of digits are required to represent numbers.
Sizes In Binary
In binary the smallest unit is a single binary digit (a ‘1’ or a ‘0’) this is know as
a bit. We can group together bits to create the following units of size:
1 bit
1 byte
1 or a 0
8 bits
1 Kilobyte (KB)
1 Megabyte (Mb)
1 Gigabyte (Gb)
1 Terabyte
1024 bytes
1024 Kb
1024 Mb
1024 Gb
Single binary Digit
The amount of bits used to represent a
single number or character
Page 1
Higher Computer Systems
Theory Notes
Representing Positive Numbers Using Binary
To convert a number from decimal to binary or vice versa we first need to
know the values of each of the bits in a binary number.
When learning to count in decimal you learned each of the digits values
increases by a factor of 10 as we move along the columns from right to left.
EXAMPLE
The number 2407 can be shown as follows:
1000’s
2
100’s 10’s
4
0
1’s (units)
7
2000+400+7=2407
Since binary is a base 2 system instead of a base 10 such as decimal the
column values increase by a factor of 2 rather than 10 as we move from
right to left.
EXAMPLE
The binary digit 11011001 can be shown as:
128’s 64’s 32’s 16’s 8’s 4’s 2’s
1
1
0
1
1
0
0
128+64+16+8+1=217
1’s
1
Just like in decimal in a binary number the digit to the left has the highest
value. This is known as the most significant bit and the digit on the right
has the smallest value and is called the least significant bit.
Page 2
Higher Computer Systems
Theory Notes
Representing Negative Numbers Using Binary
To store a negative number in a computer system we also have to store the
sign of the number (i.e. whether it is positive (+) or negative (-)). That
means in an 8 bit binary number we would only be able to use 7 bits for the
number and would use the other bit to store the sign. This method is known
as signed bit representation.
Disadvantages of Signed Bit Representation
There are a number of disadvantages with this system the main ones being:
1. Due to 1 digit being used for the + or – sign the range of numbers is
decreased.
2. There are 2 values for 0 (positive 0, and negative 0) this can cause
complications when carrying out calculations.
Two’s Complement
An alternative was needed to signed bit because of the disadvantages so we
can use the Two’s Complement system. The example below shows the number
-7 represented using two’s complement.
EXAMPLE
128’s 64’s 32’s 16’s
Write down the positive 0
0
0
0
number (+7)
REVERSE THE DIGITS
Add 1 to the reversed
1
1
1
1
digits
Negative number (-7)
1
1
1
1
8’s
0
4’s
1
2’s
1
1
0
0
1
0
1’s
1
0
+ 1
0
1
To change a two’s complement number back you can just repeat the same
process. Any question about number representation should tell you which
number system to use. If it doesn’t then make an assumption about which
one you are using and write this down.
Page 3
Higher Computer Systems
Theory Notes
Fractions in Binary
In the decimal system fractions are shown using a decimal point as follows:
fraction
decimal
1/10
0.1
1/100
0.01
1/1000
0.001
1/10000
0.0001
1/100000
0.00001
Fractions in binary use a binary point and look like this:
Fraction
Decimal
Binary
fraction
1/2
0.5
0.1
1/4
0.25
0.01
1/8
0.125
0.001
1/16
0.0625
0.0001
1/32
1/64
1/128
0.03125 0.015625 0.0078125
0.00001 0.000001 0.0000001
Floating Point Representation
Any number in decimal can be represented with a decimal point in a fixed position and a
multiplier, which is a power of 10.
EXAMPLE
20.125 = .20125 x 100 = .20125 x 102
Since ten is the base number for decimal it is always shown to the power of
10. However the same form can be used for any number base simply by
changing the base in the following form:
m x basee
Where:
m = mantissa and e = exponent
Since in binary the base is always 2 then we would not need to store that in
the computer only the mantissa and the exponent.
EXAMPLE
20.125 = 10100.001 = 10100001 x 25 = .10100001 x 2101
This would then be stored as:
1010 0001
101
mantissa
exponent
Page 4
Higher Computer Systems
Theory Notes
Representing Text
A byte (8 bits) in the computers memory is used to store a single character,
a character being any letter, digit or symbol on the keyboard. All of theses
characters that can be represented by the computer are known as the
computer’s character set.
ASCII
To be stored in the computers memory a character is first assigned a
number which is then converted to binary which can be stored. The numbers
assigned to the computer is determined normally using the American
Standard Code for Information Interchange (ASCII).
ASCII is a 7 bit code that ensures that data can be easily transferred from
one system to another. Using a 7 bit code means that a total of 128
characters can be represented. However, if necessary then 8 bits can be
used (extended ASCII) to give up to 256 characters.
In ASCII the first 31 characters are known as control characters, these
are non-printable characters such as ‘Cursor Up’, ‘tab’, ‘return’, etc.
Unicode
It was soon realised that ASCII (even using 8 bits instead of 7) did not have
enough characters available for more than a single languages character set.
To solve this Unicode was developed. Unicode is a 16 bit code that will allow
65,536 different characters. This gives Unicode the advantage of being
able to represent far more characters such as Latin, greek, Arabic, etc but
has the disadvantage of taking up far more storage space.
Page 5
Higher Computer Systems
Theory Notes
Representing Graphics
Any graphics or images on a screen of a computer are made up of a number
of tiny dots called pixels (picture element). In a black and white image each
pixel is set to either on or off (black or white) and can be represented in
memory as a bitmap where 1’s and 0’s represent each pixel.
Example
Image on screen
Bitmap in memory
1
0
0
0
0
0
0
1
0
1
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
0
0
0
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
1
0
0
0
0
0
0
1
The quality of the image depends on the resolution (number of pixels in the
image). The higher the resolution the better the quality but also the more
memory needed to store the image. The resolution of a screen is often
written as the number of pixels horizontally and vertically (e.g. the above
image has a resolution of 8x8).
High Resolution Image
Low Resolution Image
Page 6
Higher Computer Systems
Theory Notes
Bit mapped & Vector Graphics
There are two types of graphic formats that we should know about, bitmaps
and vector graphics. Both have advantages and disadvantages which can be
seen listed below:






Bit mapped Graphics
Bit mapped graphics packages are
also called paint packages
Works by changing the colours of
the pixels that make up the
screen
Overlapping shapes in a bit map
cannot be separated
Bitmaps are resolution dependent
(i.e. is resolution is fixed to what
it was originally created at)




The whole screen is saved in a 
bitmap keeping a consistent large
file size no matter the complexity
of the image.
Pixels can easily be edited 
individually
Vector Graphics
Also known as Drawing packages
Works by storing attribute
details about the items that
make up the image
Each object (shape) in the image
can be easily altered and layered
Vector images are resolution
independent (i.e. same quality of
image no matter the resolution of
display it is on)
Only details on objects in the
picture are saved so the less
complex the picture the less
space it takes up
Individual pixels cannot be edited
Vector
Bitmap
Page 7
Higher Computer Systems
Theory Notes
Calculation of Storage for Bit Mapped Images
The amount of storage space required for bit mapped images can be
calculated using the following formula:
Storage needed in bits = total number of pixels used in image * number
of bits used to represent colours for each pixel
The number of bits used to represent colours or shades of grey in each pixel
is known as either the colour depth or the bit depth.
Example
Calculate the amount of storage for a graphic measuring 1 inch by 2 inches
with a resolution of 90 dpi that uses 256 colours.
Calculate total number of pixels in image
Length = 1 x 90 = 90
Breadth = 2 x 90 = 180
Total number of pixels = 90 x 180 = 16200 pixels
Calculate number of bits per pixel for colour
256 colours = 8 bits
Calculate storage in bits
16200 x 8 = 129600
Convert to a suitable unit size
129600bits / 8 = 16200 bytes
16200 bytes / 1024 = 2025 Kilobytes
2025 Kilobytes / 1024 = 1.98 Megabytes (Mb)
True Colour
In some cases the colour depth will simply be stated as True Colour. This
means it has a bit depth of 24 bits and can represent 16,777,216 colours.
This is normally used on photos and other realistic looking images.
Page 8
Higher Computer Systems
Theory Notes
Data Compression of Images
As bit mapped images can take up a lot of storage space on a computer they
need to be compressed to allow us to store them. There are 2 ways e can do
this:
- Lossy Compression
- Lossless Compression
Lossy Compression
So named as it works by ‘losing’ some of the detail in the image. In a
complex image like a photo there are numerous shades of colour and fine
detail that our eyes do not see. By removing them we can save space whilst
making the image appear unchanged though detail has been lost.
Lossy compression does not work well for images with relatively few colours
or solid blocks of colour such as animations as there is little it can remove
without affecting the visible quality.
Lossless Compression
This method compresses the image by using mathematical formulas to
represent large blocks of similar colour rather than storing every pixel
individually. No detail from the image is removed (hence the name lossless).
Page 9
Higher Computer Systems
Theory Notes
Topic 2 – Computer Structure
Block Diagram of a Computer
Any computer system can be easily represented using the following diagram:
MAIN MEMORY
INPUT
DEVICES
OUTPUT
DEVICES
CPU
BACKING
STORAGE
DEVICES
CPU
The CPU (Central Processing Unit) is often described as the brain of the
computer. In this course you need to understand a bit more about how it
works and the parts that make up the CPU. The 3 parts of the CPU are:
The Control Unit
This controls all the other parts of the processor and ensures the CPU
carries out all the program instructions in the correct order.
The Arithmetic and Logic Unit (ALU)
Carries out all the calculations (arithmetic) and the logical operations such
as AND, OR, NOT.
Registers
A small group of storage locations inside the processor used for temporary
storage of data during the fetch execute cycle.
Page 10
Higher Computer Systems
Theory Notes
PROCESSOR STRUCTURE
If we take a closer look at the processor and Main Memory, this diagram can
be used to represent what we would see:
Other
registers
Arithmetic &
Logic Unit
(ALU)
Memory
Address
Register
Address Bus
Memory
Data
Register
Data bus
Main
Memory
Control bus
Control
Unit
read and write
Clock Pulses
Electronic
Clock
The processor is connected to the main memory by 3 sets of wires called
‘buses’ (Address bus, Control bus, Data bus), each of which has a different
function.
Address Bus
This is a unidirectional (one way only) bus which is used to carry address
information from the processor to the main memory. The number of wires in
the bus determines how many different memory addresses can be accessed.
E.g. An 8 bit address bus (8 wires) can access:
28 different addresses = 2x2x2x2x2x2x2x2 = 256 different addresses
Every time we add an extra wire to the address bus we double the amount of
addresses it can access.
Page 11
Higher Computer Systems
Theory Notes
Data Bus
The data bus is a bi-directional bus (travels both ways) and carries data to
and from the processor and main memory. The number of wires in this bus
determines how much data can be transferred in each operation. E.g. 16
wires in the data bus would allow 16 bits (2 bytes) of information to be
transferred in one operation.
Control Bus
Consists of a number of separate wires each of which has a different
function. These include the read, write, clock, interrupt, non-maskable
interrupt and reset
Read & Write lines
These are used to indicate whether the operation being carried out involves
writing information to the main memory or reading it from there.
Clock
Carries a series of pulses at a constant rate that are used to keep all parts
of the processor working in time with each other. The faster the pulses the
faster the operation are carried out. The speed at which these pulses occur
are called the clock rate and are measured in Megahertz or Gigahertz (1GHz
= 1000MHz).
Interrupt and non-maskable Interrupt
Normally used by a peripheral to signal that they wish to communicate with
the processor. When an interrupt is used then the processor saves a copy
of what it is doing before dealing with the interrupt so it can return to this
after. With a non-maskable interrupt occurs much the same thing happens
except the processor cannot mask or ignore the interrupt in any way.
Reset
Returns the processor and the entire computer to its initial starting state
(Restarts your machine). Usually used to recover from a computer ‘crash’ or
‘freeze’ but can also be activated by a button on the case.
Page 12
Higher Computer Systems
Theory Notes
The Fetch-Execute Cycle
The way in which the processor carries out its instructions is known as the
fetch-execute cycle. For higher you need to be able to explain the steps
involved in this cycle when reading and writing from and to memory.
Memory Read Operation
1. The processor sets up the address bus with the required
memory address by placing a value in the memory address
register.
2. The control unit activates the read line on the control bus.
3. The contents of the particular storage location are released
onto the data bus and sent to the Memory Data Register. (If
this is an instruction then it would be decoded and executed).
Memory Write Operation
1. The processor sets up the address bus with the required
memory address by placing a value on the Memory Address
Register.
2. The processor sets up the data bus with the value to be
written to memory by placing the value in the Memory Data
Register.
3. The control unit activates the write line on the control bus.
4. The contents of the Memory Data register are transferred
via the data bus to the appropriate storage location in the
computers memory.
Page 13
Higher Computer Systems
Theory Notes
Main Memory
Main memory is a general term for any computer memory that is not backing
storage. Main memory is divided into different storage locations each of
which has its own unique address. Each storage location can hold a set
amount of data the size of which is known as the computers word length.
There are, however, different types of memory. The types we need to know
about in higher are:
CACHE
A small amount of memory (1 or 2MB) used as a temporary store between
the main memory and the processor for often used instructions.
Level 1 Cache (internal) is often built into the processor itself. Level 2
Cache (external) sits close to the processor but not as part of it.
RAM (Random Access Memory)
This is volatile memory, which means it only holds its data whilst the
computer is switched on, when the computer is switched off then the data in
RAM is lost. Data in RAM can be both read from and written to.
Types of RAM
Static Random Access Memory
(SRAM) is more expensive to
produce than DRAM but does not
need its contents constantly
refreshed. It will hold its data as
long as power is applied to it.
SRAM is normally used to store
the computers date and time
settings. Also as it has a faster
access time than DRAM it is
often used for cache memory.
Page 14
Dynamic Random Access Memory
(DRAM) – This type of RAM must
have its contents constantly
refreshed (about 1000 times per
second) or any data in it will be
lost. As it is cheap to produce
this usually makes up the majority
of computers RAM.
Higher Computer Systems
Theory Notes
ROM (Read Only Memory)
This type of memory holds its data permanently even when the computer is
switched off. In most computer systems the ROM holds the bootstrap
loader which is part of the operating system that is used to start up the
computer.
Types of ROM
Programmable Read Only Memory (PROM) – contains no data when made
but is programmed permanent by the user.
Erasable Programmable Read Only Memory (EPROM)- A chip which can be
programmed, erased and reprogrammed. This is usually done by shining an
ultraviolet light on a small window on the top of the chip.
Flash ROM can be reprogrammed whilst still inside the computer. Used in
USB Flash drives and memory cards for digital cameras.
Backing Storage
Also known as secondary memory this is permanent storage for programs and
data in a computer system. This is required as data in the primary storage
(RAM) is lost when the computer is turned off. There are many different
types of backing storage all varying in cost, storage size and access speeds
such as hard disks, magnetic tapes, USB flash drives, etc. Though they are
all cheaper than RAM with a slower access time and the ability to store more
information.
Page 15
Higher Computer Systems
Theory Notes
Measuring Performance
There are many different ways in which a computers performance can be
measured but we will be focusing on 4 of them:
CLOCK SPEED
The computers clock is used to generate a series of pulses that is used to
keep everything the process or does working in time. The speed or
frequency of the clock is the rate at which it generates these pulses and is
measured in hertz, megahertz - MHz (1MHz = 1 hertz) and Gigahertz – GHz
(1GHZ=1000MHz) with a hertz being a single pulse per second.
MIPS
MIPs stands for Millions of Instructions Per second and is a measure of how
many machine code instructions can be executed per second by the system.
FLOPs
FLOPs stands for Floating Point Operations Per Second and is a measure of
the arithmetical calculating speed of the system. 1 MegaFLOP is a million
FLOPS and 1 GigaFLOP is a billion FLOPS. Supercomputers must be able to
operate at a speed of at least 1 GigaFLOP.
APPLICATION BASED TESTS
The above measurements of speeds don’t mean much to the ordinary user
other than to impress people with the the big numbers there computer
system has associated to it. A far more useful measurement is a benchmark
where a standard set of tasks (such as formatting a 100 page word
document) are carried out and timed to produce a test score for the system.
By doing this test on a standard “average” system and then the machine to
be tested the scores can be compared e.g. if your system got 100 and the
benchmark system 50 then your machine is twice as good.
Page 16
Higher Computer Systems
Theory Notes
Topic 3 - Peripherals
A peripheral device is any input, output or external backing storage device
connected to the computer system. The range of devices available is not
covered in Higher but it is assumed that you will have knowledge of several
of these.
Interface
No matter what the peripheral device is, it will be connected to the system
via an interface. This is the hardware and software that allow the computer
and the deice to communicate and also compensate for differences in their
operating characterisitics.
5 Functions of an Interface
Buffering
This is the process of temporarily holding data whilst it is moving between
the processor and the peripheral. The area of RAM in which the data is held
is known as a buffer.
Example: Characters entered at a keyboard are temporarily stored in the
buffer until the program or CPU is ready to process them.
Data Format Conversion
Changes the data received from the peripheral into a form the processor
can deal with and vice versa.
Example 1: Serial to Parallel data conversion
Serial data transmission is where the data is sent one bit after another
along the same data line.
Parallel data transmission is where each bit in an instruction is sent
simultaneously along separate data lines. This is a very fast way to transmit
data but only suitable over short distances.
INTERFACE
1
1
1
0
Serial
1
0
1
1
Page 17
Parallel
Higher Computer Systems
Theory Notes
Example 2: Analogue to Digital conversion
Another type of data format conversion is changing analogue signals to
digital signals and vice versa. This occurs in CD players where digital data on
a CD passes through an interface to turn into analogue sound signals we
understand.
Analogue Signal
Analogue signals vary continuously between 2
limits such as with sound or light.
Digital Signal
Digital signals only have 2 values (on or off)
which are represented in the computer by 1 and
0.
1
0
0
1
Analogue to Digital (A to D) or Digital to Analogue (D to A) converters
change one signal type to another.
Digital Signal
1
0
0
1
0
Digital to Analogue
Converter
Analogue Signal
Analogue to Digital
Converter
Digital Signal
1
Page 18
0
0
1
0
0
Higher Computer Systems
Theory Notes
Voltage conversion
This is required when the peripheral device operates at a different voltage
from the processor.
Example: The motherboard and processor normally operate around 5 volts
but the keyboard may use 12 volts therefore voltage conversion is needed
between the keyboard and the processor so that the high voltage does nto
cause any damage.
Protocol Conversion
Protocols are standards that allow communication and data transfer between
computers and/or peripherals. If the devices use different protocols then
conversion between them is needed.
Example: Parity (Odd and Even)
Parity is a protocol used to check for errors in data being transferred. One
bit in every byte of data is reserved as a parity bit that is used to make the
total number of 1’s sent in the byte either odd or even depending on whether
odd or even parity is used.
If the device and computer where each using a different type of parity then
unless a conversion takes place error would be detected in every byte of
data.
Handling of Status Signals
Status information is used to show whether or not a peripheral is ready to
send or receive data to or from the processor. This information can then be
used to inform the user of any problems requiring their attention such as
printers running out of ink or paper.
Example: Processor and Printer
(i) Processor checks interface to see if printer is ready
(ii) The interface returns a printer ready signal to the printer
(iii) REPEAT
(iv) The processor sends data to the interface until the interface
sends a buffer full signal
(v) The interface sends data from its buffer to the printer
(vi) Data is removed from buffer as it is printed
(vii) Interface returns a buffer empty signal
(viii) UNTIL print job is complete
Page 19
Higher Computer Systems
Theory Notes
International Standards
There are now a large number of standard interfaces that are used
worldwide most modern computers will have at least 4 of these interfaces.
RS 232 - Recommended Serial (Serial Data Transmission)
SCSI - Small Computer Systems Interface (Parallel Data Transmission)
IDE - Integrated Drive Electronics
SATA – Serial Advanced Technology Attachment (Transfer speed of 1.5
Gbps
USB 1 & 2 – Universal Serial Bus (Transfer speeds of 1.5 Mbps, 12 Mbps,
480 Mbps)
IEEE 1394 – Institute of Electrical and Electronic Engineers (Firewire 400
& 800, iLINK with speeds of 400Mbps & 800 Mbps) (Serial Data
Transmission)
MIDI – Musical Instrument Digital Interface
PCI- Peripheral Computer Interconnect
PCMCIA - Personal Computer Memory Card International Association
The use of standard interfaces allows peripherals to be easily used on any a
wide range of systems.
Page 20
Higher Computer Systems
Theory Notes
Topic 4 – Networking
A network is two or more computers linked together in such a way that
programs, data and messages may be exchanged between them. When a
computer is not part of a network it is called a stand alone computer.
LANs (Local Area Networks)
WANs (Wide Area Networks)
A LAN covers a small geographical
area (typically one room or
building) and usually owned by a
single individual or organisation.
A WAN covers a much larger
geographical area (a city,
country or event the whole
world).
Network Hardware
To create a network of computers several additional pieces of hardware are
needed in addition to the computers themselves, these are:
Network Interface Cards (NICs)
This is a small circuit board fitted inside each
computer system that is used to allow the system to
communicate with others on the network. Also you can
get Wireless NICs that allow computers on a LAN to
be connected to each other via a wireless base
station.
Hubs
A hub is a multi-port repeater this is a device which
receives an input signal and then boosts it and forwards it on
to numerous ports (connections).
Page 21
Higher Computer Systems
Theory Notes
Switches
A switch operates like a smart hub. When 2
machines connected via a switch wish to
communicate with each other the switch creates
a direct connection between these 2 machines.
This has the benefit over hubs of havi ng no
chance of collisions of data or bottlenecking of
data in the switch.
Routers
A router is a device which is used to link two
or more networks. The router will look at each
packet of data moving through it and based
upon the destination address of the packet
decide which is the best route for it to take.
Nowadays both routers and hubs can be
connected to networks either via cables or
through a WiFi (wireless) connection.
Network Servers
A client server network is a network where a central computer (the server)
is used to share its resources to the rest of the computers (clients) on the
network. There are a number of different servers available:
File Server
A file server provides central storage for the files of the users of the
network allowing them to be far more easily backed up than on a peer to
peer network. To cope with the large volume of traffic it will have to deal
with the network several will need a large number of fast hard drives and a
fast connection to the network.
Page 22
Higher Computer Systems
Theory Notes
Print Server
A print server is a host computer or device to
which one or more printers are connected.
They can accept print jobs from external
client computers connected to the print
server over a network. The printer server
then sends the data to the appropriate
printer that it manages.
Print servers use either a buffer or a spooler to store the data in. If it is a
computer it can use a spooler to store the pages been sent. If it is a
separate device the buffer would normally be used as it has no hard drive.
Web Server
A Web Server is a computer that provides World Wide Web services to a
network. This computer will have a piece of software running on it which
sends out web pages in response to requests from the internet browsers of
clients in the network.
Web Servers lessens the danger of your computer being exposed to the
web. Instead of your computer being directly connected to the web it is
connected to a server which stops hackers being able to gain access to your
files by use of a firewall.
Page 23
Higher Computer Systems
Theory Notes
Comparison of Networks
Type of Network
LAN (Local Area Network)
WAN
(Wide
Network)
Area
Geographical Area Typically a small area no larger Widespread could cover
than a single building
the entire world
Bandwidth (speed Very fast usually ranging from Generally slower than a
of network)
100Mbps(Megabits
per LAN,
from
56Kbps
second) to 1000Mbps
(Kilobits per second) to
20Mbps
Transmission
Media
CAT5 Copper wire cables. Usually via phone-lines
Optical Fibre cables or WiFi though some high-speed
wireless transmission
broadband connections
use optical fibres
Functions
Data
sharing,
peripheral Data
sharing
sharing and communications
communications
Page 24
and