0% found this document useful (0 votes)
12 views8 pages

Number System: Binary, Octal, Decimal, and Hexadecimal

part 6

Uploaded by

Dhruv Maheshwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

Number System: Binary, Octal, Decimal, and Hexadecimal

part 6

Uploaded by

Dhruv Maheshwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Number System: Binary, Octal, Decimal, and

Hexadecimal

There are many ways to count. The one we choose (because we


have 10 fingers and because our parents chose it) is decimal,
which means: "base ten". A numbering system allows for large
numbers to be "built up" from sequences of smaller numbers,
such as 157, which means 1 times 10 to the second power, plus
5 times 10 to the first power, plus 7 times 10 to the zeroth power.
Given any base (decimal = 10, binary = 2, octal = 8,
hexadecimal = 16)
we can compute a number such as 1241836 as: (1 * X^6) +
(2 * X^5) + (4 * X^4) + (1 * X^3) + (8 * X^2) + (3 * X^1) +
(6 * X^0).

X-> Base of the number system.

Name Base Allowed Digits


Binary Base 2 0,1
Octal Base 8 0,1,2,3,4,5,6,7
Decimal Base 10 0,1,2,3,4,5,6,7,8,9
Hex Base 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F (A=10,
B=11, C=12, D=13, E=14, F=15)

Decimal Number System


Decimal number system is a base 10 number system having 10
digits from 0 to 9. This means that any numerical quantity can be
represented using these 10 digits.
Decimal number system is also a positional value system. This
means that the value of digits will depend on its position. Let us
take an example to understand this.
Say we have three numbers – 734, 971 and 207. The value of 7 in
all three numbers is different−

- In 734, value of 7 is 7 hundreds or 700 or 7 × 100 or 7 × 102


- In 971, value of 7 is 7 tens or 70 or 7 × 10 or 7 × 101
- In 207, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 100

The weightage of each position can be represented as follows −


10^5 10^4 10^3 10^2 10^1 10^0

In digital systems, instructions are given through electric signals;


variation is done by varying the voltage of the signal. Having 10
different voltages to implement decimal number system in digital
equipment is difficult. So, many number systems that are easier to
implement digitally have been developed.

Binary Number System:


The easiest way to vary instructions through electric signals is
two-state system – on and off. On is represented as 1 and off as 0,
though 0 is not actually no signal but signal at a lower voltage. The
number system having just these two digits – 0 and 1 – is called
binary number system.

Each binary digit is also called a bit. Binary number system is also
positional value system, where each digit has a value expressed in
powers of 2:

2^5 2^4 2^3 2^2 2^1 2^0


In any binary number, the rightmost digit is called least significant bit
(LSB) and leftmost digit is called most significant bit (MSB).

Let, 11010 be a binary number:

1 1 0 1 0
pos-> 4th 3rd 2nd 1st 0th

Bit 1 at pos 4th is MSB and bit 0 at pos 0th is LSB.

And decimal equivalent of this number is sum of product of each digit


with its positional value.

110102 = 1×2^4 + 1×2^3 + 0×2^2 + 1×2^1 + 0×2^0

= 16 + 8 + 0 + 2 + 0

= 26 base 10.

Computer memory is measured in terms of how many bits it can


store.

1 byte (B) = 8 bits


1 Kilobytes (KB) = 1024 bytes
1 Megabyte (MB) = 1024 KB
1 Gigabyte (GB) = 1024 MB
1 Terabyte (TB) = 1024 GB
1 Exabyte (EB) = 1024 PB
1 Zettabyte = 1024 EB
1 Yottabyte (YB) = 1024 ZB
OCTAL NUMBER SYSTEM:
Octal number system has eight digits – 0, 1, 2, 3, 4, 5, 6 and 7.
Octal number system is also a positional value system with where
each digit has its value expressed in powers of 8.

8^5 8^4 8^3 8^2 8^1 8^0

Decimal equivalent of any octal number is sum of product of each


digit with its positional value.

7268 Base 8
= 7×82 + 2×81 + 6×80
= 448 + 16 + 6
= 470 base 10

USES OF OCTAL NUMBER SYSTEM:

- Computing system uses 16-bit, 32-bit or 64-bit word which is


further divided into 8-bit words.
- In the aviation sector, the octal numbers are used in the form of
code.

Hexadecimal Number System:


16 symbols – 0 to 9 and A to F where A is equal to 10, B is equal to
11 and so on till F. Hexadecimal number system is also a positional
value system with where each digit has its value expressed in
powers of 16.

16^5 16^4 16^3 16^2 16^1 16^0

Use: Storing the memory addresses. Because large values can


be represented easily.
Decimal equivalent of any hexadecimal number is sum of product of
each digit with its positional value.

27FB16 = 2×163 + 7×162 + 15×161 + 10×160


= 8192 + 1792 + 240 +10
= 1023410

Relationship Between Number Systems:


HEXADECIMAL DECIMAL OCTAL BINARY
0 0 0 0000
1 1 1 0001
2 2 2 0010
3 3 3 0011
4 4 4 0100
5 5 5 0101
6 6 6 0110
7 7 7 0111
8 8 10 1000
9 9 11 1001
A 10 12 1010
B 11 13 1011
C 12 14 1100
D 13 15 1101
E 14 16 1110
F 15 17 1111
Hexadecimal Decimal Hexadecimal Decimal
0 0 11 = (1 x 16) + 1 17
1 1 12 = (1 x 16) + 2 18
2 2 13 = (1 x 16) + 3 19
3 3 14 = (1 x 16) + 4 20
4 4 15 = (1 x 16) + 5 21
5 5 16 = (1 x 16) + 6 22
6 6 17 = (1 x 16) + 7 23
7 7 18 = (1 x 16) + 8 24
8 8 19 = (1 x 16) + 9 25
9 9 1A = (1 x 16) + 10 26
A 10 1B = (1 x 16) + 11 27
B 11 1C = (1 x 16) + 12 28
C 12 1D = (1 x 16) + 13 29
D 13 1E = (1 x 16) + 14 30
E 14 1F = (1 x 16) + 15 31
F 15 20 = (2 x 16) + 0 32
10=(1 x 16)+0 16

Place value:
If decimal numbers have place values like ones, tens, hundreds,
thousands, and so on, hexadecimal numbers have place values as
well. Decimals have powers of 10 while Hexadecimals have powers
of 16.

Exponent 16^3 16^2 16^1 16^0


Value 4,096 256 16 1

Hexadecimal Decimal
10 16
100 256
1000 4,096
Uses of Hexadecimal:
The hexadecimal numbering system is often used by programmers
to simplify the binary numbering system. Since 16 is equivalent to
24, there is a linear relationship between the numbers 2 and 16.
This means that one hexadecimal digit is equivalent to four binary
digits. Computers use binary numbering systems while humans use
hexadecimal numbering systems to shorten binary and make it
easier to understand.
Hexadecimal are used in the following:

- To define locations in memory. Hexadecimals can characterise


every byte as two hexadecimal digits only compared to eight digits
when using binary.
- To define colours on web pages. Each primary colour – red, green
and blue is characterised by two hexadecimal digits. The format
being used is #RRGGBB. RR stands for red, GG stands for green
and BB stands for blue.
- To represent Media Access Control (MAC) addresses. MAC
addresses consist of 12-digit hexadecimal numbers. The format
being used is either MM:MM:MM:SS:SS:SS or MMMM-MMSS-SSSS.
The first 6 digits of the MAC address represent the ID of the
adapter manufacturer while the last 6 digits represent the serial
number of the adapter.
- To display error messages. Hexadecimals are used to define the
memory location of the error. This is useful for programmers in
finding and fixing errors.
Advantages of Hexadecimal:
- It is very concise and by using a base of 16 means that the
number of digits used to signify a given number is usually less than
in binary or decimal. It allows you to store more information using
less space.
- It is fast and simple to convert between hexadecimal numbers and
binary. Hexadecimal can be used to write large binary numbers in
just a few digits.
- It makes life easier as it allows grouping of binary numbers which
makes it easier to read, write and understand. It is more
human-friendly, as humans are used to grouping together
numbers and things for easier understanding. Also, writing in less
digits lowers the possibility of error occurring.

You might also like