# 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 BC–2000 BC) Egyptian Numerals (~3000-1000 BC) Early Greek Numerals (~2000-500 BC) Recent Greek Numerals IENG 331: Ahluwalia 5 .

Roman Non-Positional (no zero) (~400–200 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 .

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 . Mechanical Computing Early Computing Tool .

based on the positional number system • The device consists of a board with a rim of 9 squares (1 – 9) and ten rods (0 . Napier’s Bones and Logarithms (1617) • John Napier (Scottish mathematician) created a device for multiplication. and cube roots.9) • Napier also developed tables of logarithms IENG 331: Ahluwalia 12 . division. square roots.

logs. multiply. an English clergyman. and trig functions. divide. compute roots. subtract. exponents. Oughtred’s Slide Rule (1621-1623) Circular slide rule Linear slide rule • ~1622 William Oughtred . • Slide rule was the main computing device for engineering students till 1980. • It could add. IENG 331: Ahluwalia 13 . invented the slide rule (based on logarithms).

built the first mechanical adding and subtracting machine for his father (a tax collector). Pascal’s Adder (1642-1645) • Blaise Pascal. IENG 331: Ahluwalia 14 . • Subtraction was done by adding 9’s complement. at age 13. • It could add and subtract by rotating dials • It had 4. or 8 dials. 6. a French mathematician.

subtract. Leibniz’s Adder (1674) • Gottfrierd Wilhelm von Leibniz. a German mathematician . and divide) calculator IENG 331: Ahluwalia 15 . developed a four function (add. multiply.

Jacquard’s 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 .

000) to Charles Babbage. IENG 331: Ahluwalia 17 . It was cancelled in 1842 • During 1847-1849. It was never built due to lack of funds and precision manufacturing. Babbage’s 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. to tabulate polynomial functions.000 (~\$27. an English mathematician to develop the Difference engine. Babbage went on to design a more general analytical engine. • The development was delayed.

• A programming language (Ada) was named after her. an English mathematician. Countess of Lovelace. helped Babbage with documenting and programming his Engines. IENG 331: Ahluwalia 18 . Lady Augusta Ada First Computer Programmer • Lady Augusta Ada. • Regarded by many as the first computer programmer.

Analytical Engine’s 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 .

• 1890 census was done in one year. IENG 331: Ahluwalia 20 . he founded the Tabulating Machine Co. it was renamed as International Business Machines (IBM) in 1924. 1890 US census was expected to take 12 years. Herman Hollerith. a census bureau employee. After several mergers and acquisitions.. which became Computer Tabulating Recording Co. In 1896. used punched cards (from Jacquard’s loom) to tabulate and process census data. in 1913. Hollerith’s Tabulating Machine • 1880 US census took 9 years to compile.

Alan Turing. An algorithm) • It laid the theoretical foundation for electronic digital computing. can solve any problem whose solution follows a “defined method” (i.e. an English mathematician proved that a machine capable of processing 1’s and 0’s. Digital Computing Mathematical Foundation by Alan Turing (1936) • In 1936. IENG 331: Ahluwalia 21 .

John Vincent Atanasoff. • The machine was built. an electrical engineering student to develop a digital computer using the binary number system (based on Turing’s work). Electro-Mechanical Computing Atanasoff-Berry Computer (ABC) • In 1939. Physics professor at Iowa State University. hired Clifford Berry. but the patent was not filed because Atanasoff joined the Navy for the WWII effort. IENG 331: Ahluwalia 22 . and a memory device (for instruction storage). • ABC computer used vacuum tubes (for relays). punched card (for input).

• It was based upon mechanical relays. • It weighed 35 tons. Howard Aiken’s Mark I (1944) • IBM gave a grant to Howard Aiken. professor of Physics at Harvard to built an electro-mechanical computer (Mark I). with 500 miles of wiring • Regarded as first realization of Babbage’s engines IENG 331: Ahluwalia 23 .

IENG 331: Ahluwalia 24 . engineering professors at Univ. Filled a 50’ x 30’ room. It had 18.000 additions/sec. built ENIAC for WWII • It was completed in 1946. of Pennsylvania. ENIAC: Electronic Numerical Integrator and Calculator • John Mauchly and J. • It’s design was based on the ABC computer • Mauchly and Echert established UNIVAC Corp.000 vacuum tubes. Presper Eckert. • Did 5. • Weighed 30 tons. Programmed by patch panel.

Data and program are stored in primary computer memory.e. • Modified ENIAC (EDVAC-Electronic Discrete Variable Automatic Computer) was built on the store program concept and delivered in 1949. • He developed the “stored program concept”. IENG 331: Ahluwalia 25 . i. Hungarian-American mathematician. collaborated with Mauchly and Echert on ENIAC project. Von Neuman Architecture Store Mill • John Von Neumann.

US Rear Admiral. Grace Murray Hopper. a moth was found blocking a relay. • One day the program gave incorrect results. The program worked after the bug was removed. • New term was coined. upon examination. IENG 331: Ahluwalia 26 . The first computer “bug” • Dr. debugging a program. used Aiken’s Mark I computer for gunnery and ballistic calculations.

Cost \$1. UNIVAC Computer .035 (1968) Same computing power as a modern calculator IENG 331: Ahluwalia 27 .801.

499 (~17k today) Without Monitor. Keyboard. or Mouse IENG 331: Ahluwalia 28 .Cost of a “Lightning fast” Desktop Computer (1989) Processor: Intel 80386 Speed: 20 MHz Memory: 2 MB Cost: \$8.

and faster. IBM. • Transistor were smaller in size. IENG 331: Ahluwalia 29 . UNIVAC and other computer manufacturers replaced vacuum tube with transistors. more reliable. • Computers therefore became smaller. Development of Transistor • In 1948. William Shockly of Bell Labs developed a transistor. • During the 1950s and 1960s. and faster than a vacuum tube. more reliable.

Vacuum Tube (1950s) (1960s) Integrated Circuits (1940s) (1970s) 6. Global Networks 5. Computer Hardware Evolution 2. Transistor 3. Large/Very Large Scale 1. Parallel Processing (1990s) 7. Single Chip Computers (1980s) (2000s) IENG 331: Ahluwalia 30 . Integrated Circuits 4.

Microprocessor CPUs (1979-2004) IENG 331: Ahluwalia 31 .

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 . Memory Capacity (Single Chip DRAM) size 1000000000 Year Size(Mb) Cycle time 100000000 1980 0.

1 1965 1970 1975 1980 1985 1990 1995 2000 Year IENG 331: Ahluwalia 33 . Processor Performance Trends 1000 Supercomputers 100 Mainframes 10 Minicomputers Microprocessors 1 0.

then ~ Engine size would be < .0 However. “The car performed an illegal function” – Shutting down and restarting the car would clear all warnings. – Car would stop for no reason – For every new car the user would have re-learn driving – There will be a single warning.1” ~ Car would give 120. Computers vs.000 mph ~ Car would cost \$4. 000 mpg ~ Car would have top speed of 240. IENG 331: Ahluwalia 34 . Cars (A Hypothetical Comparison) If car engines developed at the pace of computers.

Size. Memory Capacity. system was developed. (1940s) Vacuum tube (Large) Programming by wires and machine language. multimedia Trend: Speed. (1960s) Integrated Circuits High level programming languages (C. ASCII code 4. The term software was created. 3. mini. (Large. Networking. Computer Hardware/Software Evolution Decades Hardware Software 1. Machine or assembly (Large computers) language programming . (2000s) Computers on a chip Graphic games. WWW. Cost. (1980s) Parallel processing MS DOS. PHP. mini) COBOL. (Large. Graphic applications. ). etc. (IC). domain specific VLSI). 2. mini) languages (LISP for AI. and Reliability up. Office. Javascript 7. programming languages (BASIC) (Large. (1970s) Large Scale IC (LSI. (1990s) Global Networking MS Windows OS. IENG 331: Ahluwalia 35 . and Power Consumption down. VisiCal & Lotus (spreadsheet) for micro computers) PC & Apple II 6. (1950s) Transistor & diodes. Interactive computing. UNIX OS. First operating core memory. Fortran. Networks 5. Mac OS. and and games for PC. SQL for databases).

Computer Classification 1. Mainframe Computers 3. Super Computers 2. Server Computers Personal Computers 4. Smart Phones IENG 331: Ahluwalia 36 . Desktops 6. Laptops 7. Tablets 5.

Flash drive. etc. RAM External/Secondary Memory: Hard disk. etc. Personal Computer Organization CPU: Central Processing Unit Main/Primary Memory: ROM. Input Device: Keyboard. Voice. Mouse. CD. Stylus. Audio. etc. IENG 331: Ahluwalia 37 . Printer. Output Device: Monitor.

Personal Computer Peripherals IENG 331: Ahluwalia 38 .

64KB interpreter by 8800 with MS Wozniak Apple I Apple DOS RAM. Personal Computer Evolution 1975 – IBM 1975 – Altair 1976 – PET 1976 – Steve 1977 – Apple II 5100 PC (55 lbs.9 MHz) Microsoft BASIC interpreter 1981 – IBM 1984 – Apple’s Lisa 5150 PC with 1994 – Power and Macintosh 1998 – iMac 2010 – iPad Microsoft DOS Mac G5 IENG 331: Ahluwalia 39 . 8800 with BASIC Commodore Altair Jobs and Steve with BASIC and 5” CRT. 1.

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 .

Debug) • Upon end of application. transfer control to OS IENG 331: Ahluwalia 46 . Execution of Application Program Operating Application System Program • Load application program from external memory (Hard disk. Flash drive) to main memory (RAM) • Transfer control to the application program (Run. CD.

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 . Primary Memory Organization (16 bit Computer) Example: A four bit MAR can reference up to 16 memory location.

and data. 110 (6) 0000 0000 111 (7) 0000 0000 Example: Word size = 8 bits. and an associated label. 001 (1) 0000 1000 (8) Y contents. 0000 0000 • Memory Address Register (MAR) holds 101 (5) 0000 0000 the address of a memory location. MAR = 3 bits IENG 331: Ahluwalia 48 . Memory Contents Address Label • Primary memory is organized as a Contents 000 (0) X table 0000 1010 (10) • Each memory location has address. total memory = 8 words. 011 (3) Dif • Memory holds system software. 010 (2) Sum 0001 0010 (18) • Not all memory addresses have a label. 0000 0010 (2) 100 (4) application software.

angles. IENG 331: Ahluwalia 49 . Common Bases • Base 2 (Binary) used by digital computers. and geographic coordinates. Used by Mayans • Duo-decimal (base 12): Used to represent months. • Sexa-gesimal (base 60): Used to represent time. Other Bases • Quinary (base 5): Developed because of five fingers on one hand. • 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.

IENG 331: Ahluwalia 50 . …... 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 ….

4 5 6.7.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 .5.2. Base 10 Number Example 1 2 3.3.6.1.8.4. 7 8 9. 0 4 1 Units a = {0.

1. 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 . 9. 1. 1. 4. B. 5. 3. 2. C. 3. 7 8 9 11 9 1001 0. 1 2 7 7 7 0111 8 10 8 1000 0. 8. 3. 10. 6. 6. 16 10 12 A 1010 11 13 B 1011 A. & 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. 8. 2. 7. 7. 5. Decimal Octal Hex Binary Base 2. 8. E. 4. 9 10 6 6 6 0110 0. D. 5. 2. 6. 4.

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 .

75)10 IENG 331: Ahluwalia 54 .C)16 a) (11.7)8 .875)10 c) (AB. and c) (AB.C)16 = 10x161 + 11x160 + 12x16-1 = (171.001)2 = 1x21 +1x20+0x2-1+0x2-2 +1x2-3 = (3. + a2b2 + a1b1 + a0b0 + a-1b-1 + a-2b-2 +… a-jb-j Decimal point Convert the following to base 10 a) (11. Base Conversion Convert from any base to base 10 • Multiply each digit by bn. • Multiply each digit by b-n.7)8 = 6x82 + 2x81 + 0x80 + 7x8-1 = (400. starting at decimal point and move right. • Add the results aibi….125)10 b) (620.001)2 . starting at the decimal point and move left. b) (620.

F)16 = 10x162 + 6x161 + 11x160 + 15x16-1 = (2667.75)10 c) (620.11)2 = 1x23 + 1x22 + 0x21 + 1x20 + 1x2-1 + 1x2-2 = (13. Convert the following numbers to base 10 a) (4021.9375)10 IENG 331: Ahluwalia 55 .875)10 d) (A6B.2)10 = 4x103 + 0x102 + 2x101 + 1x100 + 2x10-1 = (4021.7)8 = 6x82 + 2x81 + 0x80 + 7x8-1 = (400.11)2 c) (620.7)8 d) (A6B.F)16 a) (4021.2)10 b) (1101.2)10 b) (1101.

The integer overflows are the coefficients in the new base b. Take the whole number portion of the number and divide it by base b till quotient is zero. IENG 331: Ahluwalia 56 . The remainders (R) are the coefficients in base b. 2. Convert from base 10 to any other base (by Successive Multiplication and Division) 1. 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.

Convert the following base 10 numbers a) (41.6875)10 to base 2 b) (41.6875)10 to base 16 IENG 331: Ahluwalia 57 .6875)10 to base 8 c) (41.

0 a-4 (LSB) Answer: (41.1011)2 IENG 331: Ahluwalia 58 .375*2 0. Convert (41.375 a-1 (MSB) (.75*2 1.5 a-3 0.5*2 1.6875)10 to base 2 0.6875)10 = (101001.75 a-2 (.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.1011)2 0.6875*2 1.6875)10 = (.

54)8 0.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 (.54)8 IENG 331: Ahluwalia 59 .5 a-1 (MSB) (.5*8 4. Convert (41.6875*8 5.6875)10 to base 8 Fraction Coefficients 0.6875)10 = (.0 a-2 (LSB) Answer: (41.6875)10 = (51.

6875)10 = (29.6875)10 = (. Convert (41.B)16 0.0 a-1 (MSB) Answer: (41.B)16 IENG 331: Ahluwalia 60 .6875*16 11.6875)10 to base 16 Coefficients (.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 (.

starting at the decimal point • Convert each group of four bits to a hex digit IENG 331: Ahluwalia 61 . 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.

Convert the following base 10 numbers a) (41.6875)10 to base 16 a) (41. 1011)2 = (29.B)16 IENG 331: Ahluwalia 62 . 101 100)2 = (51.1011)2 b) = (101 001 .6875)10 to base 8 b) (41.54)8 c) = (0010 1001 .6875)10 to base 8 c) (41.6875)10 = (101001.

991 MB (/ by 1.000.644.000.000 106 Mega (M) 1.073.576) = 158 GB (/ by 1.741.824) IENG 331: Ahluwalia 63 .536 KB (/ by 1024) = 161.000.000 1012 Tera (T) 1.000 Example: Used space on hard drive = 169.860.879.000000001 Giga (G) 1.000 109 Giga (G) 1.158.000.048.576 10-9 nano (n) . Bits and Bytes Power Preface Value Power Preface Value 210 Kilo (K) 1.000. 358.048.912 bits (* by 8) = 165.001 103 Kilo (K) 1.885.000001 230 10-3 milli (m) .073.000000000001 220 Mega (M) 1.741.864 bytes = 1.000.024 10-12 pico (p) .824 10-6 micro () .

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 .

1’s complement.Example: Do the arithmetic 2-1 in SM. +2 = (0010)2 +1 = (0001)2 Arithmetic in SM -1 = (1001)2 (SM) +2 = 0010 -1 = (1110)2 (1’s comp) -1 = 1001 -1 = (1111)2 (2’s comp) = 1011 Arithmetic in 1’s Arithmetic in 2’s +2 = 0010 +2 = 0010 -1 = 1110 -1 = 1111 =1 0000 = +1 = 1 0001 = 0001 IENG 331: Ahluwalia 66 . and 2’s Complement. Assume word size to be four bits.

2. 0. -1.) Representation of Negative Integer Numbers (e.g..…) Representation of Characters Stings (e. .. John.g.. -2. Bill...) Representation of Floating Point Numbers (e. .125. Data Representation Representation of Positive Integer Numbers (e. 1.) IENG 331: Ahluwalia 67 .g. 1.g.25. .….

28-1 = 255.535.295 IENG 331: Ahluwalia 68 . 232-1 = 4.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.967. 216-1 = 65.535)10 • For a word size of n bits – Smallest Number = (0)10 – Largest Number = 2n -1 – 24-1 = 15.294.

octal. and hex. Example: What is the representation of (12)10 on a 16 bit computer? Show result in binary. 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 .

7 on a four bit computer SM: +7 = 0111 -7 = 1111 1’s comp: +7 = 0111 -7 = 1000 2’s comp: +7 = 0111 -7 = 1001 IENG 331: Ahluwalia 70 .Representation of Negative Integer Numbers On a 4 bit computer we have a total of 16 different values {0000.0111}. 1 = Negative) Approaches to representing negative numbers • Signed magnitude (sign bit and magnitude bits) • 1’s complement (flip each bit to get 1’s comp) • 2’s complement (add 1 to 1’s comp) Example – Representation of +/. (0 = Positive.1111}. 0001. {1000 . 8 negative (0-7) {0000 .…1111}. 8 positive (0-7).

• Treat sign bit as part of the Need: number and add. Numbers in Signed Neg.4 = (1100)2 + 4 = (0100)2 Procedure: .4 = (1011)2 • Determine sign and magnitude Procedure: then add or subtract. • Comparator Need: • Adder • Adder • Subtractor Disadvantage Disadvantage • Have two zeros (± 0) • Needs too much hardware 71 IENG 331: Ahluwalia • Have two zeros (± 0) . Neg. range is -7 to +7 bit computer: Representation of (± 4)10 on a 4 + 4 = (0100)2 bit computer: . Numbers in 1’s Magnitude Complement Range:  (2n1  1) Range:  (2  1) n1 For n = 4. range is -7 to +7 Representation of (± 4)10 on a 4 For n = 4.

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. Binary SM 1’sC 2’sC 2’s complement (widely used) 0 0000 +0 +0 +0 Range: -2n-1 to +2n-1 . 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 .

(12)10 = (0000 0000 0000 1100)2 = (000C)16 (-12)10 in sign magnitude. 1’s complement. on a 16 bit computer = (1111 1111 1111 0011)2 = (FFF3)16 (-12)10 in 2’s complement. on a 16 bit computer = (1111 1111 1111 0100)2 = (FFF4)16 IENG 331: Ahluwalia 73 . on a 16 bit computer = (1000 0000 0000 1100)2 = (800C)16 (-12)10 in 1’s complement.Example: What is the representation of (-12)10 on a 16 bit computer. and 2’s complement representation? Show result in binary and hex. using signed magnitude.

and 52 bits for fraction. Representation of Floating Point Numbers • There are several approaches to representing floating point numbers • Most computers use the IEEE 754 standard – Three parts. Exponent (E). 11 exponent bits (bias 1023 or excess 1024). IENG 331: Ahluwalia 74 . Sign (S). Fraction(F) – Single precision floating point (32 bits) • 1 sign bit. and 23 bits for fraction. 8 exponent bits (bias 127 or excess 128). – Double precision floating point (64 bits) • 1 sign bit.

Multiple Representation of Floating Point Numbers Example: Multiple representation of 75.75125 * 102 = 75.125 75.125 751.5 * 10-2 = 75.125 7512. * 10-3 = 75.125 75125.125 * Normalized representation (Only one non zero digit to the left of the decimal point IENG 331: Ahluwalia 75 .125 .5125 * 101 = 75.125 * 100 = 75.25 * 10-1 = 75.125* .075125 * 103 = 75.125 7.

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. therefore most significant bit is not stored (always 1) IENG 331: Ahluwalia 76 . Exp. Range: -126 to +127 Exp. 1 = (1000 0000)2 =128. 0 = (0111 1111)2 =127 Exp. The number is normalized. -1 = (0111 1110)2 =126. Exp. 1 for negative) E Exponent (8 bits. 0 for positive. with a bias of 127) F Fraction (23 bits) Exp. 2 = (1000 0001)2 =129 Fraction in 23 bits. in 8 bit with a bias of 127. Exp.

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 .

Normalize the binary number. Write sign of the number (0 for +. Write fraction in 23 bits (without the 1 to the left of the decimal) 6. Show the result in hexadecimal IENG 331: Ahluwalia 78 . 1 for -) 4.e. i. Add 127 to the exponent and represent it in 8 bits 5. For a binary number it will always be 1. Convert base 10 number to binary 2. .Steps in Floating Point Representation 1. 3. therefore the computer does not store it.Only one non-zero digit to the left of the decimal.

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

Range: . Range: .4…E+38 (for positive) • Double.94…E- 324 (for negative) 4. 767 – Integer. 648 to + 2.4…E+38 to -1. 147. 32 bits.2… E+18 to + 9.4…E-45 to 3. 16 bits. 32 bits.79…E+308 • String Range: 0 to ~ 2 billion IENG 331: Ahluwalia 84 .2.94…E-324 to 1. 483.9. Range: -1. Data Ranges • Integers – Short. 147.4…E-45 (for negative). Range: -3. 768 to +32. 64 bits. 1. 483. Range: -32.2…E+18 • Floating Point • Single. 128 bits.. 647 – Long.79…E+308 to -4.

” 4 0010 0000 32 20 “” 5 0100 1010 74 4A “J” D o e . Example: What is the internal representation of “Doe. 85 . 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 “. space J 0100 0100 0110 1111 0110 0101 0010 1100 0010 0000 0100 1010 IENG 331: Ahluwalia .

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 .

Decimal Representation 87 . 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.0240555 E+12 IENG 331: Ahluwalia . 11011100110111001110111* 2100110 1.

3)4 = (?)10 d) Convert (630.C)16 = (?)10 IENG 331: Ahluwalia 88 .2)3 = (?)10 c) Convert (123.011)2 = (?)10 b) Convert (210. Homework 1) Convert the following numbers to base 10 a) Convert (1010.4)8 = (?)10 e) Convert (B65F.

125)10 to base 16 by successive division and multiplication d) Convert (125.125)10 to base 8 by grouping e) Convert (125.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 16 by grouping f) Convert (125.125)10 to base 8 by successive division and multiplication c) Convert (125.125)10 to base 3 IENG 331: Ahluwalia 89 .

82 IENG 331: Ahluwalia 90 . 3) Fill in the ? Hexa- Decimal Binary Octal decimal 29.07 ? ? ? ? C.1101 ? ? ? ? 3.8 ? ? ? ? 101.

and d) (-18)10 in 2’s complement representation. Assume IEEE 754 representation.125)10 b) (-125. a) (18)10 b) (-18)10 in signed magnitude representation c) (-18)10 in 1’s complement representation. Show the results in binary and hexadecimal.125)10 IENG 331: Ahluwalia 91 . a) (125. 5) How will the following numbers be represented on a 16 bit computer? Show the results in hexadecimal. 4) What is the representation of the following on a 16 bit computer.

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 .

d) Sender. Communication medium can be cable. etc. satellite. optic fiber. Data Communication Data communication is an activity associated with transfer of data (digital or analog) between two or more devices. and e) Receiver IENG 331: Ahluwalia 94 . b) Medium. Major Components: a) Message. c) Protocol.

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.) Network Protocols • Open System Interconnection (OSI). etc. developed by International Standards Organization • Transmission Control Protocol/Internet Protocol (TCP/IP) IENG 331: Ahluwalia . modems.

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 1’s sent D0 D1 D2 D3 D4 D5 D6 P 1 0 0 0 0 0 1 0 Odd parity: Odd number of 1’s 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 .

slower • Less overhead. 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. faster IENG 331: Ahluwalia .

TV. e. Simplex-Half-duplex-Full-duplex Transmission Simplex: One direction only. keyboard to computer Half-duplex: Either direction. e. CB radio.g. e. Telephone. but only one direction at a time. computer to computer Full-duplex: Both directions at the same time.g.g. computer to computer IENG 331: Ahluwalia 101 . Radio.

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 .

except each pair is encased in a metal foil or braided metal mesh. Guided Medium Shielded Twisted Pair (STP) • Similar to UTP. 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 .

IENG 331: Ahluwalia 106 . more expensive. 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.

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) .

6 Kbps – 10 Mbps Fiber optic cable 500 Kbps – 100 Mbps High IENG 331: Ahluwalia 108 . 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.

etc. hard drives. Why Data Networks ? • Resource Sharing – Hardware (printers.) – Software (application software) • Information Sharing – Files. E-commerce • Remote computing • Distributed computing • Internet phone (VoIP) IENG 331: Ahluwalia 109 . etc. Database. – Search capability (WWW) – Email.

E-Auctions. Global networking 1973 File Transfer Protocol (FTP) specified 1977 Internet and e-mail started 1980 Transmission Control Protocol (TCP) and Internet Protocol (IP) specified. 1991 User interface to the network developed (www) 1992 Nodes > 3 M. established IENG 331: Ahluwalia 110 . E-Trade. E-commerce. Domain Name Server (DNS) established.000. 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. ASP. 1984 Number of nodes > 25. Netscape). Graphical www browsers developed (Mosaic. etc. Network opened for commercial use. 1996 Nodes > 12 M. 1990 Number of nodes > 300.000. Microsoft introduces Internet Explorer 1999 E-banking.

• Mesh: Connects nodes in a grid. 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. Used by WANs to connect with LANs • Hybrid IENG 331: Ahluwalia . The central node (server) communicates with each node in the network • Extended Star: Often used for larger networks to reduce data traffic. Expensive but reliable.

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 .

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 . Star or Extended Star (Tree) • One node acts as the master node.

N=3. L=15 IENG 331: Ahluwalia . L=3. L=6. L=1. 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. N=4. N=6.

Hybrid • Can utilize a combination of any network topology IENG 331: Ahluwalia .

or campus. Uses packet (small chunks) switching. Suited for room. Packets are passed from node to node between source and destination. Metropolitan Area Network (MAN) over a city. Based on Bus (Ethernet) or Ring topology. Two unidirectional buses 3. building. 2. Local Area Network (LAN) over a small region (<1 mile). Networks Classification 1. Dedicated path only during transmission. Uses single cable (10 to 100 Mbps). Uses broadband or fiber optic cables. Wide Area Network (WAN) over a wide area. 4. and LAN’s). Internet collection of interconnected networks (WAN’s. MAN’s. IENG 331: Ahluwalia . Supports voice and data.

or Ring • Protocol: IEEE 802. LAN: Local Area Network • Typically private networks • Range: < 10 km • Topology: Bus . 802.16 (wireless) • Speed: 10 Mbps to 10 Gbps • Configuration: Cable or wireless IENG 331: Ahluwalia . 802. Star.5 (Ring).3 (Bus).

802. or Mesh • Protocol: IEEE 802.3 (Bus). Tree. Ring.5 (Ring) • Speed: 10 Mbps to 10 Gbps • Configuration: Cable or wireless IENG 331: Ahluwalia . Star. MAN: Metropolitan Area Network • Typically owned by a city • Range: <100 km • Topology: Bus .

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 WAN’s. MAN’s. and LAN’s. • 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 .

between source and destination • Packets sent out of sequence IENG 331: Ahluwalia . Packet Routing through WAN/Internet • Small chunks (packets) of data communicated at a time • Packets pass from node to node.

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. MANs. LAN WAN • The LANs. and WANs find the computer within their domain.

Network Range Network Range (km) Example LAN < 10 Room. Campus MAN < 100 City WAN < 10. 000 Country Internet World wide World IENG 331: Ahluwalia 124 . Building.

Yahoo. case sensitive • HTTP: Hypertext Transfer Protocol • HTML: Hypertext Markup Language – . Some Internet Related Terms • Internet Protocol (IP) address (32 bit number) • URL: Universal Resource Locator – No spaces.htm or . .) • Email Server – POP (Post Office Protocol) – IMAP (Internet Messaging Access Protocol) – Web-based (Hotmail) IENG 331: Ahluwalia .html file extension • Search Engine (Google..

Needs to be the beginning of the HTML document. <p> </p> Specify the beginning of a new paragraph. </font> <font size = X Specifies the font size (from 1 . <hy>…</hy> Specifies the font size of the text. <hr>…</hr> To draw a horizontal line across the document. This does not appear in your document on the screen but at the top of the screen above the ‘menu’ bar. <u> </u> The text within this tag is underlined. Notice that no closing tag is required. <title>…</title> Specifies the title of the page. IENG 331: Ahluwalia 126 . <br> </br> Specifies a break in the text. <I>…</I> The text within this tag appears in italics. It describes the header information of the page as the ‘title’. Used for paragraph formatting. Only difference ></font> being that in the former case the whole sentence has the specified font whereas here we can modify each character’s size. <b>…</b> The text within this tag appears in bold type face. <blink> </blink> The text within this tag blinks. </html> specifies the end of the HTML document. y varies from 1 . The X’s are hexadecimal values. <head> </head> Gives the header description of the document. HTML Tags <html>…</html> <html> Specifies the start document. <font= “#X”> Specifies font color. The BODY of the document lies here. <body>…</body> The main HTML document appears within these two tags. The next paragraph can be specified without closing the first one.7). Equivalent to <Hy>.6 (1 : is the largest font size and 6 : is the smallest font size). (Use this for better appearance).

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.</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. This is the first paragraph. While short it is still a paragraph!</P> <P>And this is the second paragraph. background-color: #FFFFFF"> <marquee>Creating HTML is Piece of cake</marquee> </span> </font> </body> IENG</html> 331: Ahluwalia 127 .

Last IENG 331: Ahluwalia 128 .

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 . 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.

• Uses a dot to separate octets • Each IP address has a prefix and a suffix. • Class is recognized by the decimal value of the first octet.1 IENG 331: Ahluwalia . • Six classes of IP addresses. • Range of each octet is 0 to 255.36. IP Address: 157. IP Addressing Scheme • IP address is a 32 bit number (four bytes or octet).182.

IENG 331: Ahluwalia . • 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. Dotted Decimal Notation • IP address is a 32 bit number (four bytes or octet). • Class is recognized by the decimal value of the first octet.

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 .

EDU Server Server Server Yahoo Google IIE IEEE WVU PSU Server Server Server Server Server CEMR Server IMSE MAE Server Server IENG 331: Ahluwalia .ORG .COM . Domain Name System (DNS) Root Server .

• The TCP/IP is one of the main protocol for packet switched networks. TCP/IP • TCP: Transmission Control Protocol.11 is s set of protocols used for wireless LAN IENG 331: Ahluwalia . It is one of the main p • IP: Internet Protocol. Specifies format of packets and addressing scheme. It consists of five layers • IEEE-802 protocol is used for LAN. It has three layer • IEEE-802. Moves packet from node to node. Establishes connection between sending and receiving hosts. It guarantees that packets will be arranged in the right sequence and delivered from source to destination.

Specifies reliable data transfer 5. Physical layer corresponds to the basic network hardware Layer 4: Transport 2. 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 . Specifies the format of packets and Layer 2: Network Interface store and forward procedure Layer 1: Physical 4. Layers of TCP/IP and IEEE 802 TCP/IP Protocol on hosts and routers TCP/IP Internet Protocol Layer 5: Application 1. Specifies how to transmit data over the Layer 3: Internet network 3.

TCP Header IENG 331: Ahluwalia .