Binary Number
Information is represented in logic circuits as electronic signals.
Converting Decimal to Binary
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.
For ECE124, they showed this technique called Substraction by addition.
title: 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](https://www.scaler.com/topics/binary-subtraction/) 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?