Data
representation
How is data represented in computers ?
Data is represented on computers by many ways like :
● Binary
● Hexadecimal
● Color
● ASCII
● Unicode
● File types
● Encryption
● Images
● Audio
● Video
Binary
Binary is the language of computers it
consists of 0’s and 1’s so it’s also named
base-two , each digit is a bit . It is used to
code everything in computers since it’s the
only language that computers understand .
0 Off
1 On
Hexadecimal
Hexadecimal consists of numbers from 0 to 9 and
letters from A to F so it’s named base-sixteen ,
each digit is four bits that means that a single
hex-digit is equal to four binary-digits . Hex-digits
use less memory so more numbers can be stored in
computer systems and it’s usually used in
programming languages .
Color
Color representation is very important in computers . Colors can be
represented by hexadecimal but it’s often represented by RGB , a
computer can represent 16 million colors while a human eye can only
see 10 million colors . In RGB colors can be represented in the following
method :
● Red 255,0,0
● Green 0,255,0
● Blue 0,0,255
● White 255,255,255
● Black 0,0,0
We can represent other colours by mixing each red , green and blue
together in different intensities .
ASCII
American Standard Code for
Information Interchange known as
ASCII , it’s the most used text
format used to represent data on
computers and the internet . ASCII
represents characters using only 8
bits , which means that there is a
limit to how many characters can
be represented.
Unicode
Unicode is also a text format but it’s different
than ASCII , ASCII can only represent latin
alphabets , symbols and numbers while
unicode represents all languages’ alphabets
, symbols , numbers and even emojis .
Unicode characters can be represented by 8 ,
16 , 24 or 32 bits so there are no limits to the
number of characters . The first 128 unicode
characters are the same as those at ASCII so
files , browsers and apps that works with
unicode will show the correct ASCII
characters .
File types
We can know the type of a file by
looking at it’s extension . Some popular
file extensions :
● Audio files .mp3
● Compressed files .zip
● Image files .png
● Video files .mp4
Encryption
Data encryption is a process where
readable text becomes unreadable text ,
the opposite of encryption is decryption
, it’s a process where unreadable text
becomes readable text . Decryption can
only happen if we know the encryption
key .
Images
Raster : Vector :
Raster images are images that are are made of Vector images are images that are made of
pixels . Some raster image files extensions :
lines , shapes and mathematical equations
● JPEG ( Joint Photographic Experts Group ) . Some vector image files extensions :
● PNG ( Portable Network Graphics )
● GIF ( Graphics Interchange format ) ● SVG ( Scalable Vector Graphics )
● BMP ( BitMaP ) ● EPS ( Encapsulated PostScript )
● TIFF ( Tagged Image File Format ) ● AI ( Adobe Illustrator )
● PDF ( Portable Document Format )
● DXF ( Drawing Exchange Format )
Audio
Audio is a multimedia type , digital microphones convert
sounds into binary so that they are recorded and changes
them to sound waves . Some audio files extensions :
● Lossless
❏ .flac
❏ .wav
❏ .aiff
❏ .dsf
● Lossy
❏ .mp3
❏ .aac
❏ .ogg
❏ .wma
Video
Videos are moving images
and audio waves together
.
Sources
● learn.udacity.com
● wikipedia.org