Dec to Bin: Electronics + Recursive

by mr_piay
See Code Download Embed
Decimal to Binary Converter: an electronics-based recursive approach.

The binary equivalent of a decimal number can be found creating a binary counter that counts from 0 to the decimal number.

The least significant bit of the binary number (counter) always toggles (from 0 to 1 and from 1 to 0), but when one bit changes from 1 to 0, the next bit also toggles and this effect repeats recursively until the counter reaches the decimal number.

The binary number is shown as a list of bits. The first item of the list is the least significant bit, and the last item of the list is the most significant bit.

Created May 3, 2020

Last updated May 3, 2020

Published May 3, 2020