0% found this document useful (0 votes)
217 views

Workbook Number System

This document provides information about different number systems used in computers such as binary, decimal, hexadecimal, and their conversions. It explains: - Binary uses two digits (0,1) and is used internally in computers. Decimal uses 10 digits (0-9) and is the common system. - Hexadecimal represents 4 binary bits as a single hex digit for convenience. It uses 16 digits (0-9 and A-F) and finds applications in color codes, MAC addresses, assembly languages. - Conversions between number systems like binary to decimal and vice versa are explained through examples using a columnar approach to determine place values. Hexadecimal to binary and vice versa are also covered. -

Uploaded by

Abu Kaleem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
217 views

Workbook Number System

This document provides information about different number systems used in computers such as binary, decimal, hexadecimal, and their conversions. It explains: - Binary uses two digits (0,1) and is used internally in computers. Decimal uses 10 digits (0-9) and is the common system. - Hexadecimal represents 4 binary bits as a single hex digit for convenience. It uses 16 digits (0-9 and A-F) and finds applications in color codes, MAC addresses, assembly languages. - Conversions between number systems like binary to decimal and vice versa are explained through examples using a columnar approach to determine place values. Hexadecimal to binary and vice versa are also covered. -

Uploaded by

Abu Kaleem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Computer

2210
Number System Workbook by
Inqilab Patel

Inqilab Patel ([email protected])


Ruknuddin.com
Computer 2210

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

1.1 Data representation


Candidates should be able to:
1.1.1 Binary systems
recognise the use of binary numbers in computer systems
convert denary numbers into binary and binary numbers into denary
show understanding of the concept of a byte and how the byte is used to measure memory size
use binary in computer registers for a given application (such as in robotics, digital instruments and c
ounting systems)
1.1.2 Hexadecimal
represent integers as hexadecimal numbers
show understanding of the reasons for choosing hexadecimal to represent numbers
convert positive hexadecimal integers to and from denary
convert positive hexadecimal integers to and from binary
represent numbers stored in registers and main memory as hexadecimal
identify current uses of hexadecimal numbers in computing, such as defining colours in Hypertext M
arkup Language (HTML), Media Access Control (MAC) addresses, assembly languages and machine
code, debugging
1.1.3 Data storage
show understanding that sound (music), pictures, video, text and numbers are stored in different for
mats
identify and describe methods of error detection and correction, such as parity checks, check digits,
checksums and Automatic Repeat reQuests (ARQ)
show understanding of the concept of Musical Instrument Digital Interface (MIDI) files, jpeg files, MP
3 and MP4 files
show understanding of the principles of data compression (lossless and lossy compression algorith
ms) applied to music/video, photos and text files

Number System:The system of counting and calculating is called number system.


Number system is based on some characters called digits. The number of digits i
s known as base or radix of the number system. For example binary number system us
es two characters 0 and 1 and its base is 2.
Computer uses following four numbers:
i) Denary (Decimal) number system
ii) Binary number system
iii) Hexadecimal number system
Denary (Decimal) Number System:The number system which is based on 10 characters from 0 to 9 is called denar
y (decimal) system.
It is the most common number system. The digits of decimal system are 0, 1, 2, 3
, 4, 5, 6, 7, 8, and 9. The value of each digit in a figure depends upon its weight. The we
ights are based on power of 10.
The weights of digits according to their positions are given below:
Position
5th
4th
3rd
2nd
1st
4
3
2
1
Weight
10 =10000
10 =1000
10 =100
10 =10
100=1
Computer Science by Inqilab Patel

Page 2

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

For example 76854 can be expressed as:


76854 = 7 x 104 + 6 x 103 + 8 x 102 + 5 x 101 + 4 x 100
= 7 x 10000 + 6 x 1000 + 8 x 100 + 5 x 10 + 4 x 1
= 70000 + 6000 + 800 + 50 + 4
= 76854
Binary Number System:The number system which is based on 2 characters 0 and 1 is called binary syst
em.
Computer circuitry represents data in a pattern of ON and OFF states of electric
current. The state ON is represented by 1 and OFF is represented by 0. Binary syste
m is used for internal working of electronic computers.
The value of each digit in a figure depends upon its weight. The weights are base
d on power of 2.
The weights of digits according to their positions are given below:
With the help of above chart we can derive a sequence of number, that sequence is kno
wn as Binary Notation. The binary notation is a sequence of numbers are based on pow
er of two and arrange from right to left, as given below:
Position
5th
4th
3rd
2nd
1st
Weight
24=16
23=8
22=4
21=2
20=1
29
512

28
256

27
128

Binary notation is .512 256

128

64

Position
Binary No
tation

211
210
2048 1024

26
64

32

25
32

16

24
16

23
8

22
4

21
2

20
1

Uses of Binary Numbers:


For example 1001112 can be expressed as:
1001112= 1 x 25 + 0 x 24 + 0 x 23 + 1 x 22 + 1 x 21 + 1 x 20
= 1 x 32 + 0 x 16 + 0 x 8 + 1 x 4 + 1 x 2 + 1 x 1
= 32 + 0 + 0 + 4 + 2 + 1
= 3910
Hexadecimal Number System:The number system which is based on 16 characters from 0 to 9 and A, B, C, D, E & F is called
Hexadecimal system.
The reason for the common use of hexadecimal numbers is the relationship between the number
4
s 2 and 16. Sixteen is a power of 2 (16 = 2 ). Because of this relationship, four digits in a binary number c
an be represented with a single hexadecimal digit.

Computer Science by Inqilab Patel

Page 3

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

The weights of digits according to their positions are given below:


Position
5th
4th
3rd
2nd
Weight
164=65536
163=4096
162=256
161=16

Zero
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Eleven
Twelve
Thirteen
Fourteen
Fifteen
Sixteen
Seventeen

Binary
0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
10000
10001

Denary
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

1st
160=1

Hexadecimal
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10
11

Uses of Hexadecimal System:


Uses of Hexadecimal in HTML:
Hyper Text Markup Language is used to develop Websites. In HTML a colour is specified according to th
e intensity of its Red, Green and Blue (RGB) components, each represented by eight bits. Thus, there are
24 bits used to specify a web colour, and 16,777,216 colours that may be so specified. It's easier for the
human programmer to represent a 24-bit integer, often used for 32-bit colour values, as #FF0099 instead
of 111111110000000010011001

Uses of Hexadecimal in MAC Address:


Media Access Control assigns a unique number to each IP network adapter called the MAC address. A
MAC address is 48 bits long. The MAC address is commonly written as a sequence of 12 hexadecimal di
gits as follows:
48-3F-0A-91-00-BC

Uses of Hexadecimal in Debugging:


Debugging allows programmers to detect, diagnose, and eliminate errors in a program. The source debu
gger uses the hexadecimal values of the characters

For example 213416 can be expressed as:


213416= 2 x 163 + 1 x 162 + 3 x 161 + 4 x 160
= 2 x 4096 + 1 x 256 + 3 x 16 + 4 x 1
= 8192 + 256 + 48 + 4
= 850010
Computer Science by Inqilab Patel

Page 4

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

Conversion:
Convert a denary number into a binary number:
To convert a denary number into a binary number, create a binary notation in column diagram where the l
eftmost column heading is greater than the denary number and follow these steps:
Start on the left of the diagram.
If the column heading is less than the denary number:
a. Put a 1 in the column.
b. Subtract the column heading from the denary number.
c. Move to the next column to the right.
3. d. Go to step 2.
4. If the column heading is greater than the number:
a. Put a 0 in the column.
b. Move to the next column to the right.
c. Go to step 2.
You are normally only expected to be able to do this with numbers up to 255, because that is the biggest
number that can be stored in one byte. You may be asked to use more bits for larger numbers.
As an example, we change the denary number 117 into a binary number. First, we set up the column diag
ram up to column heading 128 (which is larger than 117).
1.
2.

128

64

32

16

Then we follow the algorithm. 128 is greater than 117 so put a 0 in the 128s column and move to the 64s
column

128
0

64

32

16

64 is less than 117 so put a 1 in the 64s column, subtract 64 from 117 (117-64= 53) and move to the 32s
column.

128
0

64
1

32

16

32 is less than 53, so put a 1 in the 32s column, subtract 32 from 53 (53-32= 21) and move to the 16s col
umn.

128
0

64
1

32
1

16

If you continue this until you reach 1 or 0 in the denary number, the result is:

Computer Science by Inqilab Patel

Page 5

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

128
0

64
1

32
1

16
1

8
0

4
1

2
0

1
1

So 117 (in denary) = 01110101 (in binary).

Convert a binary number into a denary number:


To turn a binary number into denary, simply put the binary notation below the binary number and add up
all the binary notation numbers of each column with a 1 in it.
As an example, we change the binary number 10110110 into a denary number.

1
128

0
64

1
32

1
16

0
8

1
4

1
2

0
1

128 + 32 + 16 + 4 + 2 = 182
So 10110110 = 128 (in denary).

Convert a binary number into a hexadecimal number


Divide into groups for 4 bits
Write down binary notation under each group
Ignore the numbers below 0s and add up the numbers below 1s
If sum any 4-bit group is 10 then write A as A represents 10 in hexadecimal. Apply the same in case of 11
(B), 12 (C), 13 (D), 14 (E) and 15 (E)
For Example:
Convert the binary number 10110101 to a hexadecimal number

1 0 1 1
8 4 2 1
11
B

0 1 0 1
8 4 2 1
5
5

101101012 = B516

Convert a hexadecimal number into a binary number


Write down binary notation under each hexadecimal digit
Find out the binary notations numbers total of which equals the hexadecimal digit and place 1s below the
se numbers
Place 0s below remaining binary notation number.
For example: Convert the hex number 374F into binary

3
3
8 4 2 1
0 0 1 1

7
7
8 4 2 1
0 1 1 1

4
4
8 4 2 1
0 1 0 0

3=2+1 so 1s are
below 2 and 1 a
re written below
7=4+2+1 so 1s are written below 4, 2 and 1 and 0s are written below 8.

Computer Science by Inqilab Patel

Page 6

F
15
8 4 2 1
1 1 1 1

written
nd 0s a
8 & 4.

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

4=4 so 1 is written below 4 and 0s are written under 1, 2 & 8.


F=15=8+4+2+1 so 1s are written under all of them.
374F16 = 00110111010011112

ASCII (American Standard Code for Information Interchange)

Q1) When texts are transferred large amounts of data are transmitted.
The characters are sent as ASCII characters. Explain what is meant by an ASCII character.
Q2) State three functions of the arithmetic logic unit. [3]

[2]

Q3) Specimen 2015 P1 (Q13)


When a key is pressed on the keyboard, the computer stores the ASCII representation of the character typed into
main memory. The ASCII representation for A is 65 (denary), for B is 66 (denary), etc.
There are two letters stored in the following memory locations:

(a) (i) Show the contents of Location 1 and Location 2 as binary.


Location 1, Location 2
(ii) Show the contents of Location 1 and Location 2 as hexadecimal.
Location 1, Location 2 [2]
(b) The following machine code instruction is stored in a location of main memory:

[2]

Convert this binary pattern into hexadecimal.


[4]
(c) Explain why a programmer would prefer to see the contents of the locations displayed as hexadecimal rather th

Computer Science by Inqilab Patel

Page 7

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

an binary, when debugging his program that reads the key presses.

[2]

Q4) Here are the contents of three memory locations with addresses shown in denary.

Address Memory contents


150

0100 0111

151

1100 1101

152

1001 1100

(a) (i) What is the binary value for address 150?


[1]
(ii) What is the hexadecimal value for the contents of address 152?
[1]
(b) The numbers in location 151 and 152 are the height and width (in pixels) of a bitmap graphic currentl
y in main memory. What are the dimensions of the bitmap in denary?
Height: __________________ pixels
Width: __________________ pixels
[2]
(c) A bitmap graphic can be saved in a number of different image resolutions.
(i) How many bits are required to store each pixel for a black and white bitmap?
[1]
(ii) For a 256-colour bitmap, each pixel requires a byte of memory.
Explain this statement.
[2]
(iii) In addition to the pixel data values and its dimensions, what other information is stored in the bitma
p file?
[2]
Q 5) (9691_w13_p13)
(a) (i) A positive integer is represented in binary as 10101101 .
What is the denary value?
(ii) How would the denary value 73 be represented as a positive binary integer?

[1]
[1]

Marking Scheme:
Q1) (A member of the) character set that a computer recognises
character on a standard keyboard
standard to many machines
stored in binary as . . .
7, 8 or 9 bits per character [2]
Q2) The arithmetic logic unit carries out arithmetic.
The arithmetic logic unit enables the processor to make logical decisions.
The arithmetic logic unit carries out communication with peripheral devices.

Q4) (a) (i) 1001 0110 [1]


(ii) 9C [1]
(b) height: 205 pixels [1]
width: 156 pixels [1]
(c) (i) 1 bit [1]
(ii) Each colour is represented by a number. [1]
1 byte makes possible 256 different numbers/colours. [1]
(iii) the header [1]

Computer Science by Inqilab Patel

Page 8

ruknuddin.com

O/A LevelComputer
Inqilab Patel

1.1 Data Representation

the resolution [1]


Q5) 2 (a) (i) 173 [1]
(ii) (0) 1 0 0 1 0 0 1 [1]
(b) - symbols recognised/used by a computer
- often equates to symbols on a keyboard [2]
(c) - represented by a set of bits
- each set of bits is unique for each character
- ASCII/UNICODE is a common set used
- example of set of bits [2]

Computer Science by Inqilab Patel

Page 9

ruknuddin.com

O/A LevelComputer
1.1 Data Representation

Inqilab Patel

Bit Pattern:
Specimen 2015 P1 (Q4)
A digital alarm clock is controlled by a microprocessor. It uses the 24-hour clock system (i.e. 6 pm is 18:00). Each di
git in a typical display is represented by a 4-digit binary code.

(c) The clock alarm has been set at 08:00.


Describe the actions of the microprocessor which enable the alarm to sound at 08:00.

[2]

Summer 2013 P13 (Question 14)


14 Some decorative lights are made up from a cluster of red, blue, green, yellow and white LEDs.

Each colour is represented by a binary code:


A 6-bit register, R1, stores the 1-values to represent a sequence of colours.
Thus, if R1 contains:
this means the blue, yellow and black colour sequence is stored and displayed in that order.
The length of time each light is on is set by a binary value in another register, R2: Thus
means each colour is on for 2 seconds.

Computer Science by Inqilab Patel

Page 10

ruknuddin.com

O/A LevelComputer
1.1 Data Representation

Inqilab Patel

(a) The two registers contain the following values. What is the sequence of coloured lights and the timing for each
colour?

Summer 2007 P1 (Question 9)


A 7-segment display is used to indicate which floor a lift is on. Each segment is numbered as shown:

A byte is used to hold the data needed to light the correct segments. Bit 0 is always zero.
For example, 3 is represented by

(a) If the lift is to stop at more than one floor, the data is held in successive bytes. For example:

Which floor numbers are stored in each byte?


First byte floor number
Second byte floor number [2]
(b) What bit pattern is used to indicate Floor 2?
(c) The lift is travelling down to stop at Floors 5, 3 and 1. When it stops at Floor 5, a passenger gets in and presses t
he button for Floor 2.
How does the system ensure that the lift stops at Floors 3, 2 and 1 in that order? [3]

Summer 2005 (Question 8)


A microprocessor controls the washing cycle of an automatic washing machine and gives output to the following d
evices:
water valve
heater
wash motor
pump
Control bits are sent to turn parts of the system on or off, i.e. 1 is on and 0 is off.

(a) State what is happening when the above bit pattern is set.
.....................................................................................................................................[1]
(b) Write down the bit pattern that would be set if the water has reached the correct level, the temperature is the
required temperature, the clothes have been washed and the pump is now pumping the water out of the machine.

(c) State one other process that the microprocessor could control.
.....................................................................................................................................[1]

Computer Science by Inqilab Patel

Page 11

ruknuddin.com

O/A LevelComputer
1.1 Data Representation

Inqilab Patel

Winter 2003 (Question 12)


Two 7 segment displays are used on a car dashboard to give information to the driver. Each segment is numbered
as shown.

For example, the information 1P shown above is represented by:

Bit 0 is always zero


(a) What is being displayed to the driver if bytes (1) and (2) are showing?

(b) What bit patterns must be used to show the information 0L?

(c) Most of the other information on the dashboard is in analogue form.


(i) State one advantage of displaying information in analogue form.
..................................................................................................................................
...............................................................................................................................1]
(ii) State one disadvantage of displaying information in analogue form.
..................................................................................................................................
...............................................................................................................................1]

Computer Science by Inqilab Patel

Page 12

ruknuddin.com

You might also like