-
Notifications
You must be signed in to change notification settings - Fork 236
fix: Correct Binary Addition error (1+1=10) and clarify Sum/Carry #739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: Correct Binary Addition error (1+1=10) and clarify Sum/Carry #739
Conversation
WalkthroughDocumentation 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 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.
Description
This PR addresses a critical content error in the Binary Addition chapter (
_docs/binary-algebra/addition.md). The original code block incorrectly stated1 + 1 = 1, which contradicted the explanatory text and is factually incorrect for binary arithmetic.Changes made:
1 + 1 = 10.110 + 101) to demonstrate how a carry bit propagates and expands the result from 3 bits to 4 bits hence explaining how to carry.Related Issue
Fixes #738
Screenshots (Before vs. After)
Before (The Error):

After (My Fix):

Type of Change
How Has This Been Tested?
I verified the changes using the VS Code Markdown Preview.
Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.