//
you're reading...
IT-Center

Convert Decimal To Binary & Hexadecimal

A. Decimal to Binary

Other Sample :

128 64 32 16 8 4 2 1
33-32 0
0 0 1 0 0 0 0 1

Convert From Binary to Decimal :

128 –> 0 = 0
64   –> 0 = 0
32   –> 1 = 32
16   –> 0 = 0
8     –> 0 = 0

4     –> 0 = 0
2     –> 0 = 0
1     –> 1 = 1
______+ = 33

 

B. Decimal to Hex
Steps:

  1. Divide the decimal number by 16.   Treat the division as an integer division.
  2. Write down the remainder (in hexadecimal).
  3. Divide the result again by 16.  Treat the division as an integer division.
  4. Repeat step 2 and 3 until result is 0.
  5. The hex value is the digit sequence of the remainders from the last to first.

Note: a remainder in this topic refers to the left over value after performing an integer division.

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 1
Convert the number 256 DECIMAL to HEXADECIMAL

DIVISION RESULT REMAINDER (in HEX)
256 / 16 16 0
16 / 16 1 0
1 / 16 0 1
ANSWER 100


Example 2
Convert the number 921 DECIMAL to HEXADECIMAL

DIVISION RESULT REMAINDER (in HEX)
921 / 16 57 9
57 / 16 3 9
3 / 16 0 3
ANSWER 399

Convert From Hex to Decimal

Sample Hex = 10E
1 \times 16^2 + 0 \times 16^1 + 14 \times 16^0

= 256 + 0 + 14
= 270

Other Sample Hex = 399
(3 x 64) + (9 x 16) + (9 x 1)
= 768 + 144 + 9
= 921


About berbagisolusi

Berbagi merupakan sebuah bentuk simbol keikhlasan untuk membantu dan menolong, sedangkan solusi adalah cara menyelesaikan masalah. Setiap manusia pasti mengalami masalah, tetapi kita tidak perlu mengalami masalah yang sama jika orang lain pernah mengalami dan kita tahu hal tersebut.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9 other followers

February 2012
M T W T F S S
« Jan   Mar »
 12345
6789101112
13141516171819
20212223242526
272829  

Archives

Web Statistic

Blog Stats

  • 149,580 hits
%d bloggers like this: