Binary use algorithm

A binary number calculate algorithm