Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Architecture

Similar presentations


Presentation on theme: "Computer Architecture"— Presentation transcript:

1 Computer Architecture
Binary Addition Computer Architecture

2 Review of Addition Addition of decimal numbers
Proceeds from lowest to highest powers That is from left to right Each digit is added If result is below 10, the digit is written as is If the result is above 9, it is broken into two parts Sum: Digit which results from adding the numbers Carry: Digit for use in the next higher power column.

3 Example Add 7810 with 9910 1 1 7 8 + 9 9 1 7 7

4 Binary Addition Proceeds in a similar fashion as conventional addition
Bits are added from right to left Sum is 1 or 0 Carry is 1 or 0 Results from addition of bits is illustrated in the adjacent truth table. A B Cin Sum Cout 1

5 Binary Addition: Example 1
Add to 11012 1 1 1 1 1 1 1 + 1 1 1 1 1

6 Logic Circuit to add 2 Bits: Half Adder
Truth table for sum & carry bits are as follows. Given the truth table Sum = A + B Cout = A • B A B Sum Cout 1 A Half Adder Sum = A + B B Carry = A • B

7 Logic Circuit to add 3 bits: Full Adder
Refer to truth table shown earlier Sum = A + B + C Carry = (A•B) + (B•C) + (C•A) Full Adder A B Sum C Carry AB BC CA A B

8 This bit is typically called the Overflow bit!
Ripple Carry Adder Several full adder’s can be cascaded to add multiple-bits! Circuit reflects the way binary numbers are added The following circuit adds 2 3-bit binary numbers namely A2A1A0 and B2B1B0 to yield result C3C2C1C0 FA2 A2 FA1 A1 FA0 A0 B2 B1 B0 This bit is typically called the Overflow bit! C3 C2 C1 C0

9 Ripple Carry Adder To add 2 n-bit numbers you need n Full Adders
First carry to the circuit is 0 A half adder could be used here instead Each carry-out (except the last) is fed to the carry-in of the next stage Note that inputs are organized from lowest to highest power of 2 Circuit generates n+1 bits as result of addition Last carry (highest power) is called an overflow bit Because it does not fit in n-bits (which is typically what is expected to happen in these circuits). If a carry is present in the n+1th bit it is called an overflow condition! Microprocessors typically provide a mechanism to detect overflows!


Download ppt "Computer Architecture"

Similar presentations


Ads by Google