# 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.

##### Subtraction With 2âs Complement

The idea is that $XâY=X+(2_{â˛}sÂ complementÂ ofÂY)$ 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? $XâY=X+(1_{â˛}sÂ complementÂ ofÂY)+"carry"$