Data Communication
Data Communication
Integer
(273)10 = 200 + 70 +3 = 2*102 + 7*101 +3*100
Fraction
(0.526)10 = 0.5 + 0.02 + 0.006 = 5*10-1 + 2*10-2 +6*10-3
Chapter 1
Decimal System
(543.67)10 = 5*102 + 4*101 +3*100 + 6*10-1 +7*10-2
(2083.4705)10
= 2*103 + 0*102 + 8*101 +3*100 + 4*10-1 +7*10-2 + 0*10-3 +5*10-4
Why do we use 10 digits, anyway?
Chapter 1
Binary System
It has 2 digits: 0 and 1
It's also known as Base 2 or Radix 2 system
A computer does all of its calcualtions using Binary System
A 0 is analogous to a Switch is OFF
A 1 is analogous to a Switch is ON
A Binary Digits is call a BIT (Binary digIT)
A group of 8 Bits is called a Byte
Examples: 11010010, 10110001, 10001101, etc.
A group of 4 Bits is called a Nibble
Examples: 1101, 0010, 1011, 0001, 1000, 1101, etc.
Chapter 1 5
Why Use Binary Numbers?
° Easy to represent 0 and 1 using
electrical values.
° Possible to tolerate noise.
° Easy to transmit data
° Easy to build binary circuits.
AND Gate
1
0
0
Binary System
Conversion from Binary to Decimal
(101.11)2 = 1*22 + 0*21 +1*20 + 1*2-1 +1*2-2
= 4 + 0 + 1 + 1/2 + 1/4
= 4 + 0 + 1 + 0.5 + 0.25
= (5.75)10
Chapter 1 7
Octal System
It has 8 digits: 0, 1, 2, 3, 4, 5, 6, 7
It's also known as Base 8 or Radix 8 system
Chapter 1 8
Hexadecimal System
It has 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
It's also known as Base 16 or Radix 16 system
Chapter 1 9
Example: Any radix to Decimal Conversion
Hexadecimal
(base16)
° Learn to convert between bases.
° Already demonstrated how to convert
from binary to decimal.
Convert an Integer from Decimal to Another Base
For each digit position:
1. Divide decimal number by the base (e.g. 2)
2. The remainder is the lowest-order digit
3. Repeat first two steps until no divisor remains.
1 1 1 1 1 1 carries
1 1 1 1 0 1
+ 1 0 1 1 1
---------------------
1 0 1 0 1 0 0
Binary Subtraction
° We can also perform subtraction (with borrows in place of
carries).
° Let’s subtract (10111)2 from (1001101)2…
1 10 borrows
0 10 10 0 0 10
1 0
0 1 1 0 1
- 1 0 1 1 1
------------------------
1 1 0 1 1 0
Binary Multiplication
• Binary multiplication is much the same as decimal
multiplication, except that the multiplication
operations are much simpler…
10 1 1 1
X 1 0 1 0
-----------------------
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0
Binary Division
25/5 1 0 1
1 0 1 1 1 0 0 1
1 0 1
0 0 1 0
0 0 0
1 0 1
1 0 1
0 0 0
2 13 5 13 8 13
2 3 --0
1 --1
.75
.5 x2
x2 1 .5
1 .0 x2
1 .0
.513
x8
4 .104
x8
0 .832
x8
6 .656
x8
5 .248
(2 6 1 5 3 . 7 4)8
• Binary to Hexadecimal
(3 0 6 . D)16
(0011 0000 0110 . 1101)2
Ignore
2’s Complement Subtraction
• Using 2’s complement numbers, follow steps for
subtraction
• For example, suppose we wish to subtract +(00000001)2
from +(00001100)2. 0 0 0 0 1 1 0 0
- 0 0 0 0 0 0 0 1
• Let’s compute (12)10 - (1)10.
---------------
• (12)10 = +(00001100)2 = 000011002 in 2’s comp. 2’s
• -(1)10 = -(00000001)2 = 111111112 in 2’s comp. comp
0 0 0 0 1 1 0 0
Add + 1 1 1 1 1 1 1 1
Step 1: Take 2’s complement of 2nd operand ---------------
Step 2: Add binary numbers Final
Result 1 0 0 0 0 1 0 1 1
Step 3: Ignore carry bit
Ignore
Carry
2’s Complement Subtraction: Example #2
• Let’s compute (13)10 – (5)10.
• (13)10 = +(00001101)2 = 000011012 in 2's comp
• -(5)10 = -(00000101)2 = 111110112 in 2's comp
• Adding these two 8-bit codes…
0 0 0 0 1 1 0 1
+ 1 1 1 1 1 0 1 1
---------------
ignore carry
1 0 0 0 0 1 0 0 0
1 0 1 0
1 1 1 1
1 1 1 1
1 0 1 0
° ASCII Codes
° A – Z (26 codes), a – z (26 codes)
° 0-9 (10 codes), others (@#$%^&*….)
° Complete listing in Mano text
° Transmission susceptible to noise
° Typical transmission rates (1500 Kbps, 56.6 Kbps)
° How to keep data transmission accurate?
Parity Codes
• Parity codes are formed by concatenating a parity
bit, P to each code word of C.
• In an odd-parity code, the parity bit is specified so
that the total number of ones is odd.
• In an even-parity code, the parity bit is specified so
that the total number of ones is even.
P Information Bits
1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1
Added even parity bit Added odd parity bit
Parity Code Example
• Concatenate a parity bit to the ASCII code for the
characters 0, X, and = to produce both odd-parity
and even-parity codes.
Character ASCII Odd-Parity Even-Parity
ASCII ASCII
0 0 1 0 1 0 1 1
Binary Cell
Register Transfer
• Data can move from register to register.
• Digital logic used to process data
• We will learn to design this logic
Register A Register B
Digital Logic
Circuits
Register C
Transfer of Information
• Data input at keyboard
• Shifted into place
• Stored in memory
Student
in ECE
Student
Student took 2610 Student
took AND 3300 took
2610 3300
Student
in ECE
Student
Student took 2610 Student
took OR 3300 took
2610 3300
Student
in ECE