Number Systems Lesson Six

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

NUMBER SYSTEMS

The language we use to communicate with each other is comprised of words and characters.
We understand numbers, characters and words. But this type of data is not suitable for
computers. Computers only understand the numbers.

So, when we enter data, the data is converted into electronic pulse. Each pulse is identified
as code and the code is converted into numeric format by ASCII. It gives each number,
character and symbol a numeric value (number) that a computer understands. So to
understand the language of computers, one must be familiar with the number systems.

The Number Systems used in computers are:

o Binary number system


o Octal number system
o Decimal number system
o Hexadecimal number system

Binary number system

It has only two digits '0' and '1' so its base is 2. Accordingly, In this number system, there
are only two types of electronic pulses; absence of electronic pulse which represents '0'and
presence of electronic pulse which represents '1'. Each digit is called a bit. A group of four
bits (1101) is called a nibble and group of eight bits (11001010) is called a byte. The position
of each digit in a binary number represents a specific power of the base (2) of the number
system.

Octal number system

It has eight digits (0, 1, 2, 3, 4, 5, 6, 7) so its base is 8. Each digit in an octal number represents
a specific power of its base (8). As there are only eight digits, three bits (23=8) of binary
number system can convert any octal number into binary number. This number system is
also used to shorten long binary numbers. The three binary digits can be represented with
a single octal digit.

Decimal number system

This number system has ten digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) so its base is 10. In this number
system, the maximum value of a digit is 9 and the minimum value of a digit is 0. The
position of each digit in decimal number represents a specific power of the base (10) of the
number system. This number system is widely used in our day to day life. It can represent
any numeric value.

Hexadecimal number system

This number system has 16 digits that ranges from 0 to 9 and A to F. So, its base is 16. The
A to F alphabets represent 10 to 15 decimal numbers. The position of each digit in a
hexadecimal number represents a specific power of base (16) of the number system. As
there are only sixteen digits, four bits (24=16) of binary number system can convert any
hexadecimal number into binary number. It is also known as alphanumeric number system
as it uses both numeric digits and alphabets.

Number system Base(Radix) Used digits Example


Binary 2 0,1 (11110000)2
Octal 8 0,1,2,3,4,5,6,7 (360)8
Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10
0,1,2,3,4,5,6,7,8,9,
Hexadecimal 16 (F0)16
A,B,C,D,E,F

CONVERSIONS
DECIMAL TO OTHER

1. DECIMAL TO BINARY

Decimal Number System to Other Base

To convert Number system from Decimal Number System to Any Other Base is quite easy;
you have to follow just two steps:
A) Divide the Number (Decimal Number) by the base of target base system (in which you want
to convert the number: Binary (2), octal (8) and Hexadecimal (16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a Most
Significant Bit (MSB).

Decimal to Binary Conversion Result


Decimal Number is : (12345)10

Binary Number is
(11000000111001)2

2. DECIMAL TO OCTAL

Decimal to Octal Conversion Result


Decimal Number is : (12345)10

Octal Number is
(30071)8
3. DECIMAL TO HEXADECIMAL
Decimal to Hexadecimal Conversion Result
Example 1
Decimal Number is : (12345)10

Hexadecimal Number is
(3039)16

Example 2
Decimal Number is : (725)10 Hexadecimal Number is
(2D5)16
Convert
10, 11, 12, 13, 14, 15
to its equivalent...
A, B, C, D, E, F

BINARY TO OTHER
A) Multiply the digit with 2(with place value exponent). Eventually add all the multiplication
becomes the Decimal number.
1. BINARY TO DECIMAL

2. BINARY TO OCTAL

An easy way to convert from binary to octal is to group binary digits into sets of three, starting
with the least significant (rightmost) digits.

Binary: 11100101 = 11 100 101


011 100 101 Pad the most significant digits with zeros if
necessary to complete a group of three.

Then, look up each group in a table:


Binary: 000 001 010 011 100 101 110 111
Octal: 0 1 2 3 4 5 6 7

Binary = 011 100 101


Octal = 3 4 5 = 345 oct

3. BINARY TO HEXADECIMAL

An equally easy way to convert from binary to hexadecimal is to group binary digits into sets of
four, starting with the least significant (rightmost) digits.

Binary: 11100101 = 1110 0101

Then, look up each group in a table:


Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 1000 1001 1010 1011 1100 1101 1110 1111
Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101


Hexadecimal = E 5 = E5 hex

OCTAL TO OTHER

1. OCTAL TO BINARY

Converting from octal to binary is as easy as converting from binary to octal. Simply look up
each octal digit to obtain the equivalent group of three binary digits.

Octal: 0 1 2 3 4 5 6 7
Binary: 000 001 010 011 100 101 110 111

Octal = 3 4 5
Binary = 011 100 101 = 011100101 binary

2. OCTAL TO HEXADECIMAL

When converting from octal to hexadecimal, it is often easier to first convert the octal number
into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex:

(from the previous example)


Octal = 3 4 5

Binary = 011 100 101 = 011100101 binary


Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal digits.

Binary: 0000 0001 0010 0011 0100 0101 0110 0111

Hexadecimal: 0 1 2 3 4 5 6 7

Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101

Hexadecimal = E 5 = E5 hex

Therefore, through a two-step conversion process, octal 345 equals binary 011100101 equals
hexadecimal E5.

3. OCTAL TO DECIMAL

The conversion can also be performed in the conventional mathematical way, by showing each
digit place as an increasing power of 8.

345 octal = (3 * 82) + (4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229 decimal

OR

Converting octal to decimal can be done with repeated division.

1. Start the decimal result at 0.


2. Remove the most significant octal digit (leftmost) and add it to the result.
3. If all octal digits have been removed, you’re done. Stop.
4. Otherwise, multiply the result by 8.
5. Go to step 2.

Octal Digits Operation Decimal Result Operation Decimal Result


345 +3 3 ×8 24
45 +4 28 ×8 224
5 +5 229 done.
 (345)8 =(229)10

HEXADECIMAL TO OTHER
1. HEXADECIMAL TO BINARY

Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal.


Simply look up each hexadecimal digit to obtain the equivalent group of four binary digits.

Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 8 9 A B C D E F
Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal = A 2 D E
Binary = 1010 0010 1101 1110 = 1010001011011110 binary

2. HEXADECIMAL TO OCTAL

1's complement

The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is
called as taking complement or 1's complement. Example of 1's Complement is as follows.

Binary Addition

It is a key for binary subtraction, multiplication, division. There are four rules of binary addition.
In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the given
column and a carry of 1 over to the next column.

Example − Addition

2's complement

The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB)
of 1's complement of the number.

2's complement = 1's complement + 1

Example of 2's Complement is as follows.


Rules of Binary Addition
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0, and carry 1 to the next more significant bit

For example,

00011010 + 00001100 = 00100110 1 1 Carries


0 0 0 1 1 0 1 0 = 26(base 10)
+ 0 0 0 0 1 1 0 0 = 12(base 10)
0 0 1 0 0 1 1 0 = 38(base 10)

00010011 + 00111110 = 01010001 1 1 1 1 1 carries


0 0 0 1 0 0 1 1 = 19(base 10)
+ 0 0 1 1 1 1 1 0 = 62(base 10)
0 1 0 1 0 0 0 1 = 81(base 10)

Rules of Binary Multiplication

0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1, and no carry or borrow bits

For example,

00101001 × 00000110 = 11110110 0 0 1 0 1 0 0 1 = 41(base 10)


× 0 0 0 0 0 1 1 0 = 6(base 10)
0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 1
0 0 1 0 1 0 0 1

0 0 1 1 1 1 0 1 1 0 = 246(base 10)

Binary Division

Binary division is the repeated process of subtraction, just as in decimal division.

For example,
00101010 ÷ 00000110 = 7(base 10)
1 1 1 =
Example − Division

You might also like