"O GOD THEE I PRAY INCREASE MY KNOWLEDGE DAY BY DAY"

.

For Success

For Success
Know more than other Work more than other But, Expect less than other

Its a necessary and sufficient condition-----

Its a necessary and sufficient condition-----
"If you win, you need not have to explain.........But if you lose, you should not be there to explain!"

07 October 2010

number system for my first semester students

Commonly used Number systems are:-
(A) Decimal number system
(B) Binary number system
(C) Octal number system
(D) Hexa-decimal number system


Number System Available Digits Base Value
Decimal 0,1,2,3,4,5,6,7,8,9 10
Binary 0,1 2
Octal 0,1,2,3,4,5,6,7 8
Hexa-Decimal 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F 16
In any number system digits are arranged in order of ascending value, moving from the lowest on the right to the highest on the left. That’s why the leftmost digit is referred to as the most significant and the rightmost as the least significant digit. As shown:

Most significant (MSB) Least significant (LSB)

X8 X7 X6 X5 X4 X3 X2 X1 X0

 Decimal Number System: -

It is most common number system, which is used usually. It contains 10 different digits, 0 to 9. In the decimal system, each weight equals 10 raised to the power of its position. The weight of its first position, is 100,which equals 1. So, the value of a digit in the first position is equal to the value of the digit times 1. The weight of the second position is 101 ,which equal to 10. The value of a digit in the second position, therefore, is equal to the value of the digit times 10, and so.

Position Forth Third Second First
Weight 103 (1000) 102(100) 101(10) 10(1)


EXAMPLE:
Show the weighting of the decimal number 1789:

1 7 8 9 Digit
103 102 101 100
 Weight
1000 100 10 1

1000 700 80 9

Value Of 1789 = 9*100+8*101 +7*102+1*103 = 9*1+8*10+7*100+1*1000 = 9+80+700+1000
Practice Exercise : 998, 6300, 786


Position Fifth Fourth Third Second First
Weight 24(16) 23(8) 22(4) 21(2) 20(1)

EXAMPLE:

1 0 0 1 Digit
8 4 2 1 Weight
(23) (22) (21) (20)

1*23 0*22 0*21 1*20

Value = 8+0+0+1= (9) 10
The value of the binary number can be computed using defined farmula.
(10101)2== 1*20+0*21 +1*22+0*23+1*24= 1*1+0*2+1*4+0*8+1*16 =1+0+4+0+16 = (21)10

 Octal Number System: -
Computer programmers to represent binary number in a compact form use it. The octal system uses eight symbols, 0 to 7. In this weight 8 is raised to the power is represented by a position.

Position Fifth Fourth Third Second First
Weight 84(4096) 83(512) 82(64) 81(8) 80(1)

Relation between Binary & Octal Number System
Decimal Number Octal Number Binary Number
0 0 000
1 1 001
2 2 010
3 3 011
4 4 100
5 5 101
6 6 110
7 7 111

To calculate the value of a number, we multiply each digit or symbol by the weight due to its position and then we add the results.

EXAMPLE: 2211with octal base
2 2 1 1 =>Digit
(83) (82) (81) (80)

512 64 8 1 =>Weight due to position

2*512 2*64 1*8 1*1
Value = 1024+128+8+1 = (1161)10

 Hexadecimal Number System: -

Hexa–decimal number system use 16 different symbols to represent data. The permitted digits (symbols) in this system are: -0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Hexa-decimal number system is used extensively in modern digital computers these days. It is convenient and simple to represent large binary numbers into smaller Hexa-decimal format. Hence for convenience in representing large or complex numbers, the hexa-decimal numbers are used.

Relation between Binary & Hexa-Decimal Number System
Decimal Number Hexa-Decimal Number Binary Number
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111

Here weight is 16 raised to power represented by a position as:


Position Fourth Third Second First
Weight 163(4096) 162(256) 161(16) 160(1)


To calculate the value of a number, we multiply each digit of symbol by weight due to its position and then we add the results.
EXAMPLE:
4 4 4 4 =>Digit
(163) (162) (161) (160)

4096 256 16 1 =>Weight

4*4096 4*256 4*16 4*1
Value = 16384+1024+64+4 = (17476)10


CONVERSION FROM ONE NUMBER SYSTEM TO ANOTHER-
In this chapter we are going to discuss these conversions with rules –regulations and their corresponding examples:

A….CONVERTING TO DECIMAL FROM ANOTHER BASE

B…CONVERTING FROM DECIMAL TO A NEW BASE

C…CONVERTING FROM A BASE OTHER THEN 10 TO A BASE OTHER THAN 10
D… CONVERSION FOR FRACTIONAL NUMBERS
• OTHER BASE TO DECIMAL

• DECIMAL TO OTHER BASE



A…CONVERTING TO DECIMAL FROM ANOHER BASE

Rules &Regulation:

TO CONVERT A NO. IN DECIMAL MULTIPLY EACH DIGIT WITH THEIR POSITIONAL VALUE AND ADD THEM.

Example:…………

(10101)2 = (?)10

=1*20+0*21+1*22+0*23+1*24
=1*1+0*2+1*4+0*8+1*16
=1+0+4+0+16
=(21) 10
Another method:
(10101)2 = (?)10
=1*24+0*23+1*22+0*21+1*20
=(16 X 1)+(0 X 8)+(4 X 1)+(2 X 0)+(1 X 1)
=16+0+4+0+1
=(21) 10

(7011)8 =(?)10
=(7 X 512)+(0 X 64)+(1 X 8)+(1 X 1)
=3584+0+8+1
=(3593) 10

(BF1) 16=(?)10
=(B X 256)+(F X 16)+(1 X 1)
=(11 X 256)+(15 X 16)+(1 X 1)
=(3057) 10

For Practice:
1. Change theses binary numbers in decimal- 11, 10101,1101011
2. Change theses Octal numbers in decimal – 123, 2345, 4567, 567
3. Change theses Hesadecimal numbers in decimal- ABCD, 99DE, CA998
Prove these:
1. 101001 in binary = 41 in decimal
2. 7012 in octal = 3594 in decimal
3. 312 in base 4 = 54 in decimal
4. BFA in hexadecimal = 3313 in decimal
5. A1A in base 12 = 1462 in decimal

B…CONVERTING FROM DECIMAL TO A NEW BASE

Rules &Regulation:

1. DIVIDE THE DECIMAL NO. BY NEW BASE
2. RECORD THE REMAINDER
3. DIVIDE THE QUOTIENT OF STEP 1
4. RECORD THE REMAINDER FROM STEP 3
5. REPEAT STEP 3 & 4 UNTIL THE QUOTIENT BECOMES 0
6. ARRANGE THE REMAINDERS IN REVERSE ORDER



Example:

1. Find (36)10 =(?)2

DIVISION QUOTIENT REMAINDER
36/2 18 0
18/2 9 0
9/2 4 1
4/2 2 0
2/2 1 0
1/2 0 1

THE REMAINDER HAS TO BE ARANGED IN REVERSE ORDER*

= (100100)2
Check it- 0*1+0*2+1*4+0*8+0*16+1*32 =0+0+4+0+0+32 =36 in decimal




• 2. Find (1789) 10 =(?)8

DIVISION QUOTIENT REMAINDER
1789/8 223 5
223/8 27 7
27/8 3 3
3/8 0 3

=(3375) 8

Check it:
3375 in octal = 5*1+7*8+3*64+3*512 =5+56+192+1536 =1789 in decimal

• 3. Find (623) 10 = ?16

DIVISION QUOTIENT REMAINDER
623/16 38 15 (F)
38/16 2 6
2/16 0 2
= (26F) 16
4. Find (998)10 =(?)16

DIVISION QUOTIENT REMAINDER
998/16 62 6
62/16 3 14 (E)
3/16 0 3

THE REMAINDER HAS TO BE ARANGED IN REVERSE ORDER*

= (3E6) in hexadecimal

Check it- 6*1+14*16+3*256 = 6+224+768 = 998 in decimal

• Integer with fractional part ( Decimal to Binary)
Rules:
1. We multiply given fractional part by 2 and note the result in separate column.
2. The successive fractional parts of the previous result are multiplied by 2 till the fractional part of the product become 0 or up to the accuracy.
3. The integer part of the product is written in downward direction to find the binary equivalent of the decimal fraction.
Example;
Change a decimal number 0.68 in binary equivalent?
Process Product decimal part integer part
0.68*2 1.36 .36 1
0.36*2 0.72 .72 0
0.72*2 1.44 .44 1
0.44*2 0.88 .88 0
0.88*2 1.76 .76 1

So, 0.68 in decimal = 0.10101 in binary
Practice:
Prove these:
1. 247 in decimal = 187 in base 12
2. 47 in decimal = 142 in base 5
3. 101.07 in decimal = 1100101.00010 in binary
4. 75.68 in decimal = 1001011.10101
Find these:
5. change decimal 786 in base 2, 8, 16, 5, 12, 6 and check yourself




C…CONVERTING FROM A BASE OTHER THEN 10 TO A BASE OTHER THAN 10

There are two methods to solve this type of problem

Indirect Method: for this conversion we follow this rule
TO CHANGE A BASE OTHER THEN 10 TO A BASE OTHER THEN 10 WE HAVE TO CONVERT THE GIVEN NO. INTO DECIMAL AND THEN TO REQUIRED BASE.
Direct Method: for this conversion we follow this rule
In this method we follow the relationship table(binary-octal-hexadeciaml-decimal) and convert the given digit into required base digit.
1. Binary to Octal:
Prepare the binary digit in three three’s pairs. If leftmost group pair has fewer bits then attach required number of leading 0 to become pairs of three. After preparing pairs calculate one octal digit for each group or check the value of binary in octal from the relationship table.
Example: Find 10110011in binary to octal?
10110011 = 010 110 011
010 in binary = 0*1+1*2+0*4 = 2 in Octal
110 in binary = 0*1 + 1*2 + 1*4 = 6 in Octal
011 in binary = Octal 3
So,
010110011 in binary = octal 263

Prove these:
1. 10101.01101 in binary = 25.32 in octal (hint 010 101 . 011 010 )
2. 1101100.111 in binary = 154.7 in octal

2. Octal to Binary:
Convert the Octal digit in binary digit in three three’s pairs from the relationship table or calculate and combined them for required result.
Example: Find 263 in octal to binary
Octal 2 = 010 in binary
Octal 6 = 110 in binary
Octal 3 = 011 in binary
So octal 263 = 010 110 011 = 010110011 in binary
Practice: Prove these:
1. 732.16 in octal = 111011010.001110 in binary
2. 2172.01 in octal = 010001111010.000001 in binary

3. Binary to Hexadecimal:
Prepare the binary digit in Four-Four’s pairs. If leftmost group pair has fewer bits then attach required number of leading 0 to become pairs of four. After preparing pairs calculate one hexadecimal digit for each group or check the value of binary in hexadecimal from the relationship table.

Example:
Change a binary digit 1101110 in hexadecimal form?
1101110 = 0110 1110
0110 in binary = 0*1+1*2+1*4+0*8 = 6 in Hexaadecimal
1110 in binary = 0*1 + 1*2 + 1*4 +1*8= 14 = E in Hexadecimal
So,
1101110 in binary = 6E in hexadecimal

Prove these:
1. 110101.011001 in binary =35.64 in hexadecimal
( hint 0011 0101 . 0110 0100)
2. 100001011.000011 in binary = 10B.0C in hexadecimal

4. Hexadecimal to Binary
Convert the Hexadecimal digit in binary digit in Four Four’s pairs from the relationship table or calculate and combined them for required result.

Example: Find 6E in Hexadecimal to binary
Hexadecimal 6 = 0110 in binary
Hexadecimal E = 14 = 1110 in binary
So
Hexadecimal 6E = 0110 1110 = 1101110 in binary

Example:
1. Convert a binary number 11001 into octal?

Sol:
By indirect method:
Step:1 First convert this given(binary) digit into decimal
11001= 1*1 + 0*2 + 0*4 + 1*8 + 1*16 = 25in decimal
Step:2 Convert step 1’s coming decimal digit into required (octal) digit
25in deciaml = 31 in octal
DIVISION QUOTIENT REMAINDER
25/8 3 1
3/8 0 3

By Direct method:
Given digit------ 11001 = 011001
011 is equivalent to 3
001 is equivalent to 1
So 011 001 in binary
3 1 in octal

Relation between Binary & Octal Number System
Decimal Number Binary Number
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

Practice:
Prove these:
1. 314in base 5 = 1110in base 4
2. 3AB in base 15 = 6A0 in base 11
3. B.F4in hexadecimal = 111001.10100101 in binary



D… CONVERSION FOR FRACTIONAL NUMBER

In fractional nos the decimal point plays a great role, so we have to understand the digits before decimal and after decimal. There are different methods for other base to decimal and decimal to other base.

OTHER BASE TO DECIMAL

Rules: In other base to decimal we will follow these operations on the digits which are :
Before decimal – then (given)base’s power will positive in multiplication method to change in decimal digit.
After Decimal – then change in decimal no., we will put (given base 2/8/16….) base’s power negative starting from -1,-2,-3…… by multiplication method.
…( in base ten also 1.36=1*100 + 3*10-1+6*10-2)

E X . (336.23) 8 = ( ? ) 10
= (3 X 64) +(3 X 8)+(6 X 1)+(2 X 8-1)+(3 X 8-2)
= (222.296875) 10

Practice : Change these numbers in decimal-
1. 1789.16 in hexadecimal to decimal
2. 313.45 in octal
3. Prove : 710.10 in octal =456.125 in decimal
4. Prove: 1001.101in octal = 513.126953 in decimal
5. Prove : 11101101.10101 in binary = 237.65625 in decimal


DECIMAL TO OTHER BASE

Decimal to other base we will follow these operations on the digits which are :
Before decimal – then change decimal digit into required base by division method
After Decimal – change decimal no into required base by multiplication method
• Integer with fractional part
Rules:
1. We multiply given fractional part by 2/8/16(required base) and note the result in separate column.
2. The successive fractional parts of the previous result are multiplied by 2/8/16(required base) till the fractional part of the product become 0 or up to the accuracy.
3. The integer part of the product is written in downward direction to find the binary equivalent of the decimal fraction.

Example;
Change a decimal number 0.68 in octal equivalent?

Process Product decimal part integer part
0.68*8 5.44 .44 5
0.44*8 3.52 .52 3
0.52*8 4.16 .16 4
0.16*8 1.28 .28 1
0.28*8 2.24 .24 2

So, 0.68 in decimal = 0.53412 in octal


E X . (69.75)10= (?) 16

DIVISION QUOTIENT REMAINDER
69/16 4 5
4/16 0 4

AND 0.75 X 16=12 (C)

= (69.75)10= (45.C)16

Practice:
1. prove this (3634.6505)in decimal = (E32.A6872) in hexadecimal
2. Prove this: 493.69 in decimal = 1ED.B0A in hexadecimal
3. Prove : 100.011 in decimal = 1100100.0000001 in binary
4. Prove : 3161.36 in decimal = 6131.2702 in octal
5. Prove 336.36 in decimal 520.2702 in octal

No comments:

Post a Comment