Chapter 1 - Data Representation
Chapter 1 - Data Representation
Cambridge, IGCSE
Chapter 1 – Data Representation
• Analogue data is data that is transmitted or received continuously by our senses (sight and sound)
• A sound waves (music) received over a period
• Everything we see
• As humans we can process and understand it
• Computers cannot process analogue data – they can only process digital data
• Any data we want the computer to process must first be converted into digital data
• Digital data is data that consists of individually recognizable binary digits – 0’s and 1’s
• A sound wave would be sampled at set time intervals and converted into a stream of binary digits
Largest number 9 * 1000 Largest number 9 * 100 Largest number 9 * 10 Largest number 9 * 1
Computer Science, IGCSE
Denary vs Binary
• Binary
• This is what computers use
• Uses digits 0 – 1 and is called a base-2 number system
• The binary value represents the current flowing through a circuit
• 1 means its flowing
• 0 means its not
• The units it uses increase by the power of 2
• Example: the binary number 1010 equates to 10 in Denary
• 0 * 2 power of 0 = 0 +
• 1 * 2 power of 1 = 2 +
• 0 * 2 power of 2 = 0 +
• 1 * 2 power of 3 = 8
Largest number 9 * 1000 Largest number 9 * 100 Largest number 9 * 10 Largest number 9 * 1
128 64 32 16 8 4 2 1
2/7 2/6 2/5 2/4 2/3 2/2 2/1 2 power 0
1 0
128 64 32 16 8 4 2 1
2/7 2/6 2/5 2/4 2/3 2/2 2/1 2 power 0
1 0 0 1 0 1 1 0
Decimal 150 = Binary 10010110 Decimal 44 = Binary ? Decimal 248 = Binary ? Decimal 250 = Binary ?
Computer Science, IGCSE
Beyond 8-bit binary
• Apply the same principles to convert beyond eight bits by simply
using further binary units beyond 128
• Example
2048 1024 512 256 128 64 32 16 8 4 2 1
1 0 1 1 0 0 1 0 1 1 0 1
Dec 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7 8 9 A B C D E F
Hex
Largest number 9 * 1000 Largest number 9 * 100 Largest number 9 * 10 Largest number 9 * 1
Largest number 15 * 4096 Largest number 15 * 256 Largest number 15 * 16 Largest number 15 * 1
Hex 9 = 9 * 16 power 0 = 9 +
Hex F = 15 * 16 power 1 = 240
Answer is 249
Binary Hexadecimal
101111001001 à 11 12 9 BC9 to decimal: 11 12 9
B C 9
To binary 101111001001
Hexadecimal: BC9
Computer Science, IGCSE
Tasks
• Question 1: A stopwatch displays Hours Minute and Seconds (3 marks)
0 1: 5 4 :2 3
0 0 0 1
What values must be in the 4-bit registers
0 0 1 0 to represent a speed of 074?
1 0 0 1
Computer Science, IGCSE
Tasks
Question 4B: What does the speedometer show if the 4-bit registers contain the following
0 0 1 0
0 1 0 1
1 0 0 0
• A register is a small piece of memory built into the CPU (Central Processing Unit) of a
computer system, where values and instructions are temporarily held
• They are small in capacity but have an extremely fast read and write rate
• Data can be written to and read from a register much faster than from primary (Main
Memory/RAM) or secondary storage (Hard Disk)
• Computer systems use registers to hold data and instructions for processing to
increase the speed at which they can be processed – if these values were processed
straight from primary memory, processing would be much slower
• Program Counter (PC) – holds the address of the next instruction in memory
• Accumulator (ACC) – general purpose register for calculations in the Arithmetic Logic Unit
• Memory Address Register (MAR) – contains the address of a location in memory
• Memory Data Register (MDR) – holds an instruction or data fetched from memory or being taken to memory
• Hardware registers
• Specific to different types of hardware
• Used to convey a signal e.g., to a robot to raise arm, open grip, close grip
• Each motor works via a signal – 1 for on, 0 for off
• A register is used for each motor to convey the signal
• Standard Windows error message codes are given in hexadecimal e.g., HTTP Error 404 – File
Not Found
• Media Access Control (MAC) addresses are 12-digit hex numbers that uniquely identify each
different device in a network e.g., 00-1B-63-84-45-E6
• Machine code consists of simple instructions that are directly executed by the CPU.
Hexadecimal is used for machine code as each byte can be coded as 2 hexadecimal
characters (1 hex char == 4 bits)
~10 I
/
/
'"'
'..
-
, I
I
I \
\
-> \
,
' '
::J J
I \ /--.
m
I \ I '\ \ J
/
'
I
''
"'O
C I \ ./
I
::I
I \ I \
0 5 l \ J
V)
I \ I
I '\ /: \ I
\ I \ I
I '-../ ' \I
I
'
0
,
I ' '-/
8 9 10 11 12
4 5 6 7
0 1 2 3
Time samples
9
1
10 \ 11
1
I 12 '
I
6 7 8
Time sample 1 2 3 4 5
8 5 8 \ 5.5 \
4 1.5 9 I
13 3.5 9 I
Sound value , 9 9
If we then play back the recording the system will use the value at each sample interval to do
this. The resu ltant wave is shown in Figure 1.15.
15 1 I \ \
/
~'-
' \
\
V
/
"' 1
~10
-
:l
I
J
" /
/\
\. I
J ---..........__
/ '"'-.
-0
I
I "
'\.
:/
/ \
\.
I '" " " , /
' ------- I
C
:l
0 5 I '\ \. I
(/)
I \., I
I
I
0 - - a I I
l I
8 9 10 11 '
12.
Time samoles
15 I
l I \ \
I\.
1
\
I \ \
"' LO I/
/ / .'\." '
/ / " \.
'\.\
' \
\
\
' \
\
->
(I)
:, V "\
\ / /·
------ \ "-. - \ \
"'
n:, J .
/ / l["....._
I \ I I \\ I
""C
II \ II '\ I I /
C:
:::,
II \. II I \ V \ "'\\
5
"'
0 \
V,
II f I \ J \
II / \ / j \ \ \
I '-......../ \ I I \ I \ \
I \....._,I V \ \
I I \ \
0 I I I 1
10 11 11
I I
0 1 2 3 4 5 6 7 8 9
Time samples
Computer Science, IGCSE
Video - link
• https://youtu.be/zt_JvGbQUbE