Sie sind auf Seite 1von 68

Denary to Binary Numbers

&
Binary to Denary
Chapter 4 Data Representation
Units
• Bit – 1 bit
• Nibble – 4 bits
• Byte – 8 bits
• Kilobyte – 1024 bytes or 1024x8 bits
• Megabyte – 1024 kilobytes
• Gigabyte – 1024 megabytes
• Terabyte – 1024 gigabytes
• Petabyte - a unit of information equal to one
thousand million million (1015) or, strictly,
250 bytes.
What is a denary number?
• These numbers we use in our everyday lives
are called ‘denary’ numbers, it is also referred
to as “Base-10”, which uses the power of 10:
1000, 100, 10, 1.
Binary

128 64 32 16 8 4 2 1
Base of 2
0 1
• When given a number to e.g. 42
convert to binary you need First lowest number under this from the
a sequence of 0’s and 1’s. table above is 32 so this is where I will
• To be able to convert start:
deniary numbers to binary 101010 = this will get 42
you have to firstly pick the 1x32 =32
first lowest number under 0x16=0
the decimal number given. 1x8=8
• Then how many digits 0x4=0
backwards are you going to 1x2=2
use to add together to 0x1=0
make the number. Add all these together will get 42.
Binary

• Another example 228

128 64 32 16 8 4 2 1

What combinations of the numbers before will make 228?

128 64 32 16 8 4 2 1
1 1 1 0 0 1 0 0

4-bit binary numbers

8 4 2 1

Convert the following denary numbers into 4-bit binary, also referred to as Base-2.

13 =
9 =
14 =
G:\ICT\Miss Elliott\Year 10 2016-
11 = 2018\Chapter 3 - Data
7 = Representation\worksheet6 –
Denary to Binary
5 =
8 =
Binary to denary numbers
Now convert back from binary to denary

1100 8 4 2 1
x X X X
1 1 0 0

8+ 4+ 0+ 0 =16

8 4 2 1
x X X X
0011
0 0 1 1

0+ 0+ 2+ 1 =3
What would happen if the denary number was 23?
Can you write this as 4-bit binary?
Binary to denary numbers
Convert the following 4-bit binary numbers into whole denary numbers:

0001 =
1010 =
1111 =
1100 =
0011 = G:\ICT\Miss Elliott\Year 10 2016-
2018\Chapter 3 - Data
Representation\worksheet6 –
Denary to Binary
8-bit binary numbers =byte

128 64 32 16 8 4 2 1

Convert the following denary numbers into 8-bit binary, also referred to as Base-2.

220 =
300 =
132 =
G:\ICT\Miss Elliott\Year 10 2016-
144 = 2018\Chapter 3 - Data
Representation\worksheet6 –
Denary to Binary
Overflow
• What is binary overflow?

• http://www.bbc.co.uk/education/guides/zjfgjx
s/revision/3

• Watch the video and write a summary in word

of what it is.
HEX to Denary
Denary 50
Binary 0011 0010
BASE of 16 Hex 32

For HEX to be worked out remember:

3 2
X x
16 1
48 + 2 = 50
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
TASK: worksheet – Binary to Hex
Studentshare\ICT
\Miss Elliott\Yr
10\Theory2\Chap
ter 3 Data
representation\
Worksheet 9

EXTENSION 1 on
the sheet

EXTENSION 2
worksheet 10
Starter
• http://ww
seducativas
.com.br/ati
31_binary_
game/binar
y_game.sw
f
http://britton.disted.camosun.bc.ca/binary.swf
Studentshare\ICT
\Miss Elliott\Yr
10\Theory2\Chap
ter 3 Data
representation\
Worksheet 9

EXTENSION 1 on
the sheet

EXTENSION 2
worksheet 10
Hex to Denary to Binary
EXTENSION:
• 7A 8C

• FE 3D

EF
• 9F
A9

• 2B F1

A0
Bits and Bytes
G:\ICT\Miss
Elliott\Year 10
2016-
2018\Chapter 3 -
Data
Representation\
worksheet 11

EXTENSION

0+0=0
1 +0=1
0+1=1
1+1=10
Starter
• http://ww
seducativas
.com.br/ati
31_binary_
game/binar
y_game.sw
f
G:\ICT\Miss
Elliott\Year 10
2016-
2018\Chapter 3 -
Data
Representation\w
orksheet 12

Extension:
to denary
EXTENSION: Can you
convert the following
Denary values to
Hex?
6
10
15
22
36
98
128
160
Starter
0110 1111 1111 1111
+ +
0001 0111 1111 1111
1000 0110 11111 1110 - overflow
1111 1010 1000 1000
+ +
0101 0101 1100 0011

+
1000 1111 +
1010 0001
1110 0011 0111 1001
• Workbook page: 79-80
Recap - starter
• What is binary? 0’s and 1’s switches on and off
• What is HEX? Base 16
• What is denary? Base 10 normal whole
number
• What is over flow? Adds up to more than 255

• Extension:
• http://www.bbc.co.uk/education/guides/z26rcdm/test
Or type in binary quiz bitesize this link is the first link
Revision
• Binary - 22

• HEX – 2A

• Denary - 15
Recap Q’s – worksheet 14 - REVISION
G:\ICT\Miss Elliott\Year 10 2016-2018\Chapter 3
- Data Representation

• What would the denary number 199 be in binary?

• What would the denary number 55 be in binary?
• What would the denary number 222 be in binary?
• What would 10110010 be as a denary number?
• What would 00101110 be as a denary number?
• What would 00100101 + 01000100 be as a binary
number?
• What is an overflow error?
Starter Recap
• 0+0=0
01010111
• 1+0=1
11101110
• 0+1=1
• 1+1=10
11101100
• 1+1+1=11
10011000

11111110
Shifting binary numbers
DIV MOD
• DIV?
• MOD?

• e.g. 7/2
– DIV = 3
– MOD = 1
Starter
• http://www.teach-
ict.com/gcse_new/data_info_knowledge/data
_types/quiz/ontarget_data_types.htm
ASCII – American Standard Code for
Information Interchange
Activity – Worksheet 13 – ASCII Table
G:\ICT\Miss Elliott\Year 10 2016-2018\Chapter 3 - Data Representation

EXTENSION: Create your own ASCII message

• Workbook page: 81
• Complete the table up to letter y starting at r
• G:\ICT\Miss Elliott\Year 10 2016-2018\Chapter 3 - Data
Representation\worksheet 15 – ASCII Table (2)
Starter: Worksheet 15 page 2 Uni Code

• Complete the
uni code.
Representing Images
• Pixels can
be used to
represent
images. A
pixel is short
for picture
element
and is a
single point
in an image.
Representing Images
• Images are displayed as a set of pixels which form together to
make an image. Visual Display Units (VDUs / monitors) display
images using pixels. A true high definition monitor will have
1920 pixels in width and 1080 pixels in height. This works out
at a total of approximately 2 million pixels (2,073,600).
Higher quality Image
• The higher the resolution (more pixels), the better quality an
image will be. This is because there are more pixels which
appear smaller and can’t be seen and so the ‘blocky’ pixelated
effect is not noticed by the human eye. More pixels can also
be used to create the image.

Bitmaps
• A bitmap is an image formed from pixels.
Bitmap size
• The size in pixels of a bitmap is calculated by multiplying the
width of the image in pixels by the height of the image in
pixels:
• Bitmap size in pixels = Width x Height
• The size in pixels is often referred to as the resolution of the
image.
Bitmaps
• G:\ICT\Miss Elliott\Year 10 2016-
2018\Chapter 3 - Data
Representation\Worksheet 16 – Bitmap Size
Starter – Bitmap Images
• What is a Bitmap Image made up of?
• How many pixels is this image made up of:
• Remember it’s the whole grid

• Reduce the pixels of this image what could it

be changed too?
• What is resolution?
Bitmap Images
• Bitmaps are usually the most common file type for images.
Bitmap images are made up of tiny dots called pixels.
• Each colour of each pixel is represented in binary. The number
of colours available in an image is related to the number of
bits the code has?
• What is binary made up of?
• Black and white images only use two colours meaning they
need 1 bit to represent each pixel, 0 for white and 1 for black.
0 1 0 1
1 0 1 0
0 1 0 1
1 0 1 0
• Worksheet
17
Colour Depth and Resolution
• Colour depth is the number of bits used for each
pixel.
• The resolution is the density of pixels in an image,
how many pixels are within a certain are. It is
normally measure in dots per inch (DPI)
• The higher the resolution the more pixels in a
certain area, so the better the quality of image.
• Increasing the colour depth or resolution means
the there are more bits in the image. This
improves the quality of the image but also the file
size.
Bitmap file size
• The formula to calculate the minimum bitmap file size is:
• Minimum Bitmap File Size (bits) = Width x Height x Colour Depth
• Or Size (b) = W x H x D
Bitmap File Size Worksheet
• G:\ICT\Miss Elliott\Year 10 2016-
2018\Chapter 3 - Data
Representation\worksheet 18
• Metadata is the information stored in an image
file which helps the computer recreate the image
on the screen from the binary data in each pixel.
• Metadata usually includes the images file format,
height, width, colour depth and resolution. It may
contain extra info such as time, date
• Without metadata devises would not be able to
display the image on the screen.
Bitmap Images

Storing sound
• Sound is sampled and stored digitally.
• Sound is recorded by a microphone as an analogue signal.
Analogue signals are pieces of continually changing data.
• Analogue signals need to be converted into digital data so
that computers can read and store sound files. This is done
by analogue to digital converters.
Sound
Sampling intervals are the gaps
between each of the points
where the analogue recording is
sampled.

Sampling frequency is how many

samples you take in a second.

Bit rate is the number of bits

used per second.
Increasing the sampling frequency means the analogue recording is sampled
more often.
Increasing the sample size means the digital file picks up quieter sounds.
Storing Sound

Starter – Bitmap Images
• What is a Bitmap Image made up of?
Pixels & bits
• What is resolution?
• How many pixels within the image, quality of the
image
• What signal is sound recorded in? what does it need to
be converted into?
• Recorded as analogue
• Converted into Digital
• What is Sampling frequency?
• Numbers of samples per sound/recording
Compression
• Data compression is when you make file sizes
smaller.
• Take up less storage
• Email service restrictions of file sizes
Image compression
The main thing to remember is that image
compression reduces the file size

There are two types of compression:

• Lossy Compression (JPG)
• Lossless Compression (PNG)

Lossy Compression (JPG)
• Removes data permanently
• Tries to reconstruct an image without the missing data
• Much smaller file sizes but some loss of quality

380 KB 21 KB
Lossy Compression
JPG files are automatically compressed, but this
compression is only achieved by removing some of the
original image data permanently. It is surprising just how
much image data you can remove without noticing any

The compressed image on the right has been overly

compressed and shows the ‘colour banding’ effect that
comes of this. This is caused because the compression
colour and groups them all as being the same colour so
you see harsh bands of 10 different blues rather than a
JPG images are known as compression artefacts.
Lossless compression (PNG)
• Finds areas of the same colour and records them as
15 blue pixels rather than blue pixel, blue pixel, blue
pixel etc.
• 11011010,11011010,11011010,11011010 becomes
00000100-11011010 (4 lots of – 11011010)

Lossless compression works by finding patterns in bit

values and records the number of times they repeat
instead of recording multiple instance of the same bit
value. This method retains all of the information required
to reconstruct the image and is known as Run Length
Encoding (RLE). It will compress an image file, but not by
as much as lossy methods.
PROS & CONS
Pros Cons e.g. file type
Lossy (JPG) • Reduced file size • Can loose data MP3 (audio)
• More files can be stored • Cant be used on text AAC (audio)
• Take up less bandwidth files JPEG (image)
• Lots of softwares can • Worse quality than

Lossless • Data is removed Slight reduction in file PNG (image)

(PNG) temporarily so there is size FLAC (image)
no reduction in quality
• Can be decompressed
• Can be used on text files
Compression

Pros Cons e.g. file type
Lossy (JPG) • Reduced file size • Can loose data MP3 (audio)
• More files can be stored • Cant be used on text AAC (audio)
• Take up less bandwidth files JPEG (image)
• Lots of softwares can • Worse quality than

Lossless • Data is removed Slight reduction in file PNG (image)

(PNG) temporarily so there is size FLAC (image)
no reduction in quality
• Can be decompressed
• Can be used on text files
Starter – Complete Mixed Questions

Revision for Topic Test on Thursday
• Homework: PP is on Show my homework.
• Revision guide if you wish to take one revise
pages: 66-76
• Page 76 gives topic Questions
Logic Gates
• Logic gate takes binary information and gives an output
based on the boolean operator.

• Logic gates are special ciruits built into computer chips.

• They receive binary data, apply boolean operator and then
output the binary result.
• Each type of logic gate is shown by different symbols.
• Each logic gate has its own corresponding truth table.
• Truth table show all of the possible inputs and outputs of 1s
and 0s.
NOT gate
• Not gate takes a single input and gives a single
output.
• The output is always opposite value to the input.
• If 1 is input, it outputs 0. If 0 is the input, 1 is the
output.

TRUTH TABLE

Input Output Input Output

0 1
1 0
AND gate
• AND gate takes two inputs and gives a single
output.
• If 1 and 1 is the inputs, it output 1, otherwise
the output is 0.
TRUTH TABLE

Input A Input A Input B Output

Output
0 0 0
Input B
0 1 0
1 0 0
1 1 1
OR gate
• OR gate takes two inputs and gives a single
output.
• If 1 or more inputs are 1 then the output 1,
otherwise the output is 0.
TRUTH TABLE

Input A Input A Input B Output

Output
0 0 0
Input B
0 1 1
1 0 1
1 1 1
Worksheet 17 – Logic Gate
• G:\ICT\Miss Elliott\Year 10 2016-
2018\Chapter 3 - Data Representation
Page 74