• Homework
  • Thirds
  • Upper Thirds
  • Fourth
  • Divisions
    • ICT
    • Computer Science
  • Fifth
  • Lower Sixth
  • Upper Sixth
    • Upper Sixth Theory
  • Blog
  • Careers
  • Unity
  • Networking
computinglesson.com
The standard algorithm for decimal to binary conversion.

  • Relies on continuous integer division by two.
  • Every time we divide the input number by two, we look at the remainder

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.

Picture
Powered by Create your own unique website with customizable templates.