Binary Addition Example:
1011
+ 1101
------
11000
Explanation:
1. Align the numbers by their least significant bits (rightmost bits).
2. Start from the rightmost bit and add each pair of bits, carrying over any values as needed.
3. Write down the result for each bit position.
4. If there is a carry left over at the end, write it down as the most significant bit.
Binary Subtraction Example:
Borrow: 10 (borrow 1 from the next bit, convert 0 to 10)
1101
- 1010
------
0011
Detailed Steps:
1. Align the numbers:
1101
- 1010
2. Start from the rightmost bit:
- 1 - 0 = 1
3. Move to the next bit:
- 0 - 1 (need to borrow from the next bit)
- Borrow 1 from the next bit (making the next bit 0), convert 0 to 10.
- Now, 10 - 1 = 1
4. Continue with the next bit:
- Subtract 0 - 0 = 0 (after borrowing)
5. Finally:
- Subtract 1 - 1 = 0
6. Result:
- The result of the subtraction, after handling all borrowing, is 0011.
Binary Multiplication Example:
101
x 11
-----
101 (1 multiplied by 101, shifted 0 positions)
+ 1010 (1 multiplied by 101, shifted 1 position to the left)
-----
1111
Explanation:
1. Multiply each bit of the first number by each bit of the second number.
2. Shift the results according to their bit positions.
3. Sum all the shifted results to get the final product.
Binary Division Example:
1010 รท 10
101 (Quotient)
-----
10 | 1010
- 10
-----
10
-10
-----
0 (Remainder)
Explanation:
1. Align the divisor (10) with the leftmost bits of the dividend (1010).
2. Subtract the divisor from the aligned portion of the dividend.
3. Bring down the next bit of the dividend and repeat the process.
4. Continue until all bits of the dividend have been used.
5. The quotient is the result of the division, and any remaining value is the remainder.
Binary Number: 1101
Positions: 3210
Values: 8421
Conversion to Decimal:
1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0
= 8 + 4 + 0 + 1
= 13 (in decimal)
Explanation:
1. Each binary digit corresponds to a power of 2 based on its position from right to left.
2. Calculate the value for each bit by multiplying it with 2^position.
3. Sum all these values to get the decimal representation.