Binary Addition
- Four basic rules for adding two bits and are as follows:

- is the sum and is the carry
- When there is a carry of 1 to the next column, you have a situation in which three bits are being added

- When there is a carry of 1 to the next column, you have a situation in which three bits are being added
- Typically, you should write the carry as part of your addition
Half Adder
- Adds 2 input bits

- Outputs 2 bits:
- Carry bit
- Sum bit
Full Adder
- Adds 3 bits

- Sum bit is 1 if the # of 1’s in the input is odd
- Carry bit is 1 if there are two-three “1” inputs
The Ripple Carry Adder
- Can build -bit adder using identical smaller full adders

Binary Subtraction
- When subtracting 2 bits (), we get the difference () and the borrow-out , with only for

- When subtracting a 1 from a 0, you have to borrow a “1” from the next column to the left
Half Subtractor
- Subtracts 2 input bits

- Outputs 2 bits:
- Difference bit
- Borrow bit if
Full Subtractor
- Has 3 input bits

The Ripple-Borrow Subtractor
- Same as earlier but using multiple full subtractors

Combined Addition/Subtraction
- Use 0 and 1 to indicate if a number is positive/negative
e.g. 0 0110 +4, 1 0100 -4 - This is a signed number system
- The following notes relate directly to using this system
Converting from binary to decimal:

Two’s Complement Representation
- 2’s complement of a binary number is formed by taking 1’s complement of the number and adding 1 to the least significant bit
- Alternate way: complement bits to the left of the rightmost 1
- 1’s complement negates numbers by complementing each bit of the number
2’s complement = 1’s complement +1
Taking the 2’s complement of a binary number negates it (changes its sign)
- Summing the complement of a number with itself should equal 0

Converting 2’s complement binary to decimal:
- Same process as earlier, but minus away the sign bit

Two’s Complement Addition
- To find A + B, you just have to:
- Do unsigned addition on A and B, including their sign bits
- Ignore any carry out originating from MSB