How To Program From Ground Up With Minimal BS — Part 3— Data Structures — Negative Binary Numbers

Chris Athanas
Mar 10, 2024

--

The course that I wish I had been given when I started learning about programming computers.

BIG IDEA — Negative numbers are represented as “signed” binary using a special “2’s Complement” representation.

  • They are “signed” because they can represent both positive and negative numbers (“negative sign” or “positive sign”.)
  • 2’s Complement is the most common way to represent negative numbers in binary.
  • 2’s Complement is a simple binary inversion with 1 extra step, or “complement” of the number (“flipping” the bits) and then adding 1.
  • 2’s Complement is used to represent negative numbers in binary because it makes the addition and subtraction of numbers easier.

Join the “How to Program From Ground Up with Minimal BS” group on Twitter:
https://twitter.com/i/communities/1759753866219040980

--

--

Chris Athanas

KMP (Kotlin Mutli-Platform) Android+iOS+Web Developer, Based out of Austin, TX and Tepoztlán, Mexico