2-Data Formats

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

INTRODUCTION TO

NETWORKING

Data Formats
Objectives
Understand how data is
represented, and stored, inside a
computer.

Understand how data is


manipulated inside a computer.

Understand how we represent that


data externally for easier
understanding and manipulation by
humans
Perform data conversions.
Data Formats

■ Computers
– Process and store all forms of data in binary format.

■ Data formats
– Specifications for converting data into computer-usable form.
– Define the different ways human data may be represented, stored and
processed by a computer.
Digital vs. Analog

■ Computing systems are finite machines. They store a limited


amount of information, even if the limit is very big.

– The goal is to represent enough of the real world data to satisfy our
computational needs and our senses of sight and sound.
– The information can be represented in one or two ways: analog or
digital.
Digital vs. Analog

■ Analog data is a continuous representation, analogous to the


actual information it represents.

– For example, a mercury thermometer is an analog device. The mercury


rises in a continuous flow in the tube in direct proportion to the
temperature.
Digital vs. Analog

■ Digital data is a discrete representation, breaking the


information up into separate (discrete) elements.

– Computers cannot work with analog information directly, so there is a


need to digitise the analog information.
– This is done by breaking the analog information into pieces and
representing those pieces using binary digits.
Digital vs. Analog

■ Why digital signal?


– Both electronic signals (analog and digital) degrade as they move
down a line. The voltage of the signal fluctuates due to environmental
effects.
– As soon as an analog signal degrades, information is lost. Since any
voltage level within the range is valid, it is impossible to know that
the original signal was even changed.
– Digital signals jump sharply between two extremes (high and low
state). A digital signal can degrade quite a bit until the information is
lost, because any value over a certain threshold is considered high
value and below the threshold is considered low value.
Digital vs. Analog

■ You can still retrieve the information from a reasonably


degraded digital signal.
■ Periodically a digital signal is reclocked to regain its original
shape. As long as it is reclocked before too much degradation,
no information is lost.

1 1 Threshold
1 1 1 1 1 1
0 0 0 0 0 0 0 0
Digital Signal
Digital Signal Degradation

Analog Signal Analog Signal Degradation


Binary Representation

■ Why binary representation (as opposed to decimal or octal,


etc..)?
– Because the devices that store and manage the digital data are far less
expensive and complex for binary representation.
– They are also far more reliable when they have to represent one out of
two possible values.
– Because the electronic signals are easier to maintain if they carry only
binary data.
Binary Representation

■ One bit can be either 0 or 1. Therefore, one bit can represent


only two outputs.
■ To represent more than two outputs, we need multiple bits.
Two bits can represent four outputs because there are four
combinations of 0 and 1 that can be made from two bits: 00,
01, 10,11.
■ In general, n bits can represent 2n outputs because there are 2n
combinations of 0 and 1 that can be made from n bits. Note
that every time we increase the number of bits by 1, we
double the number of things we can represent.
Binary Conversion

■ Decimal to Binary
– 2510 = 1 10012
– 14510 = 1001 00012
– 210 = 102

■ Binary to Decimal
– 1111 00002 = 24010
– 11112 = 1510
– 1002 = 410
Binary Conversion

■ Octal to Binary
– 258 = 010 1012
– 1458 = 001 100 1012
– 28 = 0102

■ Binary to Octal
– 1111 00002 = 3608
– 11112 = 178
– 1002 = 48
Binary Conversion

■ Hexadecimal to Binary
– 2516 = 0010 01012
– 14516 = 0001 0100 01012
– 216 = 00102

■ Binary to Hexadecimal
– 1111 00002 = F016
– 11112 = F16
– 1002 = 416
Binary Conversion

Binary Decimal Octal Hexadecimal


0000 0000 0 0 0
0000 0001 1 1 1
0000 0010 2 2 2
0000 0011 3 3 3
0000 0100 4 4 4
0000 0101 5 5 5
0000 0110 6 6 6
0000 0111 7 7 7
Binary Conversion

Binary Decimal Octal Hexadecimal


0000 1000 8 - 8
0000 1001 9 - 9
0000 1010 10 - A
0000 1011 11 - B
0000 1100 12 - C
0000 1101 13 - D
0000 1110 14 - E
0000 1111 15 - F
Data Representation

• ASCII
• EBCDIC
• Unicode
Data Representation - ASCII

• Stands for American Standard Code for Information


Interchange
• Computers can only understand numbers, so an ASCII
code is the numerical representation of a character such
as 'a' or '@' or an action of some sort.
• ASCII codes represent text in computers,
communications equipment, and other devices that work
with text
• Originally consisted of 7 bits for each character, later it
has been extended to 8 bits (127 characters)
Data Representation - EBCDIC

• Stands for Extended Binary Coded Decimal Interchange


Code
• Is an 8 bit coding scheme
• It is a binary code for alphabetic and numeric characters
that IBM developed for its larger operating systems.
• All IBM mainframe computers, even the most recent
models, continue to support EBCDIC so that legacy
applications can be run without modification.
• IBM's PC and workstation operating systems do not use
IBM's proprietary EBCDIC. Instead, they use the industry
standard code for text, ASCII.
Data Representation - UNICODE

• A subset of ASCII
• Uses 2 bytes (16 bits) for each character, instead of 1
byte (8 bits)
• Coding scheme capable for representing all world‘s
language
• Takes up twice as much memory space and hard disk
space
Data Representation

How is a letter converted to binary form and back ?

Step 1.
The user presses Step 2.
the capital letter An electronic signal for the
D (shift+D key) capital letter D is sent to the
on the keyboard. system unit.

Step 4. Step 3.
After processing, the binary code for the
The signal for the capital letter D is converted
capital letter D is converted to an image, to its ASCII binary code (01000100) and is
and displayed on the output device. stored in memory for processing.

You might also like