The standard algorithm for decimal to binary conversion.
The remainder is calculated using the mod operator. If there is a remainder, we add 1 to the left of the output. We stop when the input value has divided down to zero. |
The standard algorithm for decimal to binary conversion.
The remainder is calculated using the mod operator. If there is a remainder, we add 1 to the left of the output. We stop when the input value has divided down to zero. |