HND
and ACCESS Lecture 9 Interactive Notes
CONTENTS
Link to RNIB
links
Abbreviations
Decimal numbering
Computer numbers
Binary word
Binary in a computer
Character sets
Summary (dec, binary, octal
and hex)
Multiplication factors and
prefixes
Units of storage
Serial and Parallel Interfaces
Transfer of data (Synchronous
/ Asynchronous)
Causes of errors
Error detedtion and correction
Parity
Flow control
Communication standards
RS232
RS232 encoding
TRANSMISSION AND RECEPTION
OF DATA Go to Contents
Binary data
Serial vs parallel
Error control and flow control
Example: RS-232
Abbreviations: Tx - Transmitter
or Transmission Rx - Receiver
or Reception
NUMBERS IN THE COMPUTER
Go
to Contents
Humans have 10 fingers: count in DECIMAL
DECIMAL:
Q Base 10
Q Use 10 digits: 0,
1, 2, 3, 4, 5, 6, 7, 8, 9
Q Example of number:
= 5 x 1000 + 3 x 100 + 0 x10 + 4
x 1
= 5,30410 Q
Note:
| 1
10
100
1000
10,000 |
=
=
=
=
=
|
10°
101;
102;
103;
104
etc... |
NUMBERS IN THE COMPUTER
Go
to Contents
Computers deal with numbers using BINARY
BINARY:
Q Base 2
Q Written with only
2 digits: "0" and "1"
Q Example of number:
= 1 x 8 + 0 x 4 + 1 x 2 + 1
x 1
= 10112
Q Note:
| 1
2
4
8
16 |
=
=
=
=
=
|
20
21;
22;
23;
24
etc... |
BINARY Go
to Contents
-
Binary numbers written as groups of
-
Binary Digits ("Bits")
-
Value of bits:
Q Right-hand bit = 1
Q Next on left = 2
Q Next on left = 4 etc...
-
Bit on right-hand side: "Least Significant Bit"
-
Bit on left-hand side: "Most Significant Bit"
-
Using n bits can
represent 2n different combinations
e.g. 2 bits Õ
22;
= 4 combinations
4 bits Õ
24 =
16 combinations
8 bits Õ
28 =
256 combinations
-
Computers deal with Bits, usually in groups of 4:
Q 8 bits = 1 byte
Q 4 bits = 1 nybble
BINARY IN THE COMPUTER Go
to Contents
-
Everything in the Computer is represented as Binary Numbers
-
8-bit binary number can represent numbers 0 .. 255
Q Only whole numbers ("integers")
-
Range of numbers represented extended by "Floating Point"
representation
Q Standard formats exist
(eg. IEEE 754)
Q Includes fractional
numbers
Q Uses several bytes
(typically from 4 to 10)
Q Large range: (IEEE
754 approx. 10-38 to 10+38)
-
Can also be codes for Letters, Punctuation etc.
Q eg.
"A" = 0, "B" = 1, ... "Z" = 25,
"£" = 26, "%" = 27, " ," = 28 ...
BUT: Needs to be standard set of codes
CHARACTER
SETS Go to Contents
-
ASCII - American
Standard Code for Information Interchange
Q a.k.a ISO 646-1973 (international)
BS 4730: 1974 (British Standard)
Q 7-bit code (128 different
characters)
Q Numerals, punctuation
and letters
Q American alphabet...
... no symbols for £,
¥,
é,
ö,
å,
ñetc.
Q Still VERY widely used
-
EBCDIC - Extended Binary-Coded-Decimal
Interchange Code
Q Proprietary to IBM
Q 8-bit code
Q Not compatible with
ASCII
Q 8-bit code
Q Extension to ASCII
(ASCII is compatible)
Q Has characters for
European languages
-
Future - include all characters from all languages
(!)
Q Unicode
(16 bits)
Q ISO 10646 (32 bits)
SUMMARY Go
to Contents
|
Decimal
|
Binary |
Octal
|
Hex
|
|
(base 10)
|
(base 2) |
(base 8)
|
(base 16)
|
|
0
|
0000 |
0
|
0
|
|
1
|
0001 |
1
|
1
|
|
2
|
0010 |
2
|
2
|
|
3
|
0011 |
3
|
3
|
|
4
|
0100 |
4
|
4
|
|
5
|
0101 |
5
|
5
|
|
6
|
0110 |
6
|
6
|
|
7
|
0111 |
7
|
7
|
|
8
|
1000 |
10
|
8
|
|
9
|
1001 |
11
|
9
|
|
10
|
1010 |
12
|
A
|
|
11
|
1011 |
13
|
B
|
|
12
|
1100 |
14
|
C
|
|
13
|
1101 |
15
|
D
|
|
14
|
1110 |
16
|
E
|
|
15
35
|
1111
10 0011 |
17
43
|
F
23
|
|
100
255
|
110 0100
1111 1111 |
144
377
|
64
FF
|
STANDARD MULTIPLICATION
FACTORS AND PREFIXES Go to Contents
|
Multiplier
|
|
|
Prefix
|
Symbol
|
| 1 000 000 000 000
1 000 000 000
1 000 000
1 000
0.001
0.000 001
0.000 000 001
0.000 000 000 001 |
=
=
=
=
=
=
=
=
|
1012
109
106
103;
10-3;
10-6
10-9
10-12 |
tera
giga
mega
kilo
milli
micro
nano
pico |
T
G
M
k
m
m
n
p
|
Units of Storage
| 1 binary digit |
= 1 bit |
| 4 bits |
= 1 nybble |
| 8 bits |
= 1 byte |
| 1 kilobyte
(1k) |
= |
210 bytes = 1024 bytes |
| 1 Megabyte (1Mb) |
= |
220 bytes = 1024 kbytes |
| 1 Gigabyte (1Gb) |
= |
230 bytes = 1024 Mbytes |
| 1 Terabyte (1Tb) |
= |
240 bytes = 1024 Gbytes |
SERIAL/PARALLEL INTERFACES
Go
to Contents
-
Data transferred between computer and peripheral (or another
computer) goes through an Interface
-
Interface may be Serial or Parallel
Serial
-
Data transferred over single wire
-
1 bit at a time
Parallel
-
Data transferred over group of wires
-
Several bits at a time
TRANSFER OF DATA Go
to Contents
-
Interface usually has 2 types of signals:
Q Data signals (the "information")
Q Control signals: synchronization
-
Transfer of Data may be Synchronous or
Asynchronous
Q Data transfer Synchronized
to a Clock signal
Q Transfer rate is limited
by speed of Clock
Q No Clock - Data transfer
controlled by logic
signals (e.g.
Strobe/Acknowledge)
Q Transfer rate limited
by speed of devices
Both Parallel and Serial interfaces may be
Synchronous or Asynchronous
ERROR CONTROL Go
to Contents
Errors may be caused by…
-
Noise (crosstalk, EMI
(electro-magnetic interference), etc.)
-
Mistakes in Tx/Rx, e.g. Tx sends data faster than
RX can receive it - "over-run" (data are lost)
-
Effect of noise is overcome using error detection and correction
techniques
-
Over-runs etc. are avoided using Flow
Control techniques
ERROR DETECTION AND CORRECTION
Go
to Contents
-
Detect errors by adding "redundant" information which is
about the original data e.g. after sending a long list of numbers, may
send a "checksum" (total of all the numbers added together) as a way of
cross-checking
-
In general, error detection schemes are not foolproof!
-
Common, simple technique: Parity
PARITY Go
to Contents
Two types: Odd Parity and Even Parity
-
When sending a byte, Tx sends one extra bit (the "parity
bit") which will be
-
1 if the number of 1's in the byte is even
-
0 otherwise
-
(i.e. parity bit is set so as to make the number of 1's
odd)
-
Rx then counts the number of 1's and knows it should be an
odd number. If it isn't, an error occurred
-
Even parity works the same except there should always be
an even number of 1's
FLOW
CONTROL Go to Contents
Function performed by Receiver to control data stream
sent by Transmitter
Hardware Flow Control
-
Use Control Signals in the interface
-
Rx tells Tx "ready" or "not ready" for data
-
Tx only sends when Rx is ready
Software Flow Control
-
Rx sends Control Characters to Tx
-
Control chars mean "ready" or "not ready"
-
Tx only sends when Rx is ready
As long as Tx only sends data when Rx is ready, no data should
be lost
Example
Software Flow Control: "XON/XOFF
"protocol
-
Rx sends "XON" character (ASCII 17, ctrl-Q)
when ready for data
-
Rx sends "XOFF" character (ASCII 19, ctrl-S)
when not ready
COMMS STANDARD: RS-232C Go
to Contents
QTerminal
QPrinter
QComputer
-
DCE: Data Circuit-Terminating
Equipment
Q Converts serial data stream
into form suitable for transmission down line (usually modem)
-
RS-232 also used for connecting
Q Computers to computers
Q Terminals to computers
Q Computers to printers,
mice etc.
RS-232C/V.24
SERIAL INTERFACE Go to Contents
-
Consider characteristics defined by the standard
Q Mechanical
Q Electrical
Q Functional
Q Procedural
Mechanical
Q 25 pin "D connector"
DCE: Female, DTE:
Male
Electrical
Q "0" is any voltage from
+3 to +25V
Q "1" is any voltage
from -3 to -25V
Q Region from -3 to
+3V is "undefined"
Q Tx/Rx may be Synchronous
or Asynchronous
Q Transmission speed
is 0 - 20kbps
Q Max cable length 15m
-
Defined standard rates: 75, 110, 300, 600, 1200, 2400, 4800,
9600, 19200 bps.
(unofficial, but common: 38400, 57600, 115200)
-
Functional: What do the pins/signals mean?
-
Procedural: rules for Establishing connection, Exchange of
data, Closing connection
RS-232 ENCODING Go
to Contents
-
Data Bits: 5, 6, 7 or 8 bits
-
Optional Parity Bit
-
Start Bit: "Here come the data bits"
-
Stop Bits: 1, 1½ or 2 bits
-
Line remains in "idle state" (1) between characters (asynchronous,
so times will vary)
-
Transition from idle to 0 indicates start of character: start
bit
-
Rx must know number of data bits to read, plus data transfer
rate
-
Rx reads data bits, then parity
-
Tx returns signal to idle state for a minimum time before
next character: "stop bits"
Windows 95
Start - Settings - Control panel - Modem - Properties
- Connections to see range of setting options when setting up a modem
© Chris Hand, cph@dmu.ac.uk