CH#1 Information Representation
CH#1 Information Representation
Number systems
Denary numbers:
which are also known as decimal numbers are written
using one of the symbols 0,1,2,3,4,5,6,7,8,9 for each
denary digit
Denary numbers:
The binary number system is base-2. Each binary digit is
written with either of the symbols 0 and 1.
A binary digit is referred to as a bit.
Binary codes are most often based on the use of one or more
groups of eight bits. A group of eight bits is called a byte.
Number systems
Hexadecimal numbers:
These are base-16 numbers where each hexadecimal
digit is represented by one of the following symbols:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
The overflow means that the answer has a leading 1, which causes a
computer system to interpret the answer as a negative number.
This time there has been a carry when the most significant bits
were added and the result obtained is a positive number.
Binary-coded decimal (BCD) system
The binary-coded decimal (BCD) system uses a 4-bit code
to represent each denary digit:
Uses of BCD
The most obvious use of BCD is in the representation of digits on
a calculator or clock display.
Each denary digit will have a BCD equivalent value which makes
it easy to convert from computer output to denary display.
ASCII codes
The standard ASCII code character set consists of 7-bit
codes (0 to 127 denary or 0 to 7F in hexadecimal);
this represents the letters, numbers and characters
found on a standard keyboard together with 32 control
codes (which use up codes 0 to 31 (denary) or 0 to 19
(hexadecimal)).
Extended ASCII uses 8-bit codes (128 to 255 in
denary or 80 to FF in hex).
This allows for non-English characters and for drawing
characters to be included.
Unicodes
One coding system is called Unicode.
Unicode allows characters in a code form to represent all
languages of the world,
thus supporting many operating systems, search engines and
internet browsers used globally.
There is overlap with standard ASCII code, since the first 128
(English) characters are the same, but Unicode can support
several thousand different characters in total.
create a universal standard that covered all languages and all
writing systems
» produce a more efficient coding system than ASCII
» adopt uniform encoding where each character is encoded as 16-bit
or 32-bit code
» create unambiguous encoding where each 16-bit or 32-bit value
always represents the same character
» reserve part of the code for private use to enable a user to assign
codes for their own characters and symbols (useful for Chinese and
Japanese character sets).
Unicode
Sample Questions
Multimedia
Images can be stored in a computer in two common
formats:
bit-map image
vector graphic
Bit-map images
Bit-map images are made up of pixels (picture
elements);
the image is stored in a two-dimensional matrix of
pixels.
Pixels can take different shapes, such as
» at least 8bits (1 byte) per pixel are needed to code a coloured
image
» true colour requires 3bytes per pixel (24bits), which gives
more than one million colours
» the number of bits used to represent a pixel is called the
colour depth
bit depth is best defined as the number of bits used to store
each of the red, green and blue primary colours in the RGB
colour scheme.
A colour depth of 8 bits per pixel provides 256 different colours.
A bit depth of 8 bits per primary colour provides 256 × 256 × 256
= 16 777 216 different colours.
Image resolution: the number of pixels in the bitmap file
defined as the product of the width and the height values
Screen resolution: the product of width and height values for
the number of pixels that the screen can display
pixel density: the number of pixels per square inch
how pixel density can be calculated
for a given screen.
Imagine we are using an Apple iPhone 8 which has 5.5-
inch screen size and screen resolution of 1920 pixels ×
1080 pixels:
1. add together the squares of the resolution size ((1920 2
+ 1080 2) = (3 686 400 + 16 640) = 4 852800)
2. find the square root =
3. divide by screen size (2202.907 ÷ 5.5 = 401)
This gives us the pixel density of 401 pixels per square
inch (ppi)
Calculating bit-map image file sizes
As an example, consider that a bitmap graphic is needed to
fill a laptop screen where the resolution is 1366 by 768. If
we want colour depth of 24 then the number of bits we
need is:
File Header
when saving a bit-map image, it is important to
include a file header;
this will contain items such as
file type (.bmp or .jpeg)
file size
image resolution
bit depth (usually 1, 8, 16, 24 or 32)
any type of data compression employed and so on.
Vector graphics
Vector graphics are images that use 2D points to describe lines
and curves and their properties that are grouped to form
geometric shapes.
Vector graphics can be designed using computer aided design
(CAD) software or using an application which uses a drawing
canvas on the screen.
A vector graphic will contain a drawing list (included in a file
header) that is made up of
» the command used for each object that makes up the graphic
image
» the attributes that define the properties that make up each object
» the relative position of each object will also need to be included
» the dimensions of each object are not defined, but the relative
positions of objects to each other in the final graphic need to be
defined; this means that scaling up the vector graphic image will
result in no loss of quality.
Comparison between vector graphics and bit-map images
Sound files
Sound is an analogue value; this needs to be digitised in order to
store sound in a computer.
This is done using an analogue to digital converter (ADC).
If the sound is to be used as a music file, it is often filtered first
to remove higher frequencies and lower frequencies which are
outside the range of human hearing.
To convert the analogue data to digital, the sound waves are
sampled at a given time rate.
Coloured image
1
5
1 mark for purpose • Stores data about the file contents/image/metadata
Max 2 marks for examples of contents
• Confirmation that the file is a BMP // confirmation of file type
• File size
• Location / offset of image data within the file
• Dimensions of the image (in pixels) // image resolution
• Colour depth (bits per pixel, 1, 4, 8, 16, 24 or 32)
• Type of compression used (if any)
1 mark per bullet point to max 2 for description
• Instead of storing each repeated sequence of characters individually
• … the character is stored and the number of consecutive occurrences
1 mark for using relevant example e.g.
• instead of storing aaaa , store a4