Professional Documents
Culture Documents
Lecture 3
Data Formats
objectimagegallery.com
1
Prof. Peter Khaiter
Lecture Template:
Data Forms
Data conversion and representation
Data Formats
Alphanumeric Data
Image Data
Audio Data
Data Input
Data Compression
Internal Computer Data Format 2
Data Forms
Human communication
Includes language, images and sounds
Computers
Process and store all forms of data in
binary format
Conversion to computer-usable
representation using data formats
Define the different ways human data
may be represented, stored and
processed by a computer
3
Data conversion and representation
4
Data formats
Proprietary formats
Unique to a product or company
E.g., Microsoft Word, Word Perfect
Standards (evolve in two ways):
Proprietary formats become de facto
standards (e.g., Adobe PostScript)
Invented by an international standard
organization (e.g., Motion Pictures
Experts Group, MPEG)
5
Common Data Representations
7
Standard Alphanumeric Formats
8
Binary-Coded Decimal (BCD)
7 0 9 3
10
Standard Alphanumeric Formats
BCD
ASCII Next 13 slides
EBCDIC
Unicode
11
ASCII Features
12
ASCII Table
95 Printing codes
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL
16
ASCII Table
33 Control codes
000 001 010 011 100 101 110 111
0000 NULL DLE 0 @ P ` p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 " 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EDT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f v
0111 BEL ETB ' 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1111 SI US / ? O _ o DEL
17
ASCII Table
Alphabetic codes
MSD
LSD 0 1 2 3 4 5 6 7
0 NUL DLE SP 0 @ P p
1 SOH DC1 ! 1 A Q a W
2 STX DC2 “ 2 B R b r
3 ETX DC3 # 3 C S c s
4 EOT DC4 $ 4 D T d t
5 ENQ NAK % 5 E U e u 7416
6 ACJ SYN & 6 F V f v
111 0100
7 BEL ETB ‘ 7 G W g w
8 BS CAN ( 8 H X h x
9 HT EM ) 9 I Y i y
A LF SUB * : J Z j z
B VT ESC + ; K [ k {
C FF FS , < L \ l |
D CR GS - = M ] m }
E SO RS . > N ^ n ~
F SI US / ? O _ o DEL
21
Example: “Hello, world”
CR 0D carriage return
LF 0A line feed
HT 09 horizontal tab
DEL 7F delete
NULL 00 null
Hexadecimal code
23
ASCII Table: Common Control Codes
BCD
ASCII
EBCDIC Next 3 slides
Unicode
25
EBCDIC
26
EBCDIC Table (1 out of 2)
27
EBCDIC Table (2 out of 2)
28
Standard Alphanumeric Formats
BCD
ASCII
EBCDIC
Unicode Next 2 slides
29
Unicode
30
Two-byte Unicode Assignment Table
31
Collating Sequence
32
Two Classes of Codes
Printing characters
Produced output on the screen or
printer
Control characters
Control position of output on screen or
printer
Cause action to occur
Communicate status between computer
and I/O device
33
Control Code Definitions (ASCII Table)
34
Escape Sequences
1B16 5B16
35
Escape Sequences: Examples
36
Alphanumeric Input: Keyboard
Scan code
Two different binary scan codes generated
when key is struck and when key is released
Converted to Unicode, ASCII or EBCDIC by
software in terminal or PC
Received by the host as a stream of text and
other characters, i.e. in the sequence typed
Advantage
Easily adapted to different languages or
keyboard layout
Separate scan codes for key press/release for
multiple key combinations
Examples: shift and control keys 37
Shift Key
a 1 1 0 0 0 0 1 a
Shift a 1 0 0 0 0 0 1 A
38
Control Key
c 1 1 0 0 0 1 1 c
Ctrl c 0 0 0 0 0 1 1 ETX
Control
code 39
Keyboard Input
43
Image Data
44
Image Input
45
Bitmap Images
46
Bitmap Display
47
Storing Bitmap Images
48
GIF (Graphics Interchange Format)
50
JPEG
(Joint Photographers Expert Group)
54
Popular Object Graphics Software
57
Representing Characters as Images
59
Video Images
Sampling rate
normally 50KHz
62
Sampling Rate
63
MIDI
MP3
Derivative of MPEG-2 (ISO Moving Picture
Experts Group)
Uses psychoacoustic compression techniques
to reduce storage requirements
Discards sounds outside human hearing
range: lossy compression
WAV
Developed by Microsoft as part of its
multimedia specification
General-purpose format for storing and
reproducing small snippets of sound
65
.WAV Sound Format
66
Data Compression
Repetition
0587000034000 015870434
03
Example: large blocks of the same color
Pattern Substitution
Scans data for patterns
Substitutes new pattern, Pe pi ed
makes dictionary entry er ck pe
Example: 45 to 30 bytes Pi
plus dictionary
Peter Piper picked a peck of pickled peppers.
t p a of l pp s.
68
Internal Computer Data Format
69
Five Simple Data Types
71