[Home] [Why 10] [Weighted numbers] [Conversions] [Gray code] [ASCII codes]
Conversions
Up ]

 
 

 

Last updated: 29-01-09

Our natural number system based @ 10 while computers bound to use 2 as base for their calculations. A common task for a computer program will include conversions between decimal inputs and the binary format.

Most conversions algorithm based at division / modulus operations - but a "slightly modified" shift-register could be very useful for binary to BCD and BCD to binary conversions.  (Read more here)  

 

   

Decimal

Binary Hexadecimal
   0 0 0 0 0    0
   1 0 0 0 1    1
   2 0 0 1 0    2
   3 0 0 1 1    3
   4 0 1 0 0    4
   5 0 1 0 1    5
   6 0 1 1 0    6
   7 0 1 1 1    7
   8 1 0 0 0    8
   9 1 0 0 1    9
  10 1 0 1 0   A
  11 1 0 1 1   B
  12 1 1 0 0   C
  13 1 1 0 1   D
  14 1 1 1 0   E
  15 1 1 1 1   F

Conversions between binary and hexadecimal number systems easy - just group the binary digits in groups of four.

The same is true for binary and octal (radix 8) numbers - just group 3-bits together.  

 

Conversions between decimal and octal number systems possible - divide the decimal number with 8 until the number = 0

 

Conversions between the octal number system and "our decimal system" done by multiplying each octal digit with the powers of 8n

 

 

 
 
 

 

   
 
 

 

   

Hit Counter