Number System
Number System
Number System
DATA
REPRESENTATION
Anish
Pokharel
Content
01 Number System
03 Octal
Hexadecimal 04
Decimal
Example of Decimal Number System:
The decimal number system has a base of 10
because it uses ten digits from 0 to 9. The decimal number 1457 consists of the digit 7 in
In the decimal number system, the positions the units position, 5 in the tens place, 4 in the
successive to the left of the decimal point hundreds position, and 1 in the thousands place
represent units, tens, hundreds, thousands and whose value can be written as:
so on.
This system is expressed in decimal numbers. (1×103) + (4×102) + (5×101) + (7×100)
Every position shows a particular power of the (1×1000) + (4×100) + (5×10) + (7×1)
base (10). 1000 + 400 + 50 + 7
1457
Binary
The base 2 number system is also known as the Binary number system wherein, only two binary
digits exist, i.e., 0 and 1.
Specifically, the usual base-2 is a radix of 2.
The figures described under this system are known as binary numbers which are the
combination of 0 and 1.
these 2-digit number system is used to represent a set of data or information in discrete bits of
information.
For example, 110101 is a binary number.
Octal
Octal Digital Value Binary Equivalent
7 111
Hexadecimal
In the hexadecimal system, numbers are written or represented with base 16.
In the hexadecimal system, the numbers are first represented just like in the decimal system, i.e.
from 0 to 9. Then, the numbers are represented using the alphabet from A to F.
The below-given table shows the representation of numbers in the hexadecimal number system.
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Example: Convert (11011) to decimal Example: Convert 121 base 8 into the Example: Convert 12 base 16 into a
number. equivalent decimal number. decimal number.
We need to multiply each binary digit with Here, we have to multiply each octal digit Multiply each digit with decreasing
the decreasing power of 2. with the decreasing power of 8, such as; power of 16 to obtain an equivalent
decimal number.
That is; 1×8^2+2×8^1+1×8^0
=1×2^4+1×2^3+0x2^2+1×2^1+1×2^0 1×16^1+2×16^0
=16+8+0+2+1 =64+16+1
=27 =16+2
=81
Therefore, (11011) = (27) =18
Binary to Octal
Octal to Binary
Step Binary Number Octal Number Step Octal Number Binary Number
Hexadecimal Hexadecimal
Step Binary Number Step Binary Number
Number Number
Convert these binary numbers into denary Convert these denary numbers into binary
a) 0 0 1 1 0 011 a) 4 1
b) 0 1 1 1 1 111 b) 6 7
c) 1 0 0 1 1 001 c) 8 6
d) 0 1 1 1 0 100 d) 1 0 0
e) 1 1 1 1 1 111 e) 1 1 1
f) 0 0 0 0 1 111 f) 1 2 7
g) 1 0 0 0 1 111 g) 1 4 4
h) 0 0 1 1 0 011 h) 1 8 9
i) 0 1 1 1 0 000 i) 2 0 0
j) 1 1 1 0 1 110 j) 2 5 5
Examples
Convert these binary numbers into denary Convert these denary numbers into binary
a) 0 0 1 1 0 011 a) 4 1
b) 0 1 1 1 1 111 b) 6 7
c) 1 0 0 1 1 001 c) 8 6
d) 0 1 1 1 0 100 d) 1 0 0
e) 1 1 1 1 1 111 e) 1 1 1
f) 0 0 0 0 1 111 f) 1 2 7
g) 1 0 0 0 1 111 g) 1 4 4
h) 0 0 1 1 0 011 h) 1 8 9
i) 0 1 1 1 0 000 i) 2 0 0
j) 1 1 1 0 1 110 j) 2 5 5
Addition and
Subtraction
0 0 0 0 0 0 0 0
0 1 1 0 0 1 1 1
1 0 1 0 1 0 1 0
1 1 0 1 1 1 0 0
One's and Two's
Complement
Examples
37 + 58
82 + 69
95 - 68
49 - 80
Examples
Carry out these binary additions and subtractions
using these 8-bit column weightings:
−128 64 32 16 8 4 2 1
a) 0011 1 0 0 1 + 0 0 1 0 1 0 0 1
b) 0100 1 0 1 1 + 0 0 1 0 0 0 1 1
c) 0101 1 0 0 0 + 0 0 1 0 1 0 0 0
d) 0111 0 0 1 1 + 0 0 1 1 1 1 1 0
e) 0000 1 1 1 1 + 0 0 0 1 1 1 0 0
f) 0110 0 0 1 1 − 0 0 1 1 0 0 0 0
g) 0111 1 1 1 1 − 0 1 0 1 1 0 1 0
h) 0011 0 1 0 0 − 0 1 0 0 0 1 0 0
i) 0000 0 0 1 1 − 0 1 1 0 0 1 0 0
j) 1101 1 1 1 1 − 1 1 0 0 0 0 1 1
Binary-coded decimal
(BCD) system
The binary-coded decimal (BCD) system uses
a 4-bit code to represent each denary digit:
Uses of BCD
0000= 0 The most obvious use of BCD is in the
representation of digits on a calculator or clock
0001= 1 display.
0010= 2 When it comes to accounting and representing
0011= 3 monetary values in computers, exact values
0100= 4 need to be stored to prevent significant errors
from accumulating.
0101= 5 Monetary values use a fixed-point notation, for
0110= 6 example $1.31, so one solution is to represent
0111= 7 each denary digit as a BCD value.
1000= 8
1001= 9
Examples
a) 0.45 + 0.21
b) 0.66 + 0.51
c) 0.88 + 0.75
Measurement of
Size Memories
Name of memory size Equivalent denary value (bytes) Name of memory size Equivalent denary value (bytes)