7.7 Sectioion 7 Architecture, Data Communication & Networking
7.7 Sectioion 7 Architecture, Data Communication & Networking
7.7.1 Architecture
The basic Von Newman architecture has a single processor which uses the fetch decode execute
cycle for the sequence of instructions which make up a program.
A single memory used to store the instructions and data for use with those instructions.
The Von Newman architecture contains special registers that allow fast access to data and are
used to execute a program.
Program Counter (PC) – stores the address of the next instruction to be fetched.
NB The value in the PC is incremented every time an instruction is accessed so that it stores
the address of the next instruction to be fetched.(it is sometimes called SCR).
Memory Address Register(MAR) –When the next instruction is needed, its address is copied
from the PC and placed in MAR.
Memory Data Register (MDR)- The contents of the address in MAR are copied to MDR
sometimes called MBR
It temporarily stores data before passing it on to the CIR.
Current Instruction Register (CIR)- holds instruction that is about to be executed.
The instruction is decoded i.e. it is split into two parts if the operation code and the
operand.
NB The operand is an address.
A typical Processor
Main Memory
CPU
CU
ALU
PC
Accumulator
CIR
MAR
MDR
Accumulator a general purpose register is a register where all values are held when
processed by arithmetic and logical operations.
Arithmetic operations are those that add, subtract, multiply and divide numbers.
Logical operations involve comparing binary patterns and make decisions.
The CU fetches the instructions from memory, decode them and synchronises the
operations (decides what has to be done) before sending signals to other part of the
computers using control buses.
1
The Fetch – decode –execute cycle.
The following sequence of steps describes the fetching and execution of a single program
instruction.
The Fetch Stage
1. Copy the address that is in PC into MAR.
2. Increment the PC
3. Load the instruction that in the memory address given by the MAR into MDR.
4. Load the instruction that is now in the MDR into the CIR.
The Decode Stage
5. Identify the type of addressing being used by the instruction.
a) If the address is a direct address load a copy of the address into the MAR and retrieve
contents of the address.
b) If the address is an indexed address add the address to the contents of the index register
(IR) and copy the result to the MAR. Retrieve the contents of this address.
6. Decode the instruction.
The Execute Stage
7. If the instruction is a jump instructions then
a) Load the address operand into the PC
b) Go to step 1
8. If the instruction is not a jump instruction, it is executed.
9. Go to step 1.
1. MAR [PC]
2. PC [PC]+1
3. MDR [(MAR)]
4. CIR [MDR]
5. Decode
6. Execute
7. Go to step 1
Harvard Architecture
Is when computers segregate the storage space into areas for data and areas for programs.
Used to send control signal from the control unit to the other components of the system.
2
Pipelining
Using the standard fetch decode execute cycle, it apparent that an instruction can be in one of
the three phases. It could be fetched (from memory), decoded (by the CU) or executed by(CU).
Another approach known as pipelining can be used to speed up the throughput of program
instruction.
The processor is split into three parts, each of which handles one of the 3 stages.
instruction 1
Instruction 2 instruction 1
Instruction 5 Instruction 4
Instruction 5
NB Suppose instruction 2 is a jump to instruction 10. The instruction 3,4,5 need to be removed from
the pipe and instruction 10 needs to be loaded into the fetch part of the pipe. Thus the pipe has to
be cleared and cycle restored.
instruction 1
Instruction 2 instruction 1
Instruction 10
Instruction 10
Instruction 11 Instruction 10
3
Parallel processing systems.
1. A maths Co-processor
is a device which has a number of registers sufficiently long to handle floating –point numbers
as single data valves.
it increases performance by reducing the number of operations that need to be carried out.
Used in graphics applications as the calculations are time sensitive and the screen requires a
rapid refresh.
2. Parallel processor
Uses more than one processor.
Able to work on a task by splitting the task into sub- tasks.
Used (a) to produce weather forecasts (b) summing of a series of numbers.
3. Array processor
Uses more than one ALU but still only one processor.
Useful when processing data held in a one dimensional array when the some operation is to be
applied to every element of the array.
Interrupts
An interrupt is a signal to the processor from the peripheral device or program indicating that an
event has occurred that’s needs its attention.
Types of interrupts
An I/O interrupt – is generated by i/o device to signal that a data transfer is complete or an
error has occurred, e.g. that a printer is out of paper or is not connected.
A time interrupt is generated by the clock to indicate that a processor must attend to some
time critical activity.
A hardware interrupt is generated by e.g. power failure which indicates that the OS must close
down as safely as possible.
A program interrupt is generated by error in the program e.g. division by zero or trying to uses
part of memory reserved by the OS for some other program.
After the execution of an instruction, the processor checks to see if the interrupt has occurred.
If so, the OS services the interrupt, if it is more important team the task already being carried
out by running a program called ISR.
Every interrupt signal has its own ISR that services the interrupt.
To resume from exactly where it left off, the contents of all the registers in the processer are
saved on the stack so that the OS can later restore them to carry on with the execution of the
interrupted program.
How to deal with an interrupt that occurs while another interrupt is being serviced.
Place the interrupts in a queue and only allow return to the originally interrupted program when
the queue is empty.
The interrupts are held in a queue called a priority queue. The more important process the
higher the priority.
4
ADDRESSING MODES
Direct Addressing
The operand gives the actual memory address from which the data value is retrieved e.g LD 10
retrieve the contents of location 10 and copy it to the accumulator.
CIR Memory
LD 10 10 200
160 120
Accumulator
200
395
200
Indirect Addressing
The operand holds the address of the location that holds the value to be used. ( Is the address of
the address of the actual data to be used.)
It is useful because it means that more address in memory can be used to store data.
LDI 10- retrieves the address in location 10 and copy the contents of that address to the
accumulator.
CIR Memory
LDI 10 10 200
160 120
Accumulator
395
200 395
5
Indexed addressing
The operand is added to a number in the IR to calculate the address when holds the actual valve
to be used.
Initially IR is set to 0 so that the 1st actual address to use is calculated.
ADDI 10 means add to the accumulator the contents of the address calculated as 10 + the
contents of IR.
After each addition the IR is incremented and the same instruction is executed.
It is useful when adding contents of an array.
CIR Memory
ADI 10
10 200
+
IR
150
160 120
Accumulator
120
200 395
Relative addressing
Means that the operand is added to the address of the 1st instruction to calculate the address.
CIR Memory
ADR 150
10 200
160 120
Accumulator
395
200 395
6
Immediate Addressing
means that the operand is not the address, but the actual value needed by the program.
Convenient method of loading constants into the accumulator.
LOGIC GATES
Electronics pulses can be made to follow sets of rules if they are passed through certain
components.
These components act like electronic switches are called logic gates.
When pulses enter a logic gate, the output depends on the type of logic gate being used and the
combination of pulses input.
output
B
AND gates have two or more inputs, but they have only one output.
he AND gates produces TRUE (1) only if both inputs are TRUE.
A truth table shows all the possible inputs along with their corresponding output.
Input Output
A B
1 1 1
1 0 0
0 1 0
0 0 0
With an AND gate with 3 inputs i.e. (A,B&C) there are eight possible combinations of input and
the only one that will give an output of 1 is when all three inputs are 1.
Input Output
A B C
1 1 1 1
0 0 0 0
1 0 0 0
1 1 0 0
1 0 0 0
0 1 1 0
OR Gate
A output
B
7
The Truth table for a two input OR gate.
Inputs outputs
A B
1 1 1
1 0 1
0 1 1
0 0 0
1 1 1 1
0 0 0 0
1 0 0 1
0 1 0 1
0 0 1 1
1 1 0 1
1 0 1 1
0 1 1 1
NOT GATE
A Output
Input Output
1 0
0 1
A
AND NOT
B
8
Truth Table for 2 input NAND GATE.
Input output
A B
0 0 1
0 1 1
1 0 1
1 1 0
NOR
A
B
Input Output
A B
1 1 0
1 0 0
0 1 0
0 0 1
Symbols
A XOR P
B
A P
A
NEQ P
B
9
Truth Table
Inputs Output
A B P
0 0 0
0 1 1
1 0 1
1 1 0
The output of an Exclusive –NOR gate is TRUE if the 2 inputs are the some the output is FALSE if
the inputs are different.
Also known as Equivalence gate
Input Output
A B P
0 0 1
0 1 0
1 0 0
1 1 1
A XNOR P
A EQ P
A P
10
Questions
Write down the truth table for the following combination of logic gates below.
1.
A NOT
D
NOT Output
B OR
C E
2.
A
OR D NOT E
B
AND Output
C
Inputs Output
A B C
0 0 1
0 1 1
1 0 1
1 1 0
11
7.7.2 Data Transmission
Types of data transmission media.
Hard Wiring
Consists of 3 elements:
a core ( a glass or plastic fibre)
cladding (glass or plastic coating with a different composition to that of the core
The jacket (outer protective layer usually made of plastic material).
Works by transmitting data as a series of pulses of light along a thin glass fibre.
They do not suffer from interference like metal cable.
Very expensive to buy and complicated to install.
is the fastest physical medium and can send data across vast distances without the need for
intermittent connections.
3) Coaxial Cabling
Has a single copper wire at its core, which is surrounded by insulation casing and further layer
of braided copper insulation.
Finally there is a plastic jacket to offer further protection.
Is expensive to buy than twisted pair.
Offers faster data communication than twisted pair but slower than fibre optic.
Can be difficult to install in a building as the cable is rather rigid and inflexible.
Suitable for medium distances.
It is used to send signals to a television from aerial.
Wireless Network.
They transmit data by using radio waves and infrared light.
Bluetooth.
Is an example of wireless personal area network.(WPAN)
Radio waves is used to provide wireless links between mobile phones, computers, PDA, media
player and printer.
Can only work over short distances. (about 10 meters)
Example of its uses include the transfer of phone details, to a computer, transfer of photographs
from a digital camera to a mobile phone.
12
WIFI
Refers to a system where it is possible to connect to network or a single computer through
wireless connection e.g
on wireless LAN
PDAs and other hand held devices
laptop computers which are WIFI enabled.
peripherals devices such as printers, keyboard and mouse which can interfere with the
single computer when fitted with WIFI adapters.
WiFi systems rely on some of wireless access points which uses radio frequency technology to
enable the device to receive and send signals.
The range of coverage can be extended by the use of wireless access points.
NB WIFI hotspots are places where you can access WIFI (free or paid).
They exist in public places such as airports, hotels, internet cafes.
Infrared communication
Uses pulses of infrared to send coded signals.
This is the communication used remote controller in the home.
Infrared signals travel in a straight line so any obstruction between the devices results in a
communication failure.
Microwave transmission
Is also highly directional and is used to transmit large quantities of data between fixed positions.
Disadvantages
The level of security is reduced as it is possible for hackers to access a wireless network unless
precautions are taken, such as use of firewalls or proper use of passwords.
Some wireless networks have a limited range.
You may be in a place where it impossible to get a wireless signal to access a network.
13
Modes of transmission
Simplex
In simplex mode, data can only one direction.
E.g. Teletext information which is passed to a television receiver.
Transmitter Receiver
Half –duplex
In half duplex mode, data can be transmitted in both direction but in only one direction at time.
E.g. CB radio system in which each handset can be set to either receiver mode or send mode.
Device 1 Device 2
Full-duplex
Data can pass in both directions at the end same time.
E.g. Telephone conversation as both users can speak and be heard at the same time.
Device 1 Device 2
Protocols
A protocol is a set of rules that define how data is transferred between devices and computers
There are a number of protocols e.g. TCP /IP – Transmission Control Protocol/ Internet Protocol.
The two terms form two complimentary halves of a system that ensures consistency in the
transmission of data across the internet.
TCP creates the packets, adding a ‘header’ that contains information about how the data packets
should be reassembled at the destination. A checksum is also added as a validation device.
IP labels reach packet with a correct destination address. This address is the one used by routers
to direct the packet to its destination.
14
This level at which data is transmitted in small units using suitable protocols to control and
check transmission.
The units of data are called frames, i.e asynchronously transmitted characters or
synchronously transmitted blocks of characters.
3. The network layer
Is the level that provides the control between adjacent sending and receiving points in the
network.
Prevents packets from getting lost when crossing networks.
4. The transport layer
Is the level that provides the control between adjacent sending and receiving points in the
network.
It deals with addressing, error controls and regulated data transfers .
5. The session layer
Is the level that handles the establishment of connections between hosts of the
management of the dialog.
6. The presentation layer
Is the level that handles the standard forms for presenting data, e.g. the layouts used for
VDU displays.
7. The application layer
is the level that the user has control over in determining what data is to be transmitted and
how it be located to send or received.
At the destination, they need to be put The circuit is only released for further
in order before the message is use when the communication is
reassembled. completed.
It maximise the number of routes in use The long set-up time, monopoly of
at any one time bandwidth, and the need for sender and
receiver to synchronise are
disadvantages when using such a
network for data communications.
It is impossible to intercept a whole
message and therefore messages are
more secure.
7.7.3 NETWORKING
15
A computer networking describes any situation in which 2 or more computers are linked together
via some form of communication medium for the purpose of exchanging data or sharing resources.
Categories of networking
Network Topologies
A topology is a way of describing the physical layout of a group of networked computers.
There are five network topologies:
Ring Networks
This topology consists of a collection of work stations and peripheral devices linked together in a
circular configuration.
There is no central host computer in a ring network, though one node may control overall access
to the network
16
Advantages
The system is no dependent on a central computer.
Using fibre optic links, good transmission speeds can be achieved over a wide area.
The system work effectively when processing is distributed across a number of remote sites
Disadvantages
If one node malfunctions, it can have a negative effect on the whole system.
If there is a faulty in the wiring between two computers then the whole network will fail.
Star Network
There is a central computer called hub that connects all the nodes of the network.
All data communication between workstations/printers/servers go through this central hub.
Advantages
If one computer or device fails then the rest of the network is unaffected.
Problems on the network are easy to identify and work can be carried out on a faulty device
without affecting the rest of the network.
It is easy to expand the network.
Disadvantage
If the central hub breaks the whole network crashes.
17
Both the hardware and software required for the effective running of a star network are
expensive to set up.
Bus Network
In a bus network, each computer or device is connected to a common central line.
Data is transmitted in any direction along the central cable.
Advantages
A bus network is the least expensive and the easiest to set up.
If one workstation fails, it does not affect the rest of the network.
It is to install additional devices.
Disadvantages
If the central line has a fault then the whole network fails.
It is difficult to isolate any faulty on the network.
The performance of the network will be detrimentally affected by heavy data traffic.
Mesh
Is a network topology in which each node (called a mesh node) relays data for the network.
All nodes cooperate in the distribution of data in the network.
Mostly used in wireless situation but can be applied to wired networks.
18
Advantages
Point-to-point line configuration makes identification and isolation of faults easy.
Messages travel through a dedicated line directly to the intended recipient; privacy and security
are thus enhanced.
Should a faulty occur in a given link, only those communications between that specific pair of
devices sharing the link will be affected.
Disadvantages
Expensive to install.
Because every device must be connected to every other devices, installation and reconnection
are difficult.
The huge bulk of the wiring can often be greater than the available space in the ceiling or under
the floors can be accommodated.
Hybrid
Hybrid networks uses combination of any 2 or more topologies in such a way that the resulting
network does not exhibit one of the standard topologies.
Two common examples hybrid network are star ring network consists of two or more star
topologies connected using a multistation access unit (MAU) as a centralised hub.
A star bus network consists of two or more star topologies connected using a bus trunk (the bus
trunk serves as network backbone).
Hub
A network hub is a device for connecting a number of terminals to a network connection in a
star configuration.
A hub receives all the signals from individual computers and then broadcasts them back to all
devices that are connected to it.
The intended destination device receives the message but so do all others.
Switch
Switches are similar to hubs but are more efficient in the way they distribute data.
A switch receives the message, reads the destination label attached to it and only sends it to the
device for which it is intended.
This dramatically reduces the amount of traffic on the network.
The switch sets up a temporary dedicated circuit between the sending and receiving devices. As
soon as the transfer is complete the circuit is released.
Bridges
A bridge is a device that connects two LAN segments
The bridge maintains a table showing which MAC addresses are connected to each of its ports.
A MAC is a unique address given to a device by the manufacturer.
The incoming data from one LAN is stored in a buffer memory and then, when the second LAN is
ready to receive it, the data is communicated.
For a bridge to work effectively, the two LANs must run on the same platform but the buffer
memory means that they can be running at different speeds.
Router
19
A router does a similar job to a bridge, in that it links two networks, but there is an implication of
a degree of decision making with a router.
It is able to look at a message that is trying to pass from one network to another and read the
header attached to the message.
The router maintains a table with all the hardware addresses of the devices it has a direct
connection.
Routers inspect the data packages sent to it from any computer on any of the networks
connected to it. Since every computer on the same network has the same first part of an
internet protocol (IP) address, the router is able to send the data package to the appropriate
switch and it will then be delivered using the MAC destination address in the data packet.
If this MAC address doesn’t match any device on the network it passes on to another switch on
the same network until the device is found.
Gateway
A gateway is a device that enables LANs to be connected to WAN.
LANs may be operating on different, incompatible platforms.
Gateways use conversion software to ensure that data transmission protocols are compatible
and that dissimilar LANs can connect to WANs.
CSMA/CA
Carrier sense multiple access with collision avoidance
Is a network multiple access method in which carrier sensing is used, but nodes attempt to avoid
collisions by transmitting only when the channel is sensed to be “idle”.
It particularly important for wireless network, where the collision detection of the alternative
CSMA/CD in unreliable due to the hidden node problem (means another node may be
transmitting which goes undetected at this stage).
Is a protocol that operates in the Data Link Layer of the OSI model.
Collision avoidance is used to improve the performance of the CSMA method by attempting to
divide the channel somewhat equally among all transmitting nodes within the collision domain.
1. Carrier Sense: prior to transmitting, a node first listens to the shared medium to determine
whether another node is transmitting or not.
20
2. Collision Avoidance: if another node was heard, we wait for a period of time for the node to
stop transmitting before listening again for a free communication channel.
Token Passing
This method avoids the possibility of collision altogether by assuring that only station can transmit at
any given time. It works as follows:
An electronic token travels from workstation to workstation in the network. (The station that is
switched on first, sends out a token. That station then manages the token. If a token becomes
corrupt, then it gets taken away and another token gets sent out.)
This token contains control signals, including one that states whether the token is free or
whether it is carrying a message.
A workstation that wishes to send a message, grabs the free token as it travels and changes the
status to “busy”. It then adds a message and passes the token on.
The resulting message or frame continues around the network in one direction, passing all
of the other stations along the way.
Included in the message is the address of the workstation to which it is being sent.
Each workstation grabs the token and checks the address information. If it isn’t for it, it passes it
on.
The receiving workstation’s NIC copies the message and returns the message frame to the
sending workstation.
The sender’s NIC removes the message frame from the token and circulates the new free token.
The other workstations now know that they can send a message.
Contention
Is a media access method that is used to share a broadcast medium.
One method to handle collisions in a contention based system is to optimize collision detection and
subsequent recovery.
A collision can be detected by listening to the shared medium immediately after transmitting
and identifying collision characteristics or by capturing data from medium and performing
error detection.
For recovery some systems simply cause senders to retransmit collided data or use error
correction techniques.
An alternative method to handle collision in a contention based system is to attempt to avoid
them.
Some systems may utilize a strict scheduling guideline to identify who may use which
resources when.
Other systems may have the senders listen to the channel immediately prior to transmitting
and determine suitable times to transmit.
A contention can occur in data communications when no station is designed a master station.
In contention, each station must monitor the signals and wait for a quiescent condition before
initiating a bid for master status.
21