Introduction Of Numbering Systems (Binary, Decimal, Octal And Hexadecimal):
For More About - > Notes For Number Systems (Binary, Decimal, Octal, Hexadecimal):
Conversion Table - Binary, Decimal, Hexadecimal, Octal:
The Binary Concept - Power Of Two:
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 |
Power Of Two :
2^0=1 2^1=2 2^2=4 2^3=8 2^4=16 2^5=32 2^6=64 2^7=128The Relationship Between These Number Systems Can Be Seen In The Following Table, Where The Zero Position Refers To The Rightmost Digit Of A Number, And The ^ Symbol Represents Exponentiation:
Position : |
Value in Base : |
|||
10 |
2 |
8 |
16 |
|
0 |
10^0 = 1 | 2^0 = 1 | 8^0 = 1 | 16^0 = 1 |
1 |
10^1 = 10 | 2^1 = 2 | 8^1 = 8 | 16^1 = 16 |
2 |
10^2 = 100 | 2^2 = 4 | 8^2 = 64 | 16^2 = 256 |
3 |
10^3 = 1000 | 2^3 = 8 | 8^3 = 512 | 16^3 = 4,096 |
4 |
10^4 = 10,000 | 2^4 = 16 | 8^4 = 4,096 | 16^4 = 65,536 |
5 |
10^5 = 100,000 | 2^5 = 32 | 8^5 = 32,768 | 16^5 = 1,048,576 |
6 |
10^6 = 1,000,000 | 2^6 = 64 | 8^6 = 262,144 | 16^6 = 16,777,216 |
7 |
10^7 = 10,000,000 | 2^7 = 128 | 8^7 = 2,097152 | 16^7 = 268,435,456 |
BINARY TO DECIMAL CONVERSION
- Start The Decimal Result At 0.
- Remove The Most Significant Binary Digit (Leftmost) And Add It To The Result.
- If All Binary Digits Have Been Removed, You’re Done. Stop.
- Otherwise, Multiply The Result By 2.
- Go To Step 2.
An Example Of Converting 11100000000 Binary To Decimal :
Binary Digits | Operation | Decimal Result | Operation | Decimal Result |
11100000000 | +1 | 1 | × 2 | 2 |
1100000000 | +1 | 3 | × 2 | 6 |
100000000 | +1 | 7 | × 2 | 14 |
00000000 | +0 | 14 | × 2 | 28 |
0000000 | +0 | 28 | × 2 | 56 |
000000 | +0 | 56 | × 2 | 112 |
00000 | +0 | 112 | × 2 | 224 |
0000 | +0 | 224 | × 2 | 448 |
000 | +0 | 448 | × 2 | 896 |
00 | +0 | 896 | × 2 | 1792 |
0 | +0 | 1792 |
DECIMAL TO BINARY CONVERSION
The Decimal (Base Ten) Numeral System Has Ten Possible Values (0,1,2,3,4,5,6,7,8, Or 9) For Each Place-Value. In Contrast, The Binary (Base Two) Numeral System Has Two Possible Values, Often Represented As 0 Or 1, For Each Place-Value.
To Avoid Confusion While Using Different Numeral Systems, The Base Of Each Individual Number May Be Specified By Writing It As A Subscript Of The Number. For Example, The Decimal Number 156 May Be Written As 15610 And Read As "One Hundred Fifty-Six, Base Ten". The Binary Number 10011100 May Be Specified As "Base Two" By Writing It As 10011100 2 .
Decimal To Binary Conversion Examples :
- (51)10 = (110011)2
- (217)10 = (11011001)2
- (8023)10 = (1111101010111)2
Decimal Binary Conversion Table:
Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
An Example Of Using Repeated Division To Convert 1792 Decimal To Binary :
- Divide The Decimal Number By The Desired Target Radix (2, 8, Or 16).
- Append The Remainder As The Next Most Significant Digit.
- Repeat Until The Decimal Number Has Reached Zero.
Decimal Number | Operation | Quotient | Remainder | Binary Result | |
1792 | ÷ 2 = | 896 | 0 | 0 | |
896 | ÷ 2 = | 448 | 0 | 00 | |
448 | ÷ 2 = | 224 | 0 | 000 | |
224 | ÷ 2 = | 112 | 0 | 0000 | |
112 | ÷ 2 = | 56 | 0 | 00000 | |
56 | ÷ 2 = | 28 | 0 | 000000 | |
28 | ÷ 2 = | 14 | 0 | 0000000 | |
14 | ÷ 2 = | 7 | 0 | 00000000 | |
7 | ÷ 2 = | 3 | 1 | 100000000 | |
3 | ÷ 2 = | 1 | 1 | 1100000000 | |
1 | ÷ 2 = | 0 | 1 | 11100000000 | |
0 |
Now We Are Going To See How To Convert Decimal To Binary :
The Decimal or "Denary" Counting System Uses The Base of 10 Numbering System Where Each Digit In A Number Takes On One Of Ten Possible Values From 0 to 9, eg 21310 (Two Hundred And Thirteen). In A Decimal System Each Digit Has A Value Ten Times Greater Than Its Previous Number And This Decimal Numbering System Uses A Set Of Symbols, b, Together With A Base, q, To Determine The Weight Of Each Digit Within A Number. For Example, The Six In Sixty Has A Lower Weighting Than The Six In Six Hundred And In A Binary Numbering System We Need Some Way Of Converting Decimal To Binary.
Any Numbering System Can Be Summarised By The Following Relationship :
N = bi qi | |||
where: | N Is A Real Positive Number
b Is The Symbol q Is The Base Value and integer (i) Can Be Positive, Negative Or Zero |
||
N = b2 q2 + b1 q1 + b0 q0 + b-1 q-1 ... etc. |
In The Decimal Or Denary System, The Columns Have Values Of Units, Tens, Hundreds Etc As We Move From Right To Left And Mathematically These Values Are Written As 100, 101, 102, 103 etc. The Decimal Numbering System Has A Base Of 10 Or Modulo-10 (Sometimes Called MOD-10) With The Position Of Each Digit In The Decimal System Indicating The Magnitude Or Weight Of The Number. For Example, 20 (Twenty) Is The Same As Saying 2 X 101 And 400 (Four Hundred) Is The Same As Saying 4 X 102. Likewise, For Fractional Numbers The Weight Of The Number Is Negative, 10-1, 10-2, 10-3 etc.
The Value Of A Decimal Number Is Equal To The Sum Of The Digits Multiplied By Their Respective Weights. For Example: N = 616310 (Six Thousand One Hundred And Sixty Three) In A Decimal Format Is Equal To:
(6×103) + (1×102) + (6×101) + (3×100) = 6163
Unlike The Decimal Numbering System Which Uses The Base Of 10, Digital Logic Uses Just Two Values Or States, A Logic Level "1" Or A Logic Level "0", So Each "0" And "1" Is Considered To Be A Single Digit In A Base Of 2 or Binary numbering system. In The Binary Numbering System, Each Digit Has A Value Twice That Of The Previous Digit But Can Only Have A Value Of Either "1" Or "0" Therefore, q = "2" And The Position Of Either A "0" Or A "1" Indicates Its Weight.
For Example:
Decimal Digit Value: | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary Digit Value: | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
By Adding Together All The Decimal Number Values From Right To Left At The Positions That Are Represented By A "1" Gives Us: (256) + (64) + (32) + (4) + (1) = 35710 or three hundred and fifty seven in decimal.
Then, The Binary Array Of Digits 1011001012 Is Equivalent To 35710 In Decimal Or Denary. As The Decimal Number Is A Weighted Number, Converting From Decimal To Binary Will Also Produce A Weighted Binary Number With The Right-Hand Most Bit Being The Least Significant Bit Or LSB, And The Left-Hand Most Bit Being The Most Significant Bit Or MSB. And We Can Represent These As.
MSB | Binary Digit | LSB | ||||||
28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Repeated Division-By-2 Method:
Another Method Of Converting Decimal to Binary Number Equivalents Is To Write Down The Decimal Number And To Continually Divide By 2 (Two) To Give A Result And A Remainder Of Either A "1" Or A "0" Until The Final Result Equals Zero.
Example. Convert The Decimal Number 29410 Into Its Binary Number Equivalent.
Number | 294 | Dividing Each Number By "2" Gives A Result Plus A Remainder. The Binary Result Is Obtained By Placing The Remainders In Order With The Least Significant Bit (LSB) Being At The Top And The Most Significant Bit (MSB) Being At The Bottom. | |||
Divide By 2 | |||||
Result | 147 | Remainder | 0 (LSB) | ||
Divide By 2 | |||||
Result | 73 | Remainder | 1 | ||
Divide By 2 | |||||
Result | 36 | Remainder | 1 | ||
Divide by 2 | |||||
Result | 18 | Remainder | 0 | ||
Divide by 2 | |||||
Result | 9 | Remainder | 0 | ||
Divide by 2 | |||||
Result | 4 | Remainder | 1 | ||
Divide by 2 | |||||
Result | 2 | Remainder | 0 | ||
Divide by 2 | |||||
Result | 1 | Remainder | 0 | ||
Divide by 2 | |||||
Result | 0 | Remainder | 1 (MSB) |
Then, The Decimal To Binary Conversion Gives The Decimal Number 29410 equivalent of 1001001102 In Binary, Reading From Right To Left.
Then The Main Characteristics Of A Binary Numbering System Is That Each "Digit" Or "Bit" Has A Value Of Either "1" or "0" With Each Digit Having A Weight Or Value Double That Of Its Previous Bit Starting From The Lowest Or Least Significant Bit (LSB) And This Is Called The "Sum-Of-Weights" Method. So We Can Convert A Decimal Number To Binary Either By Using The Sum-Of-Weights Method Or By Using The Repeated Division-by-2 method.
BINARY TO HEXADECIMAL CONVERSION
10100102 = 0101 0010 Grouped With Padding = 5216
110111012 = 1101 1101 Grouped = DD16
Another Easy Conversion To Do Is Binary To Hexadecimal. The Hexadecimal Number System Uses The Digits 0 To 9 And A, B, C, D, E, F. And Since The Hexadecimal System Is A Power Of 2 (24), We Can Take A Binary Number In Groups Of 4 And Use The Appropriate Hexadecimal Digit In Its Place.
The Steps To Doing So Are Simple. Begin At The Rightmost 4 Bits. If There Are Not 4 Bits, Pad 0s To The Left Until You Hit 4. Repeat The Steps Until All Groups Have Been Converted.
An Example Is Below :
Take The Binary Number (1000101). Using The Above Steps, Here Is The Conversion:
0100 | 0101 Note That We Needed To Pad A 0 To The Left. 4 | 5 Answer: (45)16
HEXADECIMAL TO BINARY CONVERSION
This Conversion Is Also Simplistic. Given A Hexadecimal Number, Simply Convert Each Digit To It’s Binary Equivalent. Then, Combine Each 4 Bit Binary Number And That Is The Resulting Answer.
Hexadecimal To Binary Conversion Examples :- (1e3)16 = (111100011)2
- (0a2b)16 = (101000101011)2
- (7e0c)16 = (111111000001100)2
Hexadecimal To Binary Conversion Chart Table:
Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
Take The Hexadecimal Number (A2F)16 And Convert It To Its Binary Form:
A | 2 | F 1010 | 0010 | 1111 Answer: (1010 0010 1111)2
Take the hexadecimal number (55)16 and convert it to it’s binary form:
5 | 5 0101 | 0101 Answer: (1010101)2
BINARY TO OCTAL CONVERSION
An Octal System Is Again A Power Of Two (23), We Can Take Group The Bits Into Groups Of 3 And Represent Each Group As An Octal Digit. The Steps Are The Same For The Binary To Hexadecimal Conversions Except We Are Dealing With The Octal Base Now.
Given A Binary Number You Start By Grouping The Binary "1" And "0" Digits In Groups Of 3, Starting At The Right. Then Convert Each Of These Groups Into One Octal Digit.
Take The Binary Number (10011)2 And Convert It To Octal (Converting From One Base (Base 2) To Base 8) :
010 | 011 2 | 3 Answer: (23)8Example:
binary number = 11001100010
grouped in 3s = 11 001 100 010
3s into octal = 3 1 4 2
So, The Base 2 number 11001100010 equals 3142 in base 8. (Octal Is A Base 8 System And Binary Is A Base 2 System).
Note:To Convert An Octal Number Into A Binary, Just Reverse The Above Process; Starting All The Way To The Right, Convert Each Digit Into A 3-Bit Binary Number.
DECIMAL TO OCTAL CONVERSION :
The Steps As Followed To Convert Decimal To Binary Are :
To Convert A Decimal Number Into An Octal Number, Divide It By 8 Repeatedly And Note The Remainders. The Remainders Are The Digits Of The Octal Number. The “Last” Remainder Is The Most Significant Digit, And The “First” Remainder Is The Least Significant Digit.For Example,
1701(base 10) = 3245(base 8) | 1701 ÷ 8 = 212 | remainder | 5 | LSB | ||||
212 ÷ 8 = 26 | remainder | 4 | ||||||
26 ÷ 8 = 3 | remainder | 2 | ||||||
3 ÷ 8 = 0 | remainder | 3 | MSB |
OCTAL TO DECIMAL CONVERSION :
- Start The Decimal Result At 0.
- Remove The Most Significant Octal Digit (Leftmost) And Add It To The Result.
- If All Octal Digits Have Been Removed, You’re Done. Stop.
- Otherwise, Multiply The Result By 8.
- Go To Step 2.
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
Take The Octal Number (764)8 And Convert It To Decimal:
7 * 82 + 6 * 81 + 4 * 80 448 + 48 + 4 = 500 Answer: (500)10
Take The Octal Number (5771)8 And Convert It To Decimal:
5 * 83 + 7 * 82 + 7 * 81 + 1 * 80 2560 + 448 + 56 + 1 = 3,065 Answer: (3065)10
DECIMAL TO HEXADECIMAL CONVERSION
The Only Addition To The Algorithm When Converting From Decimal To Hexadecimal Is That A Table Must Be Used To Obtain The Hexadecimal Digit If The Remainder Is Greater Than Decimal 9.
Decimal To Hexadecimal Conversion Examples:- (79)10 = (4F)16
- (120)10 = (78)16
- (1728)10 = (6C0)16
Decimal Hex Conversion Chart Table:
Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
A2DE Hexadecimal :
= ((A) * 163) + (2 * 162) + ((D) * 161) + ((E) * 160)= (10 * 163) + (2 * 162) + (13 * 161) + (14 * 160)
= (10 * 4096) + (2 * 256) + (13 * 16) + (14 * 1)
= 40960 + 512 + 208 + 14
= 41694 decimal
OCTAL TO HEXADECIMAL CONVERSION
Convert The Octal Number 536 To Its Equivalent Hexadecimal Number.
Convert 536 (Octal) First To Its Binary Equivalent We Get : (536)8 = (101) (011) (110)= (101011110)2 Now forming the groups of 4 binary bits to obtain its hexadecimal equivalent we get,
(101011110)2= (1) (0101) (1110)
= (0001) (0101) (1110)
= (15E)16 Example -2:
Convert The Hexadecimal Number 3DE To Its Octal Equivalent :
The Hexadecimal Number 3DE Is First Converted To Its Binary Equivalent. (3DE)16 = (0011) (1101) (1110)= (001111011110)2 Now The Above Binary Equivalent Is Divided Into Groups Of 3 Bits To Obtain Its Octal Equivalent.
(001111011110)2 = (001) (111) (011) (110)
= (1736)8
Below Are The Examples On Converting Octal To Hexadecimal -
Solved Examples
Solution:
The given number is 10028
10028 = (1 * 83)+ (0 * 82) + (0 * 81) + (2 * 80)
=1 * 512 + 0 * 64 + 0 * 8 + 2 * 1
= 512 + 0 + 0+ 2
= 514(decimal number)
Now we convert the above decimal to hexadecimal
16 | 514
16 | 32 --2
2 -- 0
The hexadecimal number is 202
10028 = 20216
Solution:
The given number is 1008
10028 = (1 * 82) + (0 * 81) + (0 * 80)
= 1 * 64 + 0 * 8 + 0 * 1
= 64 + 0 + 0
= 64(decimal number)
Now we convert the above decimal to hexadecimal
16 | 64
16 | 4 --0
16 | 0 -- 4
The hexadecimal number is 40
1008 = 4016
Solution:
The given number is 158
158 =(1 * 81) + (5 * 80)
= 1 * 8 + 5 * 1
= 8 + 5
= 13(decimal number)
Now we convert the above decimal to hexadecimal
13 is less than 16 so the equivalent hexadecimal number is D
The hexadecimal number is D
158 = D16
For More About - > Notes For Number Systems (Binary, Decimal, Octal, Hexadecimal):
Conversion Table - Binary, Decimal, Hexadecimal, Octal:
The Binary Concept - Power Of Two:
CONCLUSION:
The Goal Of This Article Is To Give An Easy Way To Understand The “Numbers Conversion - Binary To Decimal, Octal, Hexadecimal And So:" Hope This Article Will Help Every Beginners Who Are Going To Start Cisco Lab Practice Without Any Doubts.
Some Topics That You Might Want To Pursue On Your Own That We Did Not Cover In This Article Are Listed Here, Thank You And Best Of Luck.
This Article Written Author By: Premakumar Thevathasan. CCNA, CCNP, CCIP, MCSE, MCSA, MCSA - MSG, CIW Security Analyst, CompTIA Certified A+.
DISCLAIMER:
This Document Carries No Explicit Or Implied Warranty. Nor Is There Any Guarantee That The Information Contained In This Document Is Accurate. Every Effort Has Been Made To Make All Articles As Complete And As Accurate As Possible.
It Is Offered In The Hopes Of Helping Others, But You Use It At Your Own Risk. The Author Will Not Be Liable For Any Special, Incidental, Consequential Or Indirect Any Damages Due To Loss Of Data Or Any Other Reason That Occur As A Result Of Using This Document. But No Warranty Or Fitness Is Implied. The Information Provided Is On An "As Is" Basic. All Use Is Completely At Your Own Risk.
For Home Page Of - > SCN InF4 TECH
To Send Email
Window Minimize OR Window Maximize
No comments:
Post a Comment