Source: https://www.technologuepro.com/cours-systemes-logiques-1-2/chapitre-1-systemes-de-numeration-codes-et-arithmetique-binaire.pdf