Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 3: Binary Arithmetic — Addition & Subtraction

Lesson 26 of 34 in the free Fundamentals of IT & Computers notes on Siksha Sarovar, written by Rohit Jangra.

Unit III — Binary Arithmetic: Addition & Subtraction

Binary arithmetic follows the same rules as decimal arithmetic but uses only two digits: 0 and 1. Carries and borrows work on powers of 2 instead of powers of 10.

---

Binary Addition Rules

ABCarry InSumCarry Out
00000
01010
10010
11001
00110
01101
10101
11111

Key rule: 1 + 1 = 10 (binary) — write 0, carry 1.

---

Binary Addition Examples

Example 1: Add (1011)₂ + (0110)₂

  1 0 1 1   (11 in decimal)
+ 0 1 1 0   (6 in decimal)
---------
  1 0 0 0 1  (17 in decimal)

Step-by-step (right to left):

  • Col 0: 1+0 = 1
  • Col 1: 1+1 = 10 → write 0, carry 1
  • Col 2: 0+1+1(carry) = 10 → write 0, carry 1
  • Col 3: 1+0+1(carry) = 10 → write 0, carry 1
  • Col 4: carry 1 → write 1

Result: (10001)₂ = 17

---

Example 2: Add (11001)₂ + (10111)₂

  1 1 0 0 1   (25)
+ 1 0 1 1 1   (23)
-----------
1 1 0 0 0 0   (48)
  • Col 0: 1+1 = 0 carry 1
  • Col 1: 0+1+1 = 0 carry 1
  • Col 2: 0+1+1 = 0 carry 1
  • Col 3: 1+0+1 = 0 carry 1
  • Col 4: 1+1+1 = 1 carry 1
  • Col 5: 0+0+1 = 1

Result: (110000)₂ = 48

---

Binary Subtraction Rules

ABBorrowDifferenceBorrow Out
00000
10010
11000
01011

Key rule: 0 − 1 → borrow from left; treated as 10 − 1 = 1, with borrow propagating.

---

Binary Subtraction Examples

Example 1: Subtract (1101)₂ − (0101)₂

  1 1 0 1   (13)
- 0 1 0 1   (5)
---------
  1 0 0 0   (8)
  • Col 0: 1−1 = 0
  • Col 1: 0−0 = 0
  • Col 2: 1−1 = 0
  • Col 3: 1−0 = 1

Result: (1000)₂ = 8

---

Example 2: Subtract (10100)₂ − (01011)₂

  1 0 1 0 0   (20)
- 0 1 0 1 1   (11)
-----------
  0 1 0 0 1   (9)

Work through each column, borrowing as needed.

Result: (01001)₂ = 9

---

Verification Tip

Always verify by converting binary results to decimal.

Key Takeaway: Binary addition carries when a column sums to 2 or more (1+1=10). Binary subtraction borrows from a higher bit when subtracting 1 from 0. Carry/borrow management is the most error-prone part — always work right to left and note each carry/borrow explicitly.