Number System

Binary Number

Information is represented in logic circuits as electronic signals.

Converting Decimal to Binary

Screen Shot 2022-03-07 at 12.46.17 PM.png

Converting Binary to Decimal

Super simple, just add up all the numbers, multiplying 1 or 0 by the corresponding exponential value.

Binary Number Addition / Subtraction

I think this is pretty straightforward, just do the carry overs. Pasted image 20220417173409.png

For ECE124, they showed this technique called Substraction by addition.

Why am I learning this?

Sure, the above is easy to understand and do by hand, but computers can’t do that. Instead, we thought of clever techniques to make arithmetic work. See this article for more details.

Subtraction With 2’s Complement

The idea is that At the end of the addition,

  • If the final carry over of the sum is 1, it is dropped and the result is positive.
  • If there is no carry over, the two’s complement of the sum will be the result and it is negative
Subtraction with 1’s Complement

Basically same as 2s complement, a bit more confusing and fake?