Subjects computer science

Binary Operations Ce631F

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Use the AI math solver

1. **Stating the problem:** We want to understand what the binary system is and how to perform the four fundamental operations (addition, subtraction, multiplication, division) in binary. 2. **What is the binary system?** The binary system is a base-2 numeral system that uses only two digits: 0 and 1. It is the foundation of all modern digital computers. 3. **Four fundamental operations in binary:** - Addition - Subtraction - Multiplication - Division 4. **Rules for binary operations:** - Addition: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (which means 0 carry 1) - Subtraction: 0-0=0, 1-0=1, 1-1=0, 0-1=1 borrow 1 - Multiplication: 0*0=0, 0*1=0, 1*0=0, 1*1=1 - Division: Similar to decimal long division but with binary digits 5. **Examples:** **Addition:** Example 1: $101_2 + 11_2$ $$\begin{aligned} &\quad 101 \\ &+\ 011 \\ &= 1000 \end{aligned}$$ Explanation: 1+1=10 carry 1, 0+1+1=10 carry 1, 1+0+1=10 carry 1, final carry 1. Example 2: $1101_2 + 1011_2$ $$\begin{aligned} &\quad 1101 \\ &+\ 1011 \\ &= 11000 \end{aligned}$$ Example 3: $1001_2 + 111_2$ $$\begin{aligned} &\quad 1001 \\ &+\ 0111 \\ &= 10000 \end{aligned}$$ **Subtraction:** Example 1: $1010_2 - 11_2$ $$\begin{aligned} &\quad 1010 \\ &-\ 0011 \\ &= 0111 \end{aligned}$$ Example 2: $1100_2 - 101_2$ $$\begin{aligned} &\quad 1100 \\ &-\ 0101 \\ &= 0111 \end{aligned}$$ Example 3: $10000_2 - 1_2$ $$\begin{aligned} &\quad 10000 \\ &-\ 00001 \\ &= 01111 \end{aligned}$$ **Multiplication:** Example 1: $101_2 \times 11_2$ $$\begin{aligned} &\quad 101 \\ &\times 11 \\ &= 1111 \end{aligned}$$ Example 2: $110_2 \times 10_2$ $$\begin{aligned} &\quad 110 \\ &\times 10 \\ &= 1100 \end{aligned}$$ Example 3: $101_2 \times 101_2$ $$\begin{aligned} &\quad 101 \\ &\times 101 \\ &= 11001 \end{aligned}$$ **Division:** Example 1: $1100_2 \div 10_2$ $$\begin{aligned} &1100 \div 10 = 110 \end{aligned}$$ Example 2: $1010_2 \div 10_2$ $$\begin{aligned} &1010 \div 10 = 101 \end{aligned}$$ Example 3: $1111_2 \div 11_2$ $$\begin{aligned} &1111 \div 11 = 101 \end{aligned}$$ Each example shows the binary operation and the result in binary.