Week 12
Data Communication
COS10004 Computer Systems · Lecture 6.1 – Data Communication
THIS LECTURE
- Data Communications
- Serial
- RS-232, USB
- Parity
- Serial versus Parallel
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
Source: https://www.techopedia.com/definition/6765/data-communications-dc
WHY DO WE NEED DATA
COMMUNICATION IN COMPUTER
SYSTEMS?
htp:twww//webopedia..com/TERM/C/computerht.ml
COMPUTER BASIC ARCHITECTURE
ControBUS l
Address BUS
Central
Processing Unt i (CPU)
DATABUS
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)
- 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
There has to be a common ground (often another wire) if sending electricity, but light signals (via fibre optics) do not need a ground.
- Serial Communication: Data send one bit at a time
- RS-232 1 1 1 0 1 0 1 0
- USB
- Parallel Communication: Data sent over a number of lines in parallel 0 1 1 0
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
5 8 CTS Clear to CTS Flow Send
6 6 DSR Data Set Ready Ready
7 5 SG Signal Common Ground RS232 line voltage can be 8 1 CD Carrier Modem Detect connected
- 12 – +12V, 0-12V, 0-5V, 0-3.3V. Data 20 4 DTR Terminal Ready Mixing them up burns out Ready the chips. Ring 22 9 RI Indicator Line Ringing
- 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.
- A basic RS-232 system can just have 3 lines: TxD, RxD & Ground
- When an 8-bit data byte is transmitted:
- the TxD (transmit data) line is pulled low for one period T of the Start bit.
- The 7 bits of data are then sent, beginning with the LSB. *
- 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.
- 19.2k, 57.6k and 115.6k These can be 300, 1200, 2400, 4800, 9600, 10.4k,
- c.f. USB3 = 4800Mbps. * to send more than 7 bits use bit encoding (base64, binHex, 4/9/20 COS10004 Computer Systems uuencode...)
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
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”.
- data sent has even parity. The parity bit is therefore set to logic 1 or 0 to ensure the
- received and if it is not as previously agreed (i.e. even or The receiver of the data can check the parity of the data odd) then an error has occurred and the data can be requested to be sent again.
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
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.
http://en.wikipedia.org/wiki/Universal_Serial_Bus
- 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.
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.
- 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.
- a Ethernet (internet) is the ultimate example of such multidrop serial system of very high speed (bandwidth).
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
Data End of
4/9/20 COS10004 Computer Systems Available Data cycle
DATA COMMUNICATIONS: PARALLEL
DR DT Data 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 Data the data Available Data End of 4 Computer raises DT 1 1 Taken cycle 5 Device sees DT high and lowers 0 1 Computer Peripheral 6 Computer sees DR low and lowers 0 0 Data DT
Computer reads Data
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
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