Skip to content

fix: Correct Binary Addition error (1+1=10) and clarify Sum/Carry - #739

Merged
Nihal4777 merged 2 commits into
CircuitVerse:masterfrom
kush124k:fix/738-binary-addition-error
May 31, 2026
Merged

Nihal4777 merged 2 commits into
CircuitVerse:masterfrom
kush124k:fix/738-binary-addition-error

Conversation

@kush124k

@kush124k kush124k commented Dec 10, 2025 •

Copy link
Copy Markdown
Contributor

Description

This PR addresses a critical content error in the Binary Addition chapter (_docs/binary-algebra/addition.md). The original code block incorrectly stated 1 + 1 = 1, which contradicted the explanatory text and is factually incorrect for binary arithmetic.

Changes made:

  1. Fixed the Logic Error: Updated the rules list to correctly show 1 + 1 = 10.
  2. Added Clarification: Added a "Sum vs Carry" table for easier explanation of Binary Addition.
  3. Improved Example: Added a 3-digit addition example (110 + 101) to demonstrate how a carry bit propagates and expands the result from 3 bits to 4 bits hence explaining how to carry.
  4. Refined Explanations: Cleaned up the explanatory paragraph to be more concise and accurate.

Related Issue

Fixes #738

Screenshots (Before vs. After)

Before (The Error):
image

After (My Fix):
image

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

How Has This Been Tested?

I verified the changes using the VS Code Markdown Preview.

  • Confirmed the Table renders with correct alignment.
  • Confirmed the Code Blocks are formatted correctly.
  • Checked that the new 3-digit example aligns properly.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code (or documentation), particularly in hard-to-understand areas
  • My changes generate no new warnings

Summary by CodeRabbit

  • Documentation
    • Corrected binary addition rule (1 + 1 now shown as 10, indicating a carry).
    • Refined and relabeled examples for clarity (concise Example 1 and Example 2).
    • Reworded explanatory text to better describe carrying between columns.
    • Adjusted section headers and formatting for improved readability.

@coderabbitai

coderabbitai Bot commented Dec 10, 2025 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f1ee2bf-c0fd-4ed5-9d52-cbc5fecb27df

📥 Commits

Reviewing files that changed from the base of the PR and between 3bba857 and 9ce977c.

📒 Files selected for processing (1)
  • docs/binary-algebra/addition.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/binary-algebra/addition.md

Walkthrough

Documentation corrected to fix an incorrect binary addition rule statement (1 + 1 = 1 → 1 + 1 = 10), simplified and relabeled example blocks with clearer explanations of binary carry operations, and adjusted formatting and headers for consistency.

Changes

Cohort / File(s) Summary
Binary Addition Documentation Fix
docs/binary-algebra/addition.md
Fixed incorrect binary addition rule (1 + 1 = 10 instead of 1); replaced multi-line example with simplified labeled "Example 1" (1+1=10 and 1+0=1); rewrote carrying explanation; added "Example 2" with 4-bit addition (110 + 101 = 1011); updated formatting and section headers

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify binary arithmetic correctness (1 + 1 = 10 with carry)
  • Confirm example outputs match the corrected rules
  • Check formatting consistency with existing documentation style
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly addresses the main change: correcting the binary addition error (1+1=10) and clarifying sum/carry concepts, which matches the file modifications.
Linked Issues check ✅ Passed All objectives from issue #738 are met: fixed 1+1=10 error, added sum vs carry table, included 3-digit example (110+101=1011), and updated explanatory text for consistency.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #738: correcting the binary addition error, clarifying sum/carry distinction, and improving documentation without altering code structures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/binary-algebra/addition.md (1)

34-38: Consider extracting the truth table for improved rendering and clarity.

The truth table is currently rendered as plain text within a code block. Extracting it as a native markdown table would improve semantic markup and readability, and explicitly labeling the "Carry" column as "Carry Out" would further clarify the bit-wise addition semantics.

Optional refactor:

- | A | B | Carry | Sum |Result |
- | 0 | 0 |   0   |  0  |   0   |
- | 0 | 1 |   0   |  1  |   1   |
- | 1 | 0 |   0   |  1  |   1   |
- | 1 | 1 |   1   |  0  |   10  |

Extract as a native markdown table outside the code block:

| A | B | Carry Out | Sum | Result |
|---|---|-----------|-----|--------|
| 0 | 0 |     0     |  0  |   0    |
| 0 | 1 |     0     |  1  |   1    |
| 1 | 0 |     0     |  1  |   1    |
| 1 | 1 |     1     |  0  |   10   |

Then adjust the code block to contain only the Examples section.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a01b5d and 3bba857.

📒 Files selected for processing (1)
  • docs/binary-algebra/addition.md (1 hunks)
🔇 Additional comments (3)
docs/binary-algebra/addition.md (3)

26-45: Excellent correction and clarification of binary addition rules.

The fix for "1 + 1 = 10" is now correct, and the truth table effectively demonstrates the distinction between carry and sum outputs. Example 1 (11 + 10 = 101) correctly illustrates single-column addition with proper decimal equivalents. All mathematical content is accurate, and the PR objectives are well-addressed.


48-48: Clear and accurate step-by-step explanation.

The paragraph effectively walks through the carry mechanism in Example 1 and correctly analogizes to decimal addition. This directly supports the learning objective and addresses the PR's goal of clarifying carry behavior.


50-57: Excellent multi-bit example demonstrating carry propagation.

Example 2 (110 + 101 = 1011) effectively shows how carries propagate across columns and result in bit-width expansion from 3 to 4 bits. This directly addresses the PR objective to demonstrate carry propagation and is well-positioned after the explanatory text.

@Nihal4777 Nihal4777 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kush124k ❤

@Nihal4777
Nihal4777 merged commit bd99a34 into CircuitVerse:master May 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binary Addition code block incorrectly states 1+1=1

2 participants