The ability to know the max size of a binary number allows us to check our work when we go to find the actual value of a binary number.

A five-digit binary number can never be more than 31, or 25-1 because 11111 is equal to 31.

To help keep our workspaces clear and concise, it is common practice to add subscripts to numbers when working multiple numbering systems in the same space.

11111 and 31 from above should be represented as 111112 and 3110 representing their bases for clarity. If no subscript is used, it is assumed to be a decimal number.

To convert from a binary to a decimal number, make a table like the one below. For every bit that contains a 1, add that decimal number to the total. Let’s look at the 8-bit number 110011102.

Decimal to Binary Conversion

Adding the decimal values of all the 1s highlighted in yellow gives us: (128) + (64) + (8) + (4) + (2) = 20610.



Create a new variable, decimal_conversion1, with the converted decimal value of 1001102


Create a new variable, decimal_conversion2, with the converted decimal value of 11110111100112

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?