-->

Addition of two binary numbers using C

Addition of two binary numbers using C
    Basic Theory
    Addition of binary numbers is far simpler than that of decimal number. This is because, binary addition includes addition between 1 and 0 only. The addition process results into two unit: sum and carry
    sum = a xor b xor c
    carry = ab + bc+ ac
    Initially the carry bit is set to be 0. This process is continue until all the bits in a binary number finish.

    Code Assumption

    The following code uses 8 – bit binary unsigned integer. This means each integer can hold from 0 to 255 in decimal. So user can add up to 255. If the result is greater than 255, then condition of overflow occurs. The code contains following segments
    • Decimal to Binary Conversion
    • Addition of two binary numbers
    • Binary to Decimal conversion
    Read more »
    fardi zayden
    @مرسلة بواسطة
    كاتب ومحرر اخبار اعمل في موقع دراسات تقنية .

    إرسال تعليق