0% found this document useful (0 votes)
32 views26 pages

COS10004 Lecture 6.1 Data Communication

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 26

COS10004 Computer Systems

Lecture 6.1 – Data Communication

Dr Chris McCarthy
THIS LECTURE
•  Data Communications
•  Serial
–  RS-232, USB
–  Parity
•  Serial versus Parallel

4/9/20 COS10004 Computer Systems


2
DATA COMMUNICATIONS
What is DATA??
•  DATA refers to information or knowledge.
•  It can be measured, collected, and analysed.
•  It can be visualised via graph, image or other tools

What is COMMUNICATION???
•  COMMUNICATION is the act of conveying intended
meaning from one group to another through the use of
mutually understood signs or other form of activities.
DATA COMMUNICATIONS
•  Data communications is the process of
using computing and communication
technologies to transfer data from one
place to another, and vice versa.

Source: https://www.techopedia.com/definition/6765/data-communications-dc
DATA COMMUNICATIONS MODES
There are three modes of data communication
•  Simplex: Data travels in one direction only
System A System B

•  Half-duplex: Data travel in one direction and


then other direction, but not the same time
System A System B

•  Full-duplex: Data can travel in both directions


at the same time
System A System B

Source: https://www.techopedia.com/definition/6765/data-communications-dc
WHY DO WE NEED DATA
COMMUNICATION IN COMPUTER
SYSTEMS?

http://www.webopedia.com/TERM/C/computer.html
COMPUTER BASIC ARCHITECTURE
Control BUS
Address BUS

Central
Processing
Unit
(CPU)
DATA BUS
DATA COMMUNICATION
•  A computer that sits only talking to itself is
of little use.
•  Computers collect information from the
world around them (probably in analogue
form) or from another computer (in digital
form)
•  Computers send information to the world
around them (probably in analogue form)
or to another computer (in digital form)
4/9/20 COS10004 Computer Systems
8
DATA COMMUNICATION
•  Almost all computer systems need to send or
receive data from other systems or peripherals
•  Such data communications can be sent over a
number of lines in parallel or over a single line as
a serial packet
System 1

System 2

System 1

System 2
There has to be a common ground (often another
wire) if sending electricity, but light signals (via fibre
optics) do not need a ground.
4/9/20 COS10004 Computer Systems
9
DATA COMMUNICATION
•  Serial Communication: Data send one bit at a
time
•  RS-232

System 1

System 2
11101010
•  USB

•  Parallel Communication: Data sent over a number


of lines in parallel
0

System 2
System 1
1
0
1
0

4/9/20 COS10004 Computer Systems


10
RS-232 SERIAL COMMUNICATIONS
25 Pin 9 Pin Sign Name Signal
http://www.arcelect.com/rs232.htm
2 3 TxD Transmit PC Out

3 2 RxD Receive PC In

4 7 RTS Req to Send RTS Flow

Clear to
5 8 CTS CTS Flow
Send

Data Set
6 6 DSR Ready
Ready

Signal
7 5 SG Common
Ground

Carrier Modem
RS232 line voltage can be 8 1 CD
Detect connected
-12 - +12V, 0-12V, 0-5V,
Data
0-3.3V. 20 4 DTR Terminal Ready
Mixing them up burns out Ready
the chips. Ring
22 9 RI Line Ringing
Indicator
4/9/20 COS10004 Computer Systems
11
RS-232 SERIAL COMMUNICATIONS
•  Originally designed for teletypes, adapted to
acoustic modems, modems and input devices
(incl. mice).

•  Sends data in single-byte packets in


asynchronous mode (1 bit at a time).

•  Asynchronous means the two systems are


not synchronised with a common clock.
Therefore the two systems must have agreed
on the rate at which data is sent between
them.

4/9/20 COS10004 Computer Systems


13
RS-232 SERIAL COMMUNICATIONS
•  A basic RS-232 system can just have 3 lines:
TxD, RxD & Ground
•  When an 8-bit data byte is transmitted:
1.  the TxD (transmit data) line is pulled low for one
period T of the Start bit.
2.  The 7 bits of data are then sent, beginning with the
LSB. *
3.  One or two Stop bits follow the data, to ensure a gap
before the next byte is sent (see next slide).
•  Data is sent at one of several standard baud
rates (bits/second) as agreed between the
transmitter and receiver.
–  These can be 300, 1200, 2400, 4800, 9600, 10.4k,
19.2k, 57.6k and 115.6k * to send more than 7
–  c.f. USB3 = 4800Mbps. bits use bit encoding
(base64, binHex,
4/9/20 COS10004 Computer Systems uuencode...)
14
RS-232 SERIAL COMMUNICATIONS

Note: Actual signal transmitted is (usually) inverted, so logic 1 is


a low voltage and logic 0 is a high voltage, over a ±12V range

M = 77 = 4D = 100 1101 – send little bits first

4/9/20 COS10004 Computer Systems


15
RS-232 SERIAL COMMUNICATIONS:
PARITY
•  Sending data is always subject to electrical
interference or noise that can cause a bit to be
misread.
•  Parity is a simple means to identify such single-bit
errors. The Parity bit is the last bit sent (before the
Stop bit)
–  Parity can be ‘even’ or ‘odd’.
–  Even parity means that:
“the number of logic 1 bits sent (not including the
Start bit but including the parity bit) must be an
even number”.
–  The parity bit is therefore set to logic 1 or 0 to ensure the
data sent has even parity.
–  The receiver of the data can check the parity of the data
received and if it is not as previously agreed (i.e. even or
odd) then an error has occurred and the data can be
requested to be sent again.
4/9/20 COS10004 Computer Systems
16
RS-232 SERIAL COMMUNICATIONS
•  Commands, text and inputs are terminated with
either a line feed (LF or ASCII 10), Carriage
Return (CR or ASCII 13) or both depending on
the hardware and software. 7-bit binary
–  Programming languages abstract this to ‘\n’
•  What would the data stream look like for a CR
character? (ASCII13 = ___________
(0)0001101 in binary)
13 00001101

1 0 1 1 0 0 0 1

4/9/20 COS10004 Computer Systems


17
DATA COMMUNICATIONS: USB
•  Developed at Intel to overcome cumbersome
peripheral connectivity issues
•  Became popular from 1998 (USB 1.1). 12
Mbps data transfer rates. 4 lines: (D-/D+ for
ddata, 5V and 0V.

4/9/20 COS10004 Computer Systems


http://en.wikipedia.org/wiki/Universal_Serial_Bus 18
4/9/20 COS10004 Computer Systems
19
DATA COMMUNICATIONS: USB

•  USB 2.0 introduced ~ 2001, with higher


data transfer rates up to 480 Mbps.
•  USB 1 and 2 have a cable length limit of
5m.
•  Standard also defines complex protocols for
number of devices on any connection and
specific types of devices.
•  USB 3 allows for a 10 x improvement in
data transfer, up to 4800 Mbps.

4/9/20 COS10004 Computer Systems


20
DATA COMMUNICATIONS
•  There are also many different standards for
serial communications
–  Over the past 10 years the USB (Universal Serial
Bus) has become the most popular standard
–  Other general-purpose high-speed serial
interfaces include Firewire (IEEE1394),
Thunderbolt (PCIe+video).
–  For many decades the RS-232 serial interface
was the standard. This is still used everywhere,
mostly as a legacy issue, but also for its relative
simplicity.
•  PC Com ports, Galileo, RPi, Arduino,
ESP8266 and LoRa boards all support RS232
•  USB to RS232 is easy to implement in hardware.
4/9/20 COS10004 Computer Systems
21
DATA COMMUNICATIONS
•  It is also possible for many systems to be
connected to a common serial
communications line.
–  Most systems would spend their time waiting for
data intended for them, probably indicated by
some preceding data byte that indicated the target
system.
–  Such systems are known as ‘multidrop’ systems
as the data line is ‘dropped’ to multiple systems
simultaneously.
–  Ethernet (internet) is the ultimate example of such
a multidrop serial system of very high speed
(bandwidth).

4/9/20 COS10004 Computer Systems


22
DATA COMMUNICATIONS: PARALLEL
•  Multiple bit at the same time
•  As the two device running asynchronously to
each other, flow control or handshaking is
necessary to be able to communicate
•  Handshake: a device puts a line up when
device is ready with data and waits for the
interrogating device to take the data
Data

Peripheral
Computer
Data End of
Available Data cycle
4/9/20 COS10004 Computer Systems
Taken 23
DATA COMMUNICATIONS: PARALLEL
DR DT Data

Peripheral
Computer
1 Device places data onto data bus 0 0
when Data Taken (DT) is low
2 Device raises Data Ready (DR) 1 0
3 Computer sees DR high and takes 1 0
the data Data End of
Available Data cycle
4 Computer raises DT 1 1 Taken
5 Device sees DT high and lowers 0 1
DR Computer Peripheral
1
6 Computer sees DR low and lowers 0 0 Data
DT
2 5
Data Ready
4
6
Data Taken
3
4/9/20 COS10004 Computer Systems
Computer reads Data
24
DATA COMMUNICATIONS
Parallel Serial
•  Fast, whole data word •  Slower, all data word
transmitted at once transmitted one bit at
•  Only good over short a time
distances: expensive •  Good over short and
and bulky cables; long distances; less
cross-interference; cross-interference;
cheaper cables

4/9/20 COS10004 Computer Systems


25
SUMMARY
•  Data communication:
–  The transfer of Data
•  Simplex, Half-Duplex, Full-Duplex
•  Serial Data Transfer:
–  One bit at a time
•  RS-232, USB, Ethernet
–  Parity ensures data integrity on serial lines
•  Serial versus parallel:
–  Serial now generally preferred
4/9/20 COS10004 Computer Systems
26

You might also like