1 Computer Organization and Data Representation
1.1 Computer Organization
1.1.1 Number Systems
1.1.2 Pre-mechanical Computing
1.1.3 Mechanical Computing
1.1.4 Digital Computing
1.1.5 Data Communication and Data Networks
1.2 Base Conversion
1.2.1 Converting from any base to base 10
1.2.2 Converting from base 10 to any other base
1.3 Data Representation
1.3.1 Representation of Positive Integer Numbers
1.3.2 Representation of Negative Integer Numbers
1.3.3 Representation of Floating Point Numbers
1.3.4 Representation of Character Strings
IENG 331: Ahluwalia 1
1.1 Computer Organization
1.1.1 Number Systems
1.1.2 Pre-mechanical Computing
1.1.3 Mechanical Computing
1.1.4 Digital Computing
1.1.5 Data Communication and Data Networks
IENG 331: Ahluwalia 2
Counting Systems
1-5 13-17
Finger Counting
29-33 18-22
Finger & Toe Counting
IENG 331: Ahluwalia 3
Counting on Fingers
No need to keep records (no zero)
IENG 331: Ahluwalia 4
Non-Positional Number Systems (no zero)
Babylonia Numerals (~4000 BC2000 BC)
Egyptian Numerals (~3000-1000 BC)
Early Greek Numerals (~2000-500 BC) Recent Greek Numerals
IENG 331: Ahluwalia 5
Roman Non-Positional (no zero)
(~400200 BC)
Seven symbols
Symbols Value
Kind of base 5
I 1
Symbols II 2
III 3
Symbols Value Addition in Roman Numerals
IV 4
I 1 264 CCLXIV
V 5
V 5 + 650 DCL
VI 6
X 10 + 1080 MLXXX
VII 7
L 50 VIII 8
+ 1807 MDCCCVII
C 100 IX 9 = 3801 MMMDCCCI
D 500 X 10
M 1000
IENG 331: Ahluwalia 6
Positional System (with a zero)
Mayan Symbols (~1000 50 BC)
It was a combination of
base 5 (fingers on a
hand) and base 20
(fingers and toes).
IENG 331: Ahluwalia 7
Indian Symbols (~1000 BC - present)
Positional notation with a zero
Sanskrit Symbols
(~1000 BC)
Shape of the symbols may
have been based on angles
IENG 331: Ahluwalia 8
Chinese Symbols
Symbol Symbol
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
IENG 331: Ahluwalia 9
Pre-mechanical Computing
Hash mark symbols
Other symbols
used for counting
used for counting
IENG 331: Ahluwalia 10
Mechanical Computing
Early Computing Tool - Abacus
~ 3000 BC Abacus developed in China
~ 1000 BC Abacus was used in Asia and Europe
Still widely used in many parts of the world
IENG 331: Ahluwalia 11
Napiers Bones and Logarithms (1617)
John Napier (Scottish mathematician) created a device
for multiplication, division, square roots, and cube
roots, based on the positional number system
The device consists of a board with a rim of 9 squares
(1 9) and ten rods (0 - 9)
Napier also developed tables of logarithms
IENG 331: Ahluwalia 12
Oughtreds Slide Rule (1621-1623)
Circular slide rule Linear slide rule
~1622 William Oughtred , an English clergyman, invented
the slide rule (based on logarithms).
It could add, subtract, multiply, divide, compute roots,
logs, exponents, and trig functions.
Slide rule was the main computing device for engineering
students till 1980.
IENG 331: Ahluwalia 13
Pascals Adder (1642-1645)
Blaise Pascal, a French mathematician, built the first
mechanical adding and subtracting machine for his
father (a tax collector), at age 13.
It could add and subtract by rotating dials
It had 4, 6, or 8 dials.
Subtraction was done by adding 9s complement.
IENG 331: Ahluwalia 14
Leibnizs Adder (1674)
Gottfrierd Wilhelm von Leibniz, a German
mathematician , developed a four function
(add, subtract, multiply, and divide) calculator
IENG 331: Ahluwalia 15
Jacquards Weaving Loom (1804)
Preparing the cards Punched card controlled looms
Joseph-Marie Jacquard, a French textile weaver,
used punched cards to control his loom
IENG 331: Ahluwalia 16
Babbages Difference and Analytical Engines
(1823-47)
Difference Engine Analytical Engine
Regarded by many as Father of modern Computers
In 1823 British government gave a grant of 17,000 (~$27,000) to
Charles Babbage, an English mathematician to develop the Difference
engine, to tabulate polynomial functions.
The development was delayed. It was cancelled in 1842
During 1847-1849, Babbage went on to design a more general analytical
engine. It was never built due to lack of funds and precision
manufacturing.
IENG 331: Ahluwalia 17
Lady Augusta Ada
First Computer Programmer
Lady Augusta Ada, Countess of Lovelace, an
English mathematician, helped Babbage with
documenting and programming his Engines.
Regarded by many as the first computer
programmer.
A programming language (Ada) was named after
her.
IENG 331: Ahluwalia 18
Analytical Engines Architecture
The Mill: To perform number crunching (+, -, *, /)
The Store: To store formula and results
Operation punched cards: Specification of the operation
(+, -, *, /) to be perform by the mill
Variable punched cards: Specification of memory location
(Store) to be used for the operation
Output: Print or punch the results.
IENG 331: Ahluwalia 19
Holleriths Tabulating Machine
1880 US census took 9 years to compile, 1890 US census was
expected to take 12 years. Herman Hollerith, a census bureau
employee, used punched cards (from Jacquards loom) to tabulate
and process census data.
1890 census was done in one year. In 1896, he founded the
Tabulating Machine Co., which became Computer Tabulating
Recording Co. in 1913. After several mergers and acquisitions, it
was renamed as International Business Machines (IBM) in 1924.
IENG 331: Ahluwalia 20
Digital Computing
Mathematical Foundation by
Alan Turing (1936)
In 1936, Alan Turing, an English mathematician
proved that a machine capable of processing 1s
and 0s, can solve any problem whose solution
follows a defined method (i.e. An algorithm)
It laid the theoretical foundation for electronic
digital computing.
IENG 331: Ahluwalia 21
Electro-Mechanical Computing
Atanasoff-Berry Computer (ABC)
In 1939, John Vincent Atanasoff, Physics professor at Iowa State
University, hired Clifford Berry, an electrical engineering student
to develop a digital computer using the binary number system
(based on Turings work).
The machine was built, but the patent was not filed because
Atanasoff joined the Navy for the WWII effort.
ABC computer used vacuum tubes (for relays), punched card
(for input), and a memory device (for instruction storage).
IENG 331: Ahluwalia 22
Howard Aikens Mark I (1944)
IBM gave a grant to Howard Aiken, professor of
Physics at Harvard to built an electro-mechanical
computer (Mark I).
It was based upon mechanical relays.
It weighed 35 tons, with 500 miles of wiring
Regarded as first realization of Babbages engines
IENG 331: Ahluwalia 23
ENIAC: Electronic Numerical
Integrator and Calculator
John Mauchly and J. Presper Eckert, engineering
professors at Univ. of Pennsylvania, built ENIAC for WWII
It was completed in 1946. It had 18,000 vacuum tubes.
Weighed 30 tons. Filled a 50 x 30 room.
Did 5,000 additions/sec. Programmed by patch panel.
Its design was based on the ABC computer
Mauchly and Echert established UNIVAC Corp.
IENG 331: Ahluwalia 24
Von Neuman Architecture
Store
Mill
John Von Neumann, Hungarian-American mathematician,
collaborated with Mauchly and Echert on ENIAC project.
He developed the stored program concept, i.e. Data
and program are stored in primary computer memory.
Modified ENIAC (EDVAC-Electronic Discrete Variable
Automatic Computer) was built on the store program
concept and delivered in 1949.
IENG 331: Ahluwalia 25
The first computer bug
Dr. Grace Murray Hopper, US Rear Admiral, used Aikens
Mark I computer for gunnery and ballistic calculations.
One day the program gave incorrect results, upon
examination, a moth was found blocking a relay. The
program worked after the bug was removed.
New term was coined, debugging a program.
IENG 331: Ahluwalia 26
UNIVAC Computer - Cost $1,801,035 (1968)
Same computing power as a modern calculator
IENG 331: Ahluwalia 27
Cost of a Lightning fast Desktop Computer (1989)
Processor: Intel 80386
Speed: 20 MHz
Memory: 2 MB
Cost: $8, 499 (~17k today)
Without Monitor,
Keyboard, or Mouse
IENG 331: Ahluwalia 28
Development of Transistor
In 1948, William Shockly of Bell Labs developed a
transistor.
During the 1950s and 1960s, IBM, UNIVAC and
other computer manufacturers replaced vacuum
tube with transistors.
Transistor were smaller in size, more reliable, and
faster than a vacuum tube.
Computers therefore became smaller, more
reliable, and faster.
IENG 331: Ahluwalia 29
Computer Hardware Evolution
2. Transistor 3. Integrated Circuits 4. Large/Very Large Scale
1. Vacuum Tube
(1950s) (1960s) Integrated Circuits
(1940s)
(1970s)
6. Global Networks
5. Parallel Processing (1990s) 7. Single Chip Computers
(1980s) (2000s)
IENG 331: Ahluwalia 30
Microprocessor CPUs (1979-2004)
IENG 331: Ahluwalia 31
Memory Capacity
(Single Chip DRAM)
size
1000000000
Year Size(Mb) Cycle time
100000000
1980 0.0625 250 ns
10000000 1983 0.25 220 ns
1986 1 190 ns
Bits
1000000
1989 4 165 ns
100000 1992 16 145 ns
1996 64 120 ns
10000
2000 256 100 ns
1000
1970 1975 1980 1985 1990 1995 2000
Year
IENG 331: Ahluwalia 32
Processor Performance
Trends
1000
Supercomputers
100
Mainframes
10
Minicomputers
Microprocessors
1
0.1
1965 1970 1975 1980 1985 1990 1995 2000
Year
IENG 331: Ahluwalia 33
Computers vs. Cars
(A Hypothetical Comparison)
If car engines developed at the pace of computers, then
~ Engine size would be < .1
~ Car would give 120, 000 mpg
~ Car would have top speed of 240,000 mph
~ Car would cost $4.0
However,
Car would stop for no reason
For every new car the user would have re-learn driving
There will be a single warning, The car performed an illegal
function
Shutting down and restarting the car would clear all warnings.
IENG 331: Ahluwalia 34
Computer Hardware/Software Evolution
Decades Hardware Software
1. (1940s) Vacuum tube (Large) Programming by wires and machine language.
2. (1950s) Transistor & diodes, The term software was created. First operating
core memory. system was developed. Machine or assembly
(Large computers) language programming .
3. (1960s) Integrated Circuits High level programming languages (C, Fortran,
(IC). (Large, mini) COBOL, etc. ). Interactive computing, ASCII code
4. (1970s) Large Scale IC (LSI, UNIX OS. Graphic applications, domain specific
VLSI). (Large, mini) languages (LISP for AI, SQL for databases). Networks
5. (1980s) Parallel processing MS DOS, Mac OS, programming languages (BASIC)
(Large, mini, and and games for PC. VisiCal & Lotus (spreadsheet) for
micro computers) PC & Apple II
6. (1990s) Global Networking MS Windows OS, Office, WWW, PHP, Javascript
7. (2000s) Computers on a chip Graphic games, Networking, multimedia
Trend: Speed, Memory Capacity, and Reliability up.
Cost, Size, and Power Consumption down.
IENG 331: Ahluwalia 35
Computer Classification
1. Super Computers 2. Mainframe Computers 3. Server Computers
Personal Computers
4. Desktops 6. Tablets
5. Laptops 7. Smart Phones
IENG 331: Ahluwalia 36
Personal Computer Organization
CPU: Central Processing Unit
Main/Primary Memory: ROM, RAM
External/Secondary Memory: Hard disk, Flash drive, CD, etc.
Input Device: Keyboard, Mouse, Stylus, Voice, etc.
Output Device: Monitor, Printer, Audio, etc.
IENG 331: Ahluwalia 37
Personal Computer Peripherals
IENG 331: Ahluwalia 38
Personal Computer Evolution
1975 IBM 1975 Altair 1976 PET 1976 Steve 1977 Apple II
5100 PC (55 lbs, 8800 with BASIC Commodore Altair Jobs and Steve with BASIC and
5 CRT, 64KB interpreter by 8800 with MS Wozniak Apple I Apple DOS
RAM, 1.9 MHz) Microsoft BASIC interpreter
1981 IBM 1984 Apples Lisa
5150 PC with 1994 Power
and Macintosh 1998 iMac 2010 iPad
Microsoft DOS Mac G5
IENG 331: Ahluwalia 39
Personal Computer Components
Bill Gates (1976) Steve Jobs and Steve
Wozniak (1976)
CPU
Hard Drive
Memory
Android Computer System
Hard Drive Platter 40
Motherboard
IENG 331: Ahluwalia
Memory Hierarchy
Larger Faster
IENG 331: Ahluwalia 41
Bits (b) and Bytes (B)
1 byte = 8 bits
When Referring to Bytes (as in computer memory)
Kilobyte (KB) 210 = 1,024 bytes
Megabyte (MB) 220 = 1,048,576 bytes
Gigabyte (GB) 230 = 1,073,741,824 bytes
Terabyte (TB) 240 = 1,099,511,627,776 bytes
When Referring to Bits Per Second (as in transmission rates)
Kilobit per second (Kbps) = 1000 bps (thousand)
Megabit per second (Mbps) = 1,000,000 bps (million)
Gigabit per second (Gbps) = 1,000,000,000 bps (billion)
Terabit per second (Tbps) = 1,000,000,000,000 bps (trillion)
Note: Multiplier for bits and bytes is different
IENG 331: Ahluwalia 42
Base 10 Numbers
Thousand Kilo (K) 103 = 1,000
Million Mega (M) 106 = 1,000,000
Billion Giga (G) 109 = 1,000,000,000
Trillion Tera (T) 1012 = 1,000,000,000,000
Quadrillion Peta (Q) 1015 = 1,000,000,000,000,000
Quintillion Exa(E) 1018 = 1,000,000,000,000,000,000
Sextillion Zetta (Z) 1021 = 1,000,000,000,000,000,000,000
Septillion Yota (Y) 1024 = 1,000,000,000,000,000,000,000,000
IENG 331: Ahluwalia 43
Byte Multipliers
Kilobyte (K) 210 = 1,024 bytes
Megabyte (M) 220 = 1,048,576 bytes
Gigabyte (G) 230 = 1,073,741,824 bytes
Terabytes (T) 240 = 1,099,511,627,776 bytes
Petabytes (P) 250 = 1,125,899,906,842,624 bytes
Exabytes (E) 260 = 1,152,921,504,606,846,976 bytes
Zettabytes (Z) 270 = 1,180,591,620,717,411,303,424 bytes
Yottabytes (Y) 280 = 1,208,925,819,614,629,174,706,176 bytes
IENG 331: Ahluwalia 44
Some Computer Acronyms
ISP Internet Service Provider UPS Uninterruptable Power Supply
CPU Central Processing Unit BIOS Basic I/O System
OS Operating System USB Universal Serial Bus
ISA Industry Standard Architecture ROM Read Only Memory
IDE Integrated Drive Electronics RAM Random Access Memory
DMA Direct Memory Access HDD Hard Disk Drive
LAN Local Area Network DVD Digital Video Disk
WAN Wide Area Network CRT Cathode Ray Tube
MODEM Modulator/Demodulator LCD Liquid Crystal Display
NIC Network Interface Card PNP Plug and Play
IP Internet Protocol DVI Digital Video Interface
TCP Transmission Control Protocol IC Integrated Circuit
NAS Network Attached Storage VLSI Very large scale IC
MAR Memory Address Register MDR Memory Data Register
IENG 331: Ahluwalia 45
Execution of Application Program
Operating Application
System Program
Load application program from external
memory (Hard disk, CD, Flash drive) to main
memory (RAM)
Transfer control to the application program
(Run, Debug)
Upon end of application, transfer control to OS
IENG 331: Ahluwalia 46
Primary Memory Organization
(16 bit Computer)
Example: A four bit MAR can reference up to 16 memory location.
MDR is used to transfer one word from/to CPU
MAR (4 bits) Memory Organization
3 2 1 0 Address 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0
0 0 0 1 1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
Memory Data Register (16 bits)
CPU 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
IENG 331: Ahluwalia 47
Memory Contents
Address Label
Primary memory is organized as a Contents
000 (0) X
table 0000 1010 (10)
Each memory location has address, 001 (1)
0000 1000 (8) Y
contents, and an associated label. 010 (2) Sum
0001 0010 (18)
Not all memory addresses have a label.
011 (3) Dif
Memory holds system software, 0000 0010 (2)
100 (4)
application software, and data. 0000 0000
Memory Address Register (MAR) holds 101 (5)
0000 0000
the address of a memory location. 110 (6)
0000 0000
111 (7)
0000 0000
Example: Word size = 8 bits, total
memory = 8 words. MAR = 3 bits
IENG 331: Ahluwalia 48
Common Bases
Base 2 (Binary) used by digital computers.
Base 10 (Decimal) used by humans
Base 8 (Octal) used by humans to display binary data
Base 16 (Hexadecimal) used by humans to display
binary data.
Other Bases
Quinary (base 5): Developed because of five fingers
on one hand. Used by Mayans
Duo-decimal (base 12): Used to represent months.
Sexa-gesimal (base 60): Used to represent time,
angles, and geographic coordinates.
IENG 331: Ahluwalia 49
Bases and their names (Hyphen added for clarification)
Base Name Base Name
2 Bi-nary 17 Septn-decimal
3 Ter-nary 18 Octo-decimal
4 Quater-nary 19 Nana-decimal
5 Qui-nary 20 Vigesimal
6 Se-nary 21 Uno-vigesimal
7 Sept-nary 22 Duo-vigesimal
8 Octal 23 Trio-vigesimal
9 No-nary 24 Quadro-vigesimal
10 Decimal 25 Penta-vigesima
11 Uni-decimal 26 Hexa-vigesimal
12 Duo-decimal 27 Hepto-vigesimal
13 Tri-decimal 28 Octo-vigesimal
14 Tetra-decimal 29 Navo-vigesimal
15 Penta-decimal 30 Tri-gesimal
16 Hexa-decimal .. ..
IENG 331: Ahluwalia 50
Base 10 Number Example
1 2 3, 4 5 6, 7 8 9, 0 4 1
Units
a = {0,1,2,3,4,5,6,7,8,9}
b = 10
Tens
Hundreds
Thousands
Ten Thousands
Hundred Thousands
Million
Ten Millions
123456789041 = 1*1011 + 2*1010 + 3*109
Hundred Millions
+ 4*108 + 5*107 + 6*106 + 7*105 + 8*104
Billions + 9*103 + 0*102 + 4*101 + 1*100
Ten Billions
Hundred Billions
IENG 331: Ahluwalia 51
Decimal Octal Hex Binary Base 2, 8, 10, & 16
0 0 0 0000
1 1 1 0001
2 2 2 0010
Symbols or digits Base
3 3 3 0011
(a) (b)
4 4 4 0100
5 5 5 0101 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 10
6 6 6 0110
0, 1 2
7 7 7 0111
8 10 8 1000 0, 1, 2, 3, 4, 5, 6, 7 8
9 11 9 1001
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16
10 12 A 1010
11 13 B 1011
A, B, C, D, E, F
12 14 C 1100
13 15 D 1101 Humans use base 10
14 16 E 1110
Computers use base 2
15 17 F 1111
IENG 331: Ahluwalia 52
Base Conversion
Number Representation in Positional Notation
aibi. + a2b2 + a1b1 + a0b0 + a-1b-1 + a-2b-2 + a-jb-j
Decimal point
Digits to the right of decimal point represent fractions
i
ak b
k j
k a = Symbols (digits)
b = Base
IENG 331: Ahluwalia 53
Base Conversion
Convert from any base to base 10
Multiply each digit by bn, starting at the decimal point and move left.
Multiply each digit by b-n, starting at decimal point and move right.
Add the results
aibi. + a2b2 + a1b1 + a0b0 + a-1b-1 + a-2b-2 + a-jb-j
Decimal point
Convert the following to base 10
a) (11.001)2 , b) (620.7)8 , and c) (AB.C)16
a) (11.001)2 = 1x21 +1x20+0x2-1+0x2-2 +1x2-3 = (3.125)10
b) (620.7)8 = 6x82 + 2x81 + 0x80 + 7x8-1 = (400.875)10
c) (AB.C)16 = 10x161 + 11x160 + 12x16-1 = (171.75)10
IENG 331: Ahluwalia 54
Convert the following numbers to base 10
a) (4021.2)10
b) (1101.11)2
c) (620.7)8
d) (A6B.F)16
a) (4021.2)10 = 4x103 + 0x102 + 2x101 + 1x100 + 2x10-1 = (4021.2)10
b) (1101.11)2 = 1x23 + 1x22 + 0x21 + 1x20 + 1x2-1 + 1x2-2 = (13.75)10
c) (620.7)8 = 6x82 + 2x81 + 0x80 + 7x8-1 = (400.875)10
d) (A6B.F)16 = 10x162 + 6x161 + 11x160 + 15x16-1 = (2667.9375)10
IENG 331: Ahluwalia 55
Convert from base 10 to any other base
(by Successive Multiplication and Division)
1. Take the whole number portion of the number
and divide it by base b till quotient is zero. The
remainders (R) are the coefficients in base b.
2. Take the fraction portion of the number and
multiply it with base b till either the fraction is
zeros or the required precision is reached. The
integer overflows are the coefficients in the
new base b.
IENG 331: Ahluwalia 56
Convert the following base 10 numbers
a) (41.6875)10 to base 2
b) (41.6875)10 to base 8
c) (41.6875)10 to base 16
IENG 331: Ahluwalia 57
Convert (41.6875)10 to base 2
Q R Coefficients
41/2 20 1 a0 (LSB)
Step 1: 20/2 10 0 a1 (41)10 = (101001)2
Convert (41)10 10/2 5 0 a2
to base 2 5/2 2 1 a3
2/2 1 0 a4
1/2 0 1 a5 (MSB)
Coefficients
Step 2: Convert
0.6875*2 1.375 a-1 (MSB)
(.6875)10 to base 2
0.375*2 0.75 a-2 (.6875)10 = (.1011)2
0.75*2 1.5 a-3
0.5*2 1.0 a-4 (LSB)
Answer: (41.6875)10 = (101001.1011)2
IENG 331: Ahluwalia 58
Convert (41.6875)10 to base 8
Step 1: Convert (41)10 to base 8
Integer Q R Coefficients
41/8 5 1 a0 (LSB) (41)10 = (51)8
5/8 0 5 a1 (MSB)
Step 2: Convert (.6875)10 to base 8
Fraction Coefficients
0.6875*8 5.5 a-1 (MSB) (.6875)10 = (.54)8
0.5*8 4.0 a-2 (LSB)
Answer: (41.6875)10 = (51.54)8
IENG 331: Ahluwalia 59
Convert (41.6875)10 to base 16
Step 1: Convert (41)10 to base 16
Q R Coefficients
41/16 2 9 a0 (LSB) (41)10 = (29)16
2/16 0 2 a1 (MSB)
Step 2: Convert (.6875)10 to base 16
Coefficients
(.6875)10 = (.B)16
0.6875*16 11.0 a-1 (MSB)
Answer: (41.6875)10 = (29.B)16
IENG 331: Ahluwalia 60
Conversion from base 2 to base 8 by grouping
Group three binary bits, starting from the decimal point
Convert each group of three bits to an octal digit
Conversion from base 2 to base 16 by grouping
Group four binary bits, starting at the decimal point
Convert each group of four bits to a hex digit
IENG 331: Ahluwalia 61
Convert the following base 10 numbers
a) (41.6875)10 to base 8
b) (41.6875)10 to base 8
c) (41.6875)10 to base 16
a) (41.6875)10 = (101001.1011)2
b) = (101 001 . 101 100)2 = (51.54)8
c) = (0010 1001 . 1011)2 = (29.B)16
IENG 331: Ahluwalia 62
Bits and Bytes
Power Preface Value Power Preface Value
210 Kilo (K) 1,024 10-12 pico (p) .000000000001
220 Mega (M) 1,048,576 10-9 nano (n) .000000001
Giga (G) 1,073,741,824 10-6 micro () .000001
230
10-3 milli (m) .001
103 Kilo (K) 1,000
106 Mega (M) 1,000,000
109 Giga (G) 1,000,000,000
1012 Tera (T) 1,000,000,000,000
Example: Used space on hard drive = 169,860,644,864 bytes
= 1, 358,885,158,912 bits (* by 8) = 165,879,536 KB (/ by 1024)
= 161,991 MB (/ by 1,048,576) = 158 GB (/ by 1,073,741,824)
IENG 331: Ahluwalia 63
Powers of 2
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
Example: Convert (10100010000)2 to decimal
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0
(10100010000)2 =210+28+24 =1024+256+16=(1296)10
IENG 331: Ahluwalia 64
Binary Addition Base 10 Base 2
11 (carries) 11 (carries)
0+0=0
1110 1011
0+1=1 + 9910 + 110 0011
1+0=1 11010 110 1110
1+1=0 with a carry of 1
carry addend augend sum
0 + 0 + 0 = 0
0 + 0 + 1 = 1
0 + 1 + 0 = 1
0 + 1 + 1 = 0 with a carry of 1
1 + 0 + 0 = 1
1 + 0 + 1 = 0 with a carry of 1
1 + 1 + 0 = 0 with a carry of 1
1 + 1 + 1 = 1 with a carry of 1
IENG 331: Ahluwalia 65
Example: Do the arithmetic 2-1 in SM, 1s complement,
and 2s Complement. Assume word size to be four bits.
+2 = (0010)2 +1 = (0001)2 Arithmetic in SM
-1 = (1001)2 (SM) +2 = 0010
-1 = (1110)2 (1s comp) -1 = 1001
-1 = (1111)2 (2s comp) = 1011
Arithmetic in 1s Arithmetic in 2s
+2 = 0010 +2 = 0010
-1 = 1110
-1 = 1111
=1 0000
= +1 = 1 0001
= 0001
IENG 331: Ahluwalia 66
Data Representation
Representation of Positive Integer Numbers (e.g. 0, 1, 2, ...)
Representation of Negative Integer Numbers (e.g. -1, -2, ...)
Representation of Floating Point Numbers (e.g. 1.125, .25,)
Representation of Characters Stings (e.g. Bill, John,..)
IENG 331: Ahluwalia 67
Representation of Positive Integer Numbers
Range of numbers that can be represented on the
computer depends on computers word size
For a word size of 4 bits
Smallest Number = (0000)2 = (0)10
Largest Number = (1111)2 = (15)10
For a word size of 8 bits
Smallest Number = (0000 0000)2 = (0)10
Largest Number = (1111 1111)2 = (255)10
For a word size of 16 bits
Smallest Number = (0000 0000 0000 0000)2 = (0)10
Largest Number = (1111 1111 1111 1111)2 = (65,535)10
For a word size of n bits
Smallest Number = (0)10
Largest Number = 2n -1
24-1 = 15, 28-1 = 255, 216-1 = 65,535, 232-1 = 4,294,967,295
IENG 331: Ahluwalia 68
Example: What is the representation of (12)10 on a 16
bit computer? Show result in binary, octal, and hex.
Convert (12)10 to binary
(12)10 = (1100)2
Represent (1100)2 in 16 bits
= (0000 0000 0000 1100)2
Group by three to get octal digits
= (0 000 000 000 001 100)2 = (000014)8
Group by four to get hexadecimal digits
= (0000 0000 0000 1100)2 = (000C)16
IENG 331: Ahluwalia 69
Representation of Negative Integer Numbers
On a 4 bit computer we have a total of 16 different values
{0000, 0001,1111}, 8 positive (0-7), 8 negative (0-7)
{0000 - 0111}, {1000 - 1111},
(0 = Positive, 1 = Negative)
Approaches to representing negative numbers
Signed magnitude (sign bit and magnitude bits)
1s complement (flip each bit to get 1s comp)
2s complement (add 1 to 1s comp)
Example Representation of +/- 7 on a four bit computer
SM: +7 = 0111 -7 = 1111
1s comp: +7 = 0111 -7 = 1000
2s comp: +7 = 0111 -7 = 1001
IENG 331: Ahluwalia 70
Neg. Numbers in Signed Neg. Numbers in 1s
Magnitude Complement
Range: (2n1 1)
Range: (2 1)
n1
For n = 4, range is -7 to +7
Representation of ( 4)10 on a 4 For n = 4, range is -7 to +7
bit computer: Representation of ( 4)10 on a 4
+ 4 = (0100)2 bit computer:
- 4 = (1100)2 + 4 = (0100)2
Procedure: - 4 = (1011)2
Determine sign and magnitude Procedure:
then add or subtract. Treat sign bit as part of the
Need: number and add.
Comparator Need:
Adder Adder
Subtractor Disadvantage
Disadvantage Have two zeros ( 0)
Needs too much hardware 71
IENG 331: Ahluwalia
Have two zeros ( 0)
Binary SM 1sC 2sC
2s complement (widely used) 0 0000 +0 +0 +0
Range: -2n-1 to +2n-1 - 1 1 0001 +1 +1 +1
For n = 4, range is -8 to +7 2 0010 +2 +2 +2
Representation of ( 4)10 on a 4 bit 3 0011 +3 +3 +3
computer: 4 0100 +4 +4 +4
+ 4 = (0100)2 5 0101 +5 +5 +5
- 4 = (1100)2 6 0110 +6 +6 +6
Procedure: 7 0111 +7 +7 +7
Treat sign bit as part of the number 8 1000 -0 -7 -8
and add. 9 1001 -1 -6 -7
Need: 10 1010 -2 -5 -6
Adder 11 1011 -3 -4 -5
Advantage: 12 1100 -4 -3 -4
Has a single 0 13 1101 -5 -2 -3
Larger range of negative numbers 14 1110 -6 -1 -2
15 1111 -7 -0 -1
IENG 331: Ahluwalia 72
Example: What is the representation of (-12)10 on a 16 bit
computer, using signed magnitude, 1s complement, and 2s
complement representation? Show result in binary and hex.
(12)10 = (0000 0000 0000 1100)2 = (000C)16
(-12)10 in sign magnitude, on a 16 bit computer
= (1000 0000 0000 1100)2 = (800C)16
(-12)10 in 1s complement, on a 16 bit computer
= (1111 1111 1111 0011)2 = (FFF3)16
(-12)10 in 2s complement, on a 16 bit computer
= (1111 1111 1111 0100)2 = (FFF4)16
IENG 331: Ahluwalia 73
Representation of Floating Point Numbers
There are several approaches to representing
floating point numbers
Most computers use the IEEE 754 standard
Three parts, Sign (S), Exponent (E), Fraction(F)
Single precision floating point (32 bits)
1 sign bit, 8 exponent bits (bias 127 or excess 128), and
23 bits for fraction.
Double precision floating point (64 bits)
1 sign bit, 11 exponent bits (bias 1023 or excess 1024),
and 52 bits for fraction.
IENG 331: Ahluwalia 74
Multiple Representation of Floating Point Numbers
Example: Multiple representation of 75.125
75125. * 10-3 = 75.125
7512.5 * 10-2 = 75.125
751.25 * 10-1 = 75.125
75.125 * 100 = 75.125
7.5125 * 101 = 75.125*
.75125 * 102 = 75.125
.075125 * 103 = 75.125
* Normalized representation (Only one non zero digit to
the left of the decimal point
IENG 331: Ahluwalia 75
IEEE 754 Standard for Single Precision Floating
Point Number Representation
31 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
S E E E E E E E E F F F F F F F F F F F F F F F F F F F F F F F
S Sign bit (1 bit, 0 for positive, 1 for negative)
E Exponent (8 bits, with a bias of 127)
F Fraction (23 bits)
Exp. in 8 bit with a bias of 127. Exp. Range: -126 to +127
Exp. -1 = (0111 1110)2 =126; Exp. 0 = (0111 1111)2 =127
Exp. 1 = (1000 0000)2 =128; Exp. 2 = (1000 0001)2 =129
Fraction in 23 bits. The number is normalized, therefore
most significant bit is not stored (always 1)
IENG 331: Ahluwalia 76
Exponent of Single Precision Floating Point Number
Values 0 to 126 for negative exponent
Value 127 for exponent 0
Values 128 to 255 for positive exponent
7 6 5 4 3 2 1 0 Eight bits of exponent
-127 0 0 0 0 0 0 0 0 0
-1 126 0 1 1 1 1 1 1 0
0 127 0 1 1 1 1 1 1 1
1 128 1 0 0 0 0 0 0 0
+127 255 1 1 1 1 1 1 1 1
IENG 331: Ahluwalia 77
Steps in Floating Point Representation
1. Convert base 10 number to binary
2. Normalize the binary number, i.e.
- Only one non-zero digit to the left of the decimal. For a
binary number it will always be 1, therefore the
computer does not store it.
3. Write sign of the number (0 for +, 1 for -)
4. Add 127 to the exponent and represent it in 8 bits
5. Write fraction in 23 bits (without the 1 to the left
of the decimal)
6. Show the result in hexadecimal
IENG 331: Ahluwalia 78
Example: What is the internal representation, in single precision, of
(41.6875)10 .
1. Convert (41.6875)10 to binary
(41.6875)10 = (101001.1011)2
2. Normalize the number
(101001.1011)2= (1.010011011) X 20101
3. Write sign, exponent (127+5=132 or 128+4=132),
and fraction according to IEEE 754.
(0 1000 0100 01001101100000000000000)2
(0100 0010 0010 0110 1100 0000 0000 0000)2
(4226 C000)16
IENG 331: Ahluwalia 79
Example: What is the internal representation, in single precision, of
(-41.6875)10 .
1. Convert (41.6875)10 to binary
(41.6875)10 = (101001.1011)2
2. Normalize the number
(101001.1011)2= (1.010011011) X 20101
3. Write sign, exponent (127+5=132 or 128+4=132),
and fraction
(1 1000 0100 01001101100000000000000)2
(1100 0010 0010 0110 1100 0000 0000 0000)2
(C226 C000)16
IENG 331: Ahluwalia 80
Representation of Character Strings
American Standard Code for Information Interchange (ASCII),
first published in 1963, is used to represent English language
characters, A-Z, 0-9, +, -, etc.
Standard ASCII uses 7 bits to represent 128 unique characters
(0-127).
Extended ASCII uses 8 bits to represent 256 unique characters
(0-255).
Codes 0-31 are for control characters (non-printable)
Codes 32-126 are printable characters
32-47, 58-64, 91-96, 127 special characters (+, -, /, etc.)
48-57 are digits 0-9, 65-90 are capital letters A-Z
98-122 are lower case letters a-z.
Code 127 delete function
Characters are represented as byte array (starting index = 0)
IENG 331: Ahluwalia 81
Standard ASCII Table (0 - 127)
IENG 331: Ahluwalia 82
Extended ASCII Table (128 - 255)
IENG 331: Ahluwalia 83
Data Ranges
Integers
Short, 16 bits. Range: -32, 768 to +32, 767
Integer, 32 bits. Range: - 2, 147, 483, 648 to + 2,
147, 483, 647
Long, 64 bits,. Range: - 9.2 E+18 to + 9.2E+18
Floating Point
Single, 32 bits. Range: -3.4E+38 to -1.4E-45
(for negative), 1.4E-45 to 3.4E+38 (for positive)
Double, 128 bits. Range: -1.79E+308 to -4.94E-
324 (for negative) 4.94E-324 to 1.79E+308
String Range: 0 to ~ 2 billion
IENG 331: Ahluwalia 84
Example: What is the internal representation of
Doe, J ?
Byte Array
Internal
Byte Dec Hex ASCII
Representation
0 0100 0100 68 44 D
1 0110 1111 111 6F o
2 0110 0101 101 65 e
3 0010 1100 39 2C ,
4 0010 0000 32 20
5 0100 1010 74 4A J
D o e , space J
0100 0100 0110 1111 0110 0101 0010 1100 0010 0000 0100 1010
IENG 331: Ahluwalia
. 85
Example: What characters does the following byte
array represent? 0 01000111
1 01101111
2 01101111
3 01100100
4 00100001
Internal
Byte Dec Hex ASCII
Representation
(47 6F 6F 64 21)16
0 01000111 71 47 G
1 01101111 111 6F o
2 01101111 111 6F o G o o d !
3 01100100 100 64 d
4 00100001 33 21 !
IENG 331: Ahluwalia
. 86
Example: What is the internal representation of
Snow ?
Byte Array
Internal Integer Representation
Byte Dec Hex ASCII
Representation
(1399746423)10
0 0101 0011 83 53 S
1 0110 1110 110 6E n String Representation
2 0110 1111 111 6F o
Snow
3 0111 0111 119 77 w
Binary Representation (0101 0011 0110 1110 0110 1111 0111 0111)2
Hexadecimal Representation (53E6E77)16
Floating Point Representation 0 10100110 11011100110111001110111
239
1. 11011100110111001110111* 2100110
1.0240555 E+12
IENG 331: Ahluwalia
. Decimal Representation 87
Homework
1) Convert the following numbers to base 10
a) Convert (1010.011)2 = (?)10
b) Convert (210.2)3 = (?)10
c) Convert (123.3)4 = (?)10
d) Convert (630.4)8 = (?)10
e) Convert (B65F.C)16 = (?)10
IENG 331: Ahluwalia 88
2) Convert the following base 10 numbers to the indicated
base
a) Convert (125.125)10 to base 2
b) Convert (125.125)10 to base 8 by successive division
and multiplication
c) Convert (125.125)10 to base 16 by successive
division and multiplication
d) Convert (125.125)10 to base 8 by grouping
e) Convert (125.125)10 to base 16 by grouping
f) Convert (125.125)10 to base 3
IENG 331: Ahluwalia 89
3) Fill in the ?
Hexa-
Decimal Binary Octal decimal
29.8 ? ? ?
? 101.1101 ? ?
? ? 3.07 ?
? ? ? C.82
IENG 331: Ahluwalia 90
4) What is the representation of the following on a 16 bit
computer. Show the results in binary and hexadecimal.
a) (18)10
b) (-18)10 in signed magnitude representation
c) (-18)10 in 1s complement representation, and
d) (-18)10 in 2s complement representation.
5) How will the following numbers be represented on a
16 bit computer? Show the results in hexadecimal.
Assume IEEE 754 representation.
a) (125.125)10
b) (-125.125)10
IENG 331: Ahluwalia 91
6) What characters are represented by the following byte
array?
0 0101 0110
1 0110 1001
2 0111 0011
3 0111 0101
4 0110 0001
5 0110 1100
7) What is the internal representation of character
string IENG 331 ?
IENG 331: Ahluwalia
. 92
Data Communication and Data Networks
Data Communication
Transmission Modes
Transmission Medium
Data Networks
Network Topology
Network Classification
The Internet
HTML Tags
Network Protocols
IENG 331: Ahluwalia 93
Data Communication
Data communication is an activity associated with transfer of data
(digital or analog) between two or more devices. Communication
medium can be cable, optic fiber, satellite, etc.
Major Components:
a) Message, b) Medium, c) Protocol, d) Sender, and e) Receiver
IENG 331: Ahluwalia 94
Point to Point Communication
Use of existing telephone network
Modem (modulator/demodulator)
Digital/Analog and Analog/Digital conversion
Transmission speed
Baud rate or bits per second (bps)
IENG 331: Ahluwalia
Data Communication Components
Physical media Network device
Computers
(routers, modems, etc.)
Network Protocols
Open System Interconnection (OSI),
developed by International
Standards Organization
Transmission Control
Protocol/Internet Protocol (TCP/IP)
IENG 331: Ahluwalia
Transmission Modes
Serial-Parallel Transmission
Parity Schemes
Asynchronous-Synchronous Transmission
Simplex-Half-duplex-Full-duplex Transmission
IENG 331: Ahluwalia 97
Serial-Parallel Communication
Old DB9 connector
Serial: Data transferred one Parallel: Data transferred
bit at a time one byte at a time
LAN Cable
USB Left USB Right
IENG 331: Ahluwalia 98
Parity Schemes
No parity: Parity scheme is not used
D0 D1 D2 D3 D4 D5 D6
1 0 0 0 0 0 1
Even parity: Even number of 1s sent
D0 D1 D2 D3 D4 D5 D6 P
1 0 0 0 0 0 1 0
Odd parity: Odd number of 1s sent
D0 D1 D2 D3 D4 D5 D6 P
1 0 0 0 0 0 1 1
Mark parity: Parity bit always 1
D0 D1 D2 D3 D4 D5 D6 P
1 0 0 0 0 0 1 1
IENG 331: Ahluwalia 99
Asynchronous-Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
Single character based Data block (frame) based
transmission transmission
Start and stop bits used for Requires synchronization of
synchronization data block
Higher overhead, slower Less overhead, faster
IENG 331: Ahluwalia
Simplex-Half-duplex-Full-duplex Transmission
Simplex: One direction only, e.g. Radio, TV, keyboard to computer
Half-duplex: Either direction, but only one direction at a time, e.g.
CB radio, computer to computer
Full-duplex: Both directions at the same time, e.g. Telephone,
computer to computer
IENG 331: Ahluwalia 101
Transmission Medium
Guided Medium (Cable)
Unshielded Twisted Pair
Shielded Twisted Pair
Coaxial Cable
Fiber Optic Cable
Unguided Medium (Air)
Radio (Wireless)
Microwave
Satellite
Infrared
Sonar
IENG 331: Ahluwalia 102
Guided Medium
Unshielded Twisted Pair (UTP)
(more twists/foot the better)
Category 1: Lowest quality. Only good for voice
Category 2: Good for voice and low data rates (up to 10 Mbps)
Category 3: Used for residential phones (3 twists/foot)
Category 4: Transmission speed up to 16 Mbps
Category 5: Transmission speed up to 100 Mbps
Category 6: Transmission speed up to 1 Gbps
IENG 331: Ahluwalia 103
Guided Medium
Shielded Twisted Pair (STP)
Similar to UTP, except each pair is encased in a
metal foil or braided metal mesh.
IENG 331: Ahluwalia 104
Guided Medium
Coaxial Cable
Carry signals at higher frequency (100KHz 500 MHz)
Outer wrapping serves as a shield and as a second
conductor
IENG 331: Ahluwalia 105
Guided Medium
Fiber Optic Cable
Consists of a core (denser material) and a cladding (less
dense material)
Light bounces back and forth along the core
LED and lasers are used as the light source
Resistant to noise, much higher transmission speed, more
expensive.
IENG 331: Ahluwalia 106
Unguided Medium
Radio (30 MHz to 1 GHz)
Satellite (2 GHz to 40 GHz)
Wireless
IENG 331: Ahluwalia
Microwave Tower 107
(2 GHz to 40 GHz)
Transmission Speed and Cost
Medium Speed Cost
Unshielded twisted pair 10 Mbps 100 Mbps Low
Shielded twisted pair 16 Mbps 500 Mbps
Microwave 256 Kbps 100 Mbps
Satellite 256 Kbps 100 Mbps
Coaxial cable 5.6 Kbps 10 Mbps
Fiber optic cable 500 Kbps 100 Mbps High
IENG 331: Ahluwalia 108
Why Data Networks ?
Resource Sharing
Hardware (printers, hard
drives, etc.)
Software (application
software)
Information Sharing
Files, Database, etc.
Search capability (WWW)
Email, E-commerce
Remote computing
Distributed computing
Internet phone (VoIP)
IENG 331: Ahluwalia 109
Data Network Evolution
1836 Telegraph (use of dots and dashes)
1858-1866 Transatlantic cable laid
1876 Telephone by Alexander Graham Bell
1962-1968 Packet-switched network developed (ARPANET)
1969-1972 ARPANET went from 4 to 40 nodes. Global networking
1973 File Transfer Protocol (FTP) specified
1977 Internet and e-mail started
1980 Transmission Control Protocol (TCP) and Internet Protocol (IP) specified.
1984 Number of nodes > 25,000. Domain Name Server (DNS) established.
1990 Number of nodes > 300,000. Network opened for commercial use.
1991 User interface to the network developed (www)
1992 Nodes > 3 M. Graphical www browsers developed (Mosaic, Netscape).
1996 Nodes > 12 M. Microsoft introduces Internet Explorer
1999 E-banking, E-commerce, E-Auctions, E-Trade, ASP, etc. established
IENG 331: Ahluwalia 110
Network Topology
Bus: All devices are connected by a single
cable
Ring: Data moves around a ring till it finds the
destination node
Star: Widely used. The central node (server)
communicates with each node in the network
Extended Star: Often used for larger
networks to reduce data traffic.
Mesh: Connects nodes in a grid. Expensive
but reliable. Used by WANs to connect with
LANs
Hybrid
IENG 331: Ahluwalia
Bus Network
Every node tap into the same medium
Signals may collide
Common medium could be the bottleneck
Single node failure does not cause network failure
IENG 331: Ahluwalia
Ring Network
Nodes are arranged in a ring
One node receives from its predecessor and
sends to its successor
Single point failure
Unidirectional communication
IENG 331: Ahluwalia
Star or
Extended Star (Tree)
One node acts as the master node, rest are slave
nodes
Nodes communicate with each other via the
master
Master could be the bottleneck
Failure of master results in network failure
Less expensive, easy to install
Node failure does not result in network failure
IENG 331: Ahluwalia
Mesh
(Partial and Fully Connected)
Each node can talk to its neighbors directly
Non-neighbor nodes need to store and forward
message
Fully connected mesh is where every node is
connected to every other node N *( N 1)
L
Failure of one node does not result in network 2
failure
Expensive due to large amount of connections
N = Number of
computers
L = Number of links
(connections)
N=2, L=1; N=3, L=3;
N=4, L=6, N=6, L=15
IENG 331: Ahluwalia
Hybrid
Can utilize a combination of any network
topology
IENG 331: Ahluwalia
Networks Classification
1. Local Area Network (LAN) over a small region (<1 mile). Suited
for room, building, or campus. Uses single cable (10 to 100
Mbps). Based on Bus (Ethernet) or Ring topology.
2. Metropolitan Area Network (MAN) over a city. Supports voice
and data. Two unidirectional buses
3. Wide Area Network (WAN) over a wide area. Uses broadband
or fiber optic cables.
4. Internet collection of interconnected networks (WANs, MANs,
and LANs). Dedicated path only during transmission. Uses
packet (small chunks) switching. Packets are passed from node
to node between source and destination.
IENG 331: Ahluwalia
LAN: Local Area Network
Typically private networks
Range: < 10 km
Topology: Bus , Star, or Ring
Protocol: IEEE 802.3 (Bus), 802.5 (Ring),
802.16 (wireless)
Speed: 10 Mbps to 10 Gbps
Configuration: Cable or wireless
IENG 331: Ahluwalia
MAN: Metropolitan Area Network
Typically owned by a city
Range: <100 km
Topology: Bus , Star, Ring, Tree, or Mesh
Protocol: IEEE 802.3 (Bus), 802.5 (Ring)
Speed: 10 Mbps to 10 Gbps
Configuration: Cable or wireless
IENG 331: Ahluwalia
WAN: Wide Area Network
Range: Wide area
Communication technologies
Circuit switching
Packet switching
Frame relay
Asynchronous Transfer Mode (ATM)
IENG 331: Ahluwalia
The Internet
Collection of WANs, MANs, and LANs.
Each computer is assigned an IP address and can
communicate with other computers in the network
It is a virtual network
Terminology
Backbone: Main internet routes
TCP/IP: Transmission Control Protocol/Internet Protocol
IP Address: Unique number for each Internet computer
Packets: Small chunks of data traveling on the network
Router: Moves packets to their destination
ISP: Internet service provider
URL: Universal Resource Locator
IENG 331: Ahluwalia 121
Packet Routing through WAN/Internet
Small chunks (packets) of data
communicated at a time
Packets pass from node to node,
between source and destination
Packets sent out of sequence
IENG 331: Ahluwalia
Internet: A Virtual Network
Router
Routers are used to connect
heterogeneous networks
In a virtual network each
computer is assigned an
address. LAN WAN
The LANs, MANs, and WANs
find the computer within
their domain.
IENG 331: Ahluwalia
Network Range
Network Range (km) Example
LAN < 10 Room, Building, Campus
MAN < 100 City
WAN < 10, 000 Country
Internet World wide World
IENG 331: Ahluwalia 124
Some Internet Related Terms
Internet Protocol (IP) address (32 bit number)
URL: Universal Resource Locator
No spaces, case sensitive
HTTP: Hypertext Transfer Protocol
HTML: Hypertext Markup Language
.htm or .html file extension
Search Engine (Google, Yahoo, ..)
Email Server
POP (Post Office Protocol)
IMAP (Internet Messaging Access Protocol)
Web-based (Hotmail)
IENG 331: Ahluwalia
HTML Tags
<html></html> <html> Specifies the start document. Needs to be the beginning of the HTML
document. </html> specifies the end of the HTML document.
<title></title> Specifies the title of the page. This does not appear in your document on the
screen but at the top of the screen above the menu bar.
<head> </head> Gives the header description of the document. It describes the header
information of the page as the title.
<body></body> The main HTML document appears within these two tags. The BODY of the
document lies here.
<hy></hy> Specifies the font size of the text, y varies from 1 - 6 (1 : is the largest font
size and 6 : is the smallest font size).
<b></b> The text within this tag appears in bold type face.
<I></I> The text within this tag appears in italics.
<u> </u> The text within this tag is underlined.
<blink> </blink> The text within this tag blinks. (Use this for better appearance).
<hr></hr> To draw a horizontal line across the document. Notice that no closing tag is
required.
<br> </br> Specifies a break in the text. Used for paragraph formatting.
<p> </p> Specify the beginning of a new paragraph. The next paragraph can be
specified without closing the first one.
<font= #X> Specifies font color. The Xs are hexadecimal values.
</font>
<font size = X Specifies the font size (from 1 - 7). Equivalent to <Hy>. Only difference
></font> being that in the former case the whole sentence has the specified font
whereas here we can modify each characters size.
IENG 331: Ahluwalia 126
Sample HTML file
<html>
<head><TITLE>A Simple HTML Example</TITLE></head>
<body> <H1>HTML is Easy To Learn</H1>
<P>Welcome to the world of HTML.
This is the first paragraph. While short it is still a
paragraph!</P>
<P>And this is the second paragraph.</P>
<P><font color="#0000FF"><span style="background-color:
#008000">This is Fun</span></font></P>
<font color="#800080" size="4">
<span style="font-weight: 700; background-color: #FFFFFF">
<marquee>Creating HTML is Piece of cake</marquee> </span>
</font>
</body>
IENG</html>
331: Ahluwalia 127
Last
IENG 331: Ahluwalia 128
Network Protocols
Set of rules for data transmission
Protocol Acronym Purpose
Internet Protocol IP Physical network
Internet Control Message Protocol ICMP Status messaging
Transmission Control Protocol TCP Guaranteed delivery
User Datagram Protocol UDP Coordination, audio transmission
Telnet Protocol TELNET Remote login
File Transfer Protocol FTP Network utility
Simple Mail Transfer Protocol SMTP Email service
Network News Transfer Protocol NNTP Usenet
Hypertext Transfer Protocol HTTP Web
IENG 331: Ahluwalia 129
IP Addressing Scheme
IP address is a 32 bit number (four bytes or octet).
Range of each octet is 0 to 255.
Uses a dot to separate octets
Each IP address has a prefix and a suffix.
Six classes of IP addresses.
Class is recognized by the decimal value of the first octet.
IP Address:
157.182.36.1
IENG 331: Ahluwalia
Dotted Decimal Notation
IP address is a 32 bit number (four bytes or octet).
Range of each octet is 0 to 255.
Uses a dot to separate octets
Each IP address has a prefix and a suffix.
Six classes of IP addresses.
Class is recognized by the decimal value of the first octet.
IENG 331: Ahluwalia
IP Address Example
Class B Class B
Class A
Class C
IENG 331: Ahluwalia
IP Address Example
Each network prefix is unique
An organization n obtains network numbers from an ISP
IENG 331: Ahluwalia
Domain Name System (DNS)
Root
Server
.COM .ORG .EDU
Server Server Server
Yahoo Google IIE IEEE WVU
PSU
Server Server Server Server Server
CEMR
Server
IMSE MAE
Server Server
IENG 331: Ahluwalia
TCP/IP
TCP: Transmission Control Protocol. Establishes connection
between sending and receiving hosts. It is one of the main p
IP: Internet Protocol. Specifies format of packets and addressing
scheme. Moves packet from node to node.
The TCP/IP is one of the main protocol for packet switched
networks. It guarantees that packets will be arranged in the right
sequence and delivered from source to destination. It consists of
five layers
IEEE-802 protocol is used for LAN. It has three layer
IEEE-802.11 is s set of protocols used for wireless LAN
IENG 331: Ahluwalia
Layers of TCP/IP and IEEE 802
TCP/IP Protocol on hosts and routers TCP/IP Internet Protocol
Layer 5: Application
1. Physical layer corresponds to the basic
network hardware Layer 4: Transport
2. Specifies how to transmit data over the Layer 3: Internet
network
3. Specifies the format of packets and Layer 2: Network Interface
store and forward procedure Layer 1: Physical
4. Specifies reliable data transfer
5. Specifies how an appliation used the
network
IEEE-802 Internet Protocol
Layer 3: Logical Link Control (LLC)
Layer 2: Medium Access Control (MAC)
Layer 1: Physical
IENG 331: Ahluwalia
TCP Header
IENG 331: Ahluwalia