You are on page 1of 3

Paper 1 Theory Unit 1 Binary and Hexadecimal Number Systems

The Binary Number System:- We are more familiar with the DENARY NUMBER system
No Matter how complex a Computer System which counts in the multiples of 10’s which leads us to the more
May be the basic building block in all computer known headings 10s, 100s, 1000s and so on.
systems is always the BINARY NUMBER
103=1000 102=100 101=10 100=1
SYSTEM. Since the computer is essentially
made up of million and millions of tiny Similarly the BINARY NUMBER system is based on the number 2 therefore
‘switches’ that are either ON (1) or OFF (0). there are only two values 0 and 1 that can be used to represent each digit.
Using the same method as denary the headings can be as follows:-
Converting from Binary to Denary 27=128 26=64 25=32 24=16 23=8 22=4 21=2 20=1
Converting a binary byte (8 bits)
01101101 to Denary by adding the 7 6 5 4 3
corresponding values on the first row all 2 =128 2 =64 2 =32 2 =16 2 =8 22=4 21=2 20=1
the bits that are valued ‘1’ and the ‘0’ are 0 1 1 0 1 1 0 1
simply ignored.
Therefore 64+32+8+4+1 = 109
Trial and Error Method:- Repetitive Division:-
Converting from Denary to Binary converting denary
Consider the conversion of the denary
This process is slightly more complex, and 246 to binary
number, 107, into binary. This method
there are two methods for doing this. (1) 246 / 2 à 123 remainder 0
involves placing ls in the appropriate
Trial and Error method (2) Repetitive 123 / 2 à 61 remainder 1
position so that the total equates to 107.
Division Method. 61 / 2 à 30 remainder 1
30 / 2 à 15 remainder 0
15 / 2 à 7 remainder 1
7 / 2 à 3 remainder 1
Measurement of the Size of Computers Memories:- 3 / 2 à 1 remainder 1
A BINARY DIGIT is referred to as BIT. 8 Bits make a BYTE. The Byte is the smallest 1 / 2 à 0 remainder 1
unit for Data Storage. Even if the computer allows for larger bytes (16 bit or 32 bit) they Reading the Remainders from BOTTOM to
are always a multiple of 8. A byte is really small and won’t allow storage of much data TOP results in 11110110.
that is why we need multiples of BYTES.
To give some idea of how these numbers work
consider the following example:-
- With a data transfer rate of 32megabits per second
(or 4MB/sec) a 40MB file will take 10seconds to
download.
- And a 2TB storage device can store over half a
million 4MB photos.

However it should be noted that the IEC (International Electrotechnical


Commission) convention for measurement of storage devices has been adopted
some organisations.
Denary System IEC Standard (a.k.a Binary System) It should be noted however, the IEC
terms are not universally used and we
1 kilobyte = 1000 bytes 1 kibibyte (KiB) = 1024 bytes
will stick to DENARY SYSTEM in this
1 megabyte = 1,000,000 bytes 1 mebibyte(MiB) = 1048576 bytes course (AS RECOMMENDED BY CIE)

1 gigabyte = 1,000,000,000 bytes 1 gibibyte (1GiB) = 1 073 741824 bytes


1 terabyte = 1,000,000,000,000 bytes 1 tebibyte (1TiB ) = 1099511627776 bytes
In which case if the Register
Uses of Binary Number System:- Contents are 10101010 it would
A register (to be discussed in detail later) usually An 8-bit register to control its represent the following state:-
holds ONE BYTE and used by Microcomputers movement can be set up as follows:-
to control devices such as robots. For example - Motor B is ON
consider the following robot which has moving - Motor C is ON
wheels A,B and C. - Both Motors B and C are
turning to produce
FORWARDS MOTION.

So therefore the Robot is Moving


Forward.

Hassan Zulfiqar Haider For more study material please visit:-


A-Levels/IGCSE/O-Levels Computer Science https://sites.google.com/site/csvault042/home
03234140902
hassanzulfiqarhaider@gmail.com
Paper 1 Theory Unit 1 Binary and Hexadecimal Number Systems
Hexadecimal (or Hex) Number System :-
Binary Hex Denary
This number system is very closely related to the Binary Number System. It
Value Value Value
is a base 16 number system which as 16 different values (0-9 followed by
A-F) to represent each digit. The letters are valued as 0000 0 0
- A=10,B=11,C=12,D=13,E=14, F=15
4 0001 1 1
- Since 2 =16 therefore we need 4 BITS to represent ONE HEX DIGIT.
- Similar to denary and binary we have the following Hex headings. 0010 2 2
4 3 2 1 0
16 16 16 16 16 0011 3 3
65,535 4,096 256 16 1
0100 4 4
Conversion Hex to Denary:-
Conversion Binary to Hex and Hex to Binary:- 0101 5 5
Consider the Number AF4 written in Hexadecimal.
Binary to Hex is a fairly simple process simply
162 161 160
convert the binary number into groups of 4 bits 0110 6 6
A F 4
(nibbles) and replace then the nibbles with their
0111 7 7
equivalent hex digit. (see the table). A*162+F*161 +4*160 (Since A is equal to 10 and F is
1011 1110 0001 15) 1000 8 8
1011àB 1110àE 0001à1 10*162+15*161 +4*160
= 2560 + 240+4 1001 9 9
BE1
16
= 2804 1010 A 10
Also consider the following Hex Number:-
45A
16 1011 B 11
4à0100 5à0101 Aà1010
1100 C 12
0100 0101 1010
1101 D 13
Conversion Denary to Hex:-
Converting from Denary to Hex number is a relatively simple process:- 1110 E 14
1. convert denary to binary
2. follow binary to hex conversion process. 1111 F 15
However for larger Denary Number the following steps may be
required:-
consider the number 2004
2004 / 16 = 125 remainder 4
125 / 16 = 7 remainder 13 à D
7 / 16 = 0 remainder 7
reading the remainders BOTTOM to TOP will results in 7 D 4
Where are Hex Numbers Used?
It is much easier to work with
B5A41AFC than 10111001101001000001101011111100
Memory Dumps:-
Whenever the contents of a memory are output a Monitor or MAC Address:-
Printer it is known as a Memory Dump. These Outputs are used MAC address (or physical address) is a unique number that can be
by software developers when developing new programs to trace used to identify a device on the Internet or LAN. It refers to the
errors. The hex codes on the far left represent the memory Network Interface Car (NIC) and is made up of 48bits (can be 64
address. Which makes it easier to identify the EXACT bits as well) or 6 groups of hex digits (NN:NN:NN:DD:DD:DD) the
MEMORY LOCATION where the error may have occurred. It first 6 digits (NN) refer to the manufacturer of the device (For
is clear that computer data is much more manageable using Hex example Apple Computers : 00 1C B3). The remaining six digits
Digits rather than binary which leads it to being a very effective (DD) refers to individual device (4525FE). MAC address can be of
FAULT TRACING tool rather than binary. the following types:-
HTML:- Universally Administered MAC Address (UAA):
Hyper Text Markup Language is a (markup/design) language It’s the most common and is set by the factory.
that is specifically used for processing, definition and Locally Administered MAC Address (LAA):-
presentation of text on Web Pages (HTML is not a There may be some reasons to change MAC addresses even though
Programming Language). HTML can be used to represent he they may cause big problems of they are not unique.
different colours of Text by varying the intensities of the • For example some FIREWALLS or MAINFRAMES may
three primary colours (RED, GREEN, BLUE). For example:- require MAC address to fall into a strict criteria for each
• FF00000 à Red connecting device that is why they must be changed.
• 00FF00à GREEN • Changing MAC address may also be required to get past
• 0000FFàBLUE certain network restrictions.
• FF8000àORANGE
Hassan Zulfiqar Haider For more study material please visit:-
A-Levels/IGCSE/O-Levels Computer Science https://sites.google.com/site/csvault042/home
03234140902
hassanzulfiqarhaider@gmail.com
Paper 1 Theory Unit 1 Binary and Hexadecimal Number Systems
Web Address:-
It should be known that each character used on
a Keyboard is known as an ASCII (American
Standard Code for Information Interchange).
ASCII characters may be used to represent Web
Addresses (OR UNIFORM RESOURCE
LOCATOR/URL) using either DENARY or
HEX.
Therefore www.google.com will become
%77 %77 %77 %2E %67 %6F %6F %67 %6C
%65 %2E %63 %6F %6D
The “%” symbol means that the number is
written in Hexadecimal. If ASCII digits are used
to enter URLs you reduce the chances of copy
and pasting FAKE websites. And the process
can be even more sped up by using HEX.

Assembly Code and Machine Code:-


When using a Low Level Language (Assembly Language) or Machine Language program developers can directly refer
memory locations which comes in handy when troubleshooting. However, if Hexadecimal is used the size of code can
be drastically reduced (especially in machine code where Mnemonics are not available). For example consider the
following code:-
STO FFA4 (Assembly Code)
A5E4 FFA4 (Equivalent Machine code but written using Hex)
1010 0101 1110 0100 1111 1111 1010 0100 (Equivalent Machine Code using Binary)

Hassan Zulfiqar Haider For more study material please visit:-


A-Levels/IGCSE/O-Levels Computer Science https://sites.google.com/site/csvault042/home
03234140902
hassanzulfiqarhaider@gmail.com

You might also like