0% found this document useful (0 votes)
59 views8 pages

Chapter-1 A Levels

The document discusses various methods of representing data digitally including binary, hexadecimal, character encoding and different file formats. It covers topics like data representation systems, encoding of text, images, sound and various compression techniques.

Uploaded by

waseem sabri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views8 pages

Chapter-1 A Levels

The document discusses various methods of representing data digitally including binary, hexadecimal, character encoding and different file formats. It covers topics like data representation systems, encoding of text, images, sound and various compression techniques.

Uploaded by

waseem sabri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Chapter -1

1
Author : Mhuammad Waseem sabri Mobile :03456888208

Information Representation

Data Representation

 The basis of any number system consists of:

 A base: the number of digits that a number system can use to represent numbers

 Place value for each digit: digits in certain positions have a specific value

 Denary - Base 10 integer digits

 Binary Systems - Base 2

 Possible bits (binary digits): 0 and 1

 All data and characters are represented in binary

128 64 32 16 8 4 2 1

0 0 0 0 0 0 0 0
 E.g. 65 in binary is 1000001

 Denary vs. Binary prefixes:

Denary Prefix factor value BinaryPrefix factor value

kilo- (k) ×103 kibi- (Ki) ×210

mega- (M) ×106 mebi- (Mi) ×220

giga- (G) ×109 gebi- (Gi) ×230

tera- (T) ×1012 tebi- (Ti) ×240


 Binary Coded Decimal (BCD)

 Binary representation where each positive denary digit is represented by a sequence of 4 bits (nibble)

 Only certain digits are converted to BCD, because particular digits represent a digit greater than 9.

 Ex. 429 in BCD:

 Convert each digit to their binary equivalents


2
Author : Mhuammad Waseem sabri Mobile :03456888208

 410 = 0100 | 210 = 0010 |910 = 1001

Concatenate the 3 nibbles (4-bit group) to produce BCD: 0100 0010 1001

Practical applications

 A string of digits on any electronic device displaying numbers (eg. Calculators)

 Accurately measuring decimal fractions

 Electronically coding denary numbers

Two’s Complement

 We can represent a negative number in binary by making the most significant bit (MSB) a sign bit, which

indicates whether the number is positive or negative.

 Converting negative denary into binary (ex. -42)

 Find the binary equivalent of the denary number (ignoring the -ve sign) | 42 = 101010

 Add extra 0 bits before the MSB, to format binary number to 8 bits | 00101010

 Convert binary number to one’s complement (flip the bits) | 11010101

 Convert binary number to two’s complement (add 1) |1010101 + 1 = 11010110

 Converting binary two’s complement into denary (ex. 11010110)

 Flip all the bits | 00101001

 Add 1 | 00101010

 Convert binary to denary and put a –ve sign) | -42

 Maximum positive number in 8 bits: 127

 Maximum negative number in 8 bits: -128

Hexadecimal Systems - Base 16

 Possible digits: 0 to 9 and A to F, where A to F represent denary digits 10 to 15


3
Author : Mhuammad Waseem sabri Mobile :03456888208

Practical applications:

 Defining colours in HTML

 Defining Media Access Control (MAC) addresses

 Assembly languages and machine code

 Debugging via memory dumps

 E.g. A5 in Denary = (16×10) + (1×5) = 165

 E.g. 65 in Hexadecimal = 65÷16=4 Remainder 1∴ = 41

Character Sets

 A character set generally includes upper & lower case letters, number digits, punctuation marks and

other characters.

 Character sets use different binary representations for each character via character encoding

 Character Encoding Standards:

ASCII Extended ASCII Unicode

ASCII’s extension - Also Superset for ASCII & extended


Only English alphabets can be
includes most European ASCII - recognized by various
represented
languages’ alphabets global languages

Each character encoding takes ASCII extended to 8 bits, Greater range of characters, as
up 7 bits, hence 128 possible hence 256 possible it uses 2 or 4 bytes per
characters characters. character.

2 or 4 times more storage


Smaller storage space.
space per character.
Advertisement

Multimedia

Bitmap Images

 Data for a bitmapped image is encoded by assigning a solid colour to each pixel, i.e., through bit

patterns.
4
Author : Mhuammad Waseem sabri Mobile :03456888208

 Bit patterns are generated by considering each row of the grid as a series of binary colour codes which

correspond to each pixel’s colour.

 These bit patterns are ‘mapped’ onto main memory

 Pixels: smallest picture element whose colour can be accurately represented by binary

 Bitmap image also contains the File Header which has the metadata contents of the bitmap file,

including image size, number of colours, etc.

Image Resolution

 Pixel density which is measured by no. of pixels/cm

 If image resolution increases, then image is sharper/more detailed

Screen Resolution

 Number of pixels which can be viewed horizontally & vertically on the device’s screen

 Number of pixels = width × height

 E.g. 1680 × 1080 pixels

 Colour depth: number of bits used to represent the colour of a single pixel

 An image with n bits has 2n colours per pixel

 E.g. 16-colour bitmap has 4 bits per pixel ∵ 2^4=1624=16

 Colour depth↑: colour quality↑ but file size↑

 File Size = Number of Pixels × colour depth

 Convert bits to bytes by dividing by 8 if necessary.

 Applications: scanned images and general computer usage ∵ small file size and can be easily

manipulated.

Vector Graphics

 Made up of drawing objects


5
Author : Mhuammad Waseem sabri Mobile :03456888208

 Drawing objects: a mathematically defined construct (of shapes like rectangle, line, circle, etc.)

 Drawing list: set of commands defining the vector

 Properties of each object are the basic geometric data which determine the shape and appearance.

 Data is encoded using mathematical formulas to generate properties in order to draw lines & curves to

create the image

 If object is resized, properties are recalculated.

∴ Scalable without losing quality unlike bitmaps

 Applications: company logos

Sound

 Analogue data is continuous electrical signals whereas digital data is discrete electrical signals.

 Sound signals are vibrations through a medium. Hence are analogue in nature as there can be an infinite

amount of detail for sound.

 Analogue signals converted (encoded) to digital signals by sampling:

 Sound wave’s amplitude (height) sampled at set time intervals

 These samples (amplitudes) are encoded as a binary number sequence

 This sequence provides a digital representation of the sound wave

Sampling Rate

 Number of samples taken per unit time


6
Author : Mhuammad Waseem sabri Mobile :03456888208

 Increasing the sampling rate increases accuracy of digitized sound wave representation but increases

the file size

Sampling Resolution

 Number of bits used to encode each sample

 Increasing sampling resolution increases accuracy of digitized sound wave but increases the file size

 Bit Rate: no. of bits for storing 1 second of sound

Bit\ Rate=Sampling\ Rate × Sampling\ ResolutionBit Rate=Sampling Rate×Sampling Resolution

File Size=Bit Rate * Length of Sound

Compression

 Compression is the process of reducing file size without a significant loss in quality which results in

 Reducing the time needed to search for data.

 Faster transfer of compressed files, which uses less bandwidth than uncompressed files.

Lossless Compression

 Type of compression that allows original data to perfectly reconstructed from compressed file when the

file is opened by utilizing some form of replacement.

 E.g. bitmap (.bmp), vector graphic (.svg) and .png images, text file compression, database records

Run-length Encoding (RLE)

 Form of lossless compression which is used for compressing text files and bitmap images.

 Reduces file size of a sequence of elements which has adjacent, identical elements (characters in text

file and pixels in bitmap images).

 Repeating sequence of elements encoded in two values: run count and run value.

 E.g. RLE of bitmap image:


7
Author : Mhuammad Waseem sabri Mobile :03456888208

 We can represent the first row as a sequence of pixels: “W B B W W B B W” | W: white and B: black

 After applying RLE: “W 2B 2W 2B W”.

 In ‘2B’ 2 is the run count and B is the run value, which represents a run of two adjacent black pixels

 Process is repeated for other rows.

Lossy Compression

 Type of compression which irreversibly eliminates unnecessary data

 File accuracy/quality lower than that of lossless but file size is lower (~10% of lossless).

 E.g. Sound files (.mp3), .jpeg images

 Sound files compression (.mp3) utilizes Perceptual Coding to remove certain parts of sound that are less

audible/discernible to human hearing.

You might also like