Chapter 1
Chapter 1
Data Representation
o A base: the number of digits that a number system can use to represent numbers
o Place value for each digit: digits in certain positions have a specific value
128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 0
o Only certain digits are converted to BCD, because particular digits represent a digit
greater than 9.
Practical applications
Two’s Complement
o 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.
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
o Add 1 | 00101010
o Practical applications:
Character Sets
o A character set generally includes upper & lower case letters, number digits,
punctuation marks and other characters.
o Character sets use different binary representations for each character via character
encoding
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.
Multimedia
Bitmap Images
o Data for a bitmapped image is encoded by assigning a solid colour to each pixel, i.e.,
through bit patterns.
o 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.
o 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
Screen Resolution
o Number of pixels which can be viewed horizontally & vertically on the device’s screen
Colour depth: number of bits used to represent the colour of a single pixel
Applications: scanned images and general computer usage ∵ small file size and can be easily
manipulated.
Vector Graphics
o Drawing objects: a mathematically defined construct (of shapes like rectangle, line,
circle, etc.)
o Properties of each object are the basic geometric data which determine the shape and
appearance.
Sound
o Analogue data is continuous electrical signals whereas digital data is discrete electrical
signals.
o Sound signals are vibrations through a medium. Hence are analogue in nature as there
can be an infinite amount of detail for sound.
Sampling Rate
o Number of samples taken per unit time
o Increasing the sampling rate increases accuracy of digitized sound wave representation
but increases the file size
Sampling Resolution
o Increasing sampling resolution increases accuracy of digitized sound wave but increases
the file size
Compression
Compression is the process of reducing file size without a significant loss in quality which results
in
o Faster transfer of compressed files, which uses less bandwidth than uncompressed files.
Lossless Compression
o E.g. bitmap (.bmp), vector graphic (.svg) and .png images, text file compression,
database records
Form of lossless compression which is used for compressing text files and
bitmap images.
Repeating sequence of elements encoded in two values: run count and run
value.
Lossy Compression
o File accuracy/quality lower than that of lossless but file size is lower (~10% of lossless).
o Sound files compression (.mp3) utilizes Perceptual Coding to remove certain parts of
sound that are less audible/discernible to human hearing.