OOPortal OOPortal


Data Types  «Prev 

Converting between binary and decimal

The following sequence outlines the steps in converting the binary number 10110001 to its decimal equivalent.

The 1st in this binary number are the positions corresponding to 2 raised to the 7th, 2^5, 2^4, 2^0

Computer Science Structured Approach
Calculate the decimal equivalent of each power of 2 (i.e. 2^7 = 128)

Add the decimal equivalent of each power of 2. The total is the decimal value of the binary number.
128 + 32 + 16 + 1 = 177