🧠

Binary

  • Bi --> latin for "two"
  • Invented by Gottfried Wilhelm Leibniz
  • Base-2 (0, 1)
  • Simplifies design of computers (and related technology)
    • All information is stored using 0s and 1s

Two's Compliment

  • An easy way to represent a negative number in binary

Two's Compliment Example

Two's Compliment Example

  • Have a negative number (-7)
  • Drop the sign (7)
  • Binary (0111)
  • Flip the bits (1000)
  • Add one (1001)

Converting Real Number (Decimal) to Binary

  • Convert the numbers on both sides of the decimal separately
  • Fractional part is similar to the whole value, only using multiplication instead of division

Real Number to Binary Example

Example of converting a real number to binary

Math Computer Science