Docsity

Binary Adder-Subtractor, Lecture notes of Computer Architecture and Organization

Toggle sidebar
bg1
Objectives:
1. Half Adder.
2. Full Adder.
3. Binary Adder.
4. Binary Subtractor.
5. Binary Adder-Subtractor.
1. Half Adder
Half Adder: is a combinational circuit that performs the addition of two bits,
this circuit needs two binary inputs and two binary outputs.
The simplified Boolean function from the truth
table:
(Using sum of product form)
Where is the sum and is the carry.
(Using XOR and AND Gates)
Inputs
Outputs
0
0
0
0
0
1
0
1
1
0
0
1
1
1
1
0
Truth table
X
Y
Y
S
C
Implementation of Half Adder using equation (1)
X
Y
S
C
Implementation of Half Adder using equation (2)
pf3
pf4
pf5
pf8

Partial preview of the text

Download Binary Adder-Subtractor and more Lecture notes Computer Architecture and Organization in PDF only on Docsity!

Objectives:

**1. Half Adder.

  1. Full Adder.
  2. Binary Adder.
  3. Binary Subtractor.
  4. Binary Adder-Subtractor.** 1. Half Adder

Half Adder : is a combinational circuit that performs the addition of two bits, this circuit needs two binary inputs and two binary outputs.

The simplified Boolean function from the truth table:

(Using sum of product form)

Where is the sum and is the carry.

(Using XOR and AND Gates)

Inputs Outputs

0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 Truth table

X (^) X (^) Y Y

S

C

Implementation of Half Adder using equation (1)

X (^) Y

S

C

Implementation of Half Adder using equation (2)

 The implementation of half adder using exclusive–OR and an AND gates is used to show that two half adders can be used to construct a full adder.  The inputs to the XOR gate are also the inputs to the AND gate.

2. Full Adder

Full Adder is a combinational circuit that performs the addition of three bits (two significant bits and previous carry).

 It consists of three inputs and two outputs , two inputs are the bits to be added, the third input represents the carry form the previous position.  The full adder is usually a component in a cascade of adders, which add 8, 16, etc, binary numbers.

 The output is equal to 1 when

only one input is equal to 1 or when all

three inputs are equal to 1.

 The output has a carry 1 if

two or three inputs are equal to 1.

 The Karnaugh maps and the simplified expression are shown in the following figures:

(Sum of products)

Inputs Outputs

0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Truth table for the full adder

0 1

1 0

0 1

1 0

X in

YC

0

1

(^00 01 11 )

S  XYCin  XYCin  XYCin  XYC in

0 0

0 1

1 0

1 1

X in

YC

0

1

(^00 01 11 )

C (^) outXYXCinYC in

3. Binary Adder (Asynchronous Ripple-Carry Adder)  A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers.  A binary adder can be constructed with full adders connected in cascade with the output carry form each full adder connected to the input carry of the next full adder in the chain.  The four-bit adder is a typical example of a standard component .It can be used in many application involving arithmetic operations.

 The input carry to the adder is and it ripples through the full adders to the output carry.  -bit binary adder requires full adders.

X (^) Y

XY

XY

S

C in

C out

 X  Y   Cin

XYCinXY

First Half Adder Second Half Adder

Implementation of Full Adder with two Half Adders and an OR gate

C 0

B 0^ A 0

S 0

C 1

B 1 A 1

S 1

C 2

B 2 A 2

S 2

C 3

B 3 A 3

S 3 Four-bit Adder (Ripple Carry Adder)

C 4

Example:

and

Subscript 3 2 1 0 Input Carry 0 1 1 0

+^1 0 1 0 0 1 1 Sum 1 1 1 0 Output Carry 0 0 1 1

Carry Propagation

 The addition of binary numbers in parallel implies that all the bits of and are available for computation at the same time.  As in any combinational circuit, the signal must propagate through the gates before the correct output sum is available.  The output will not be correct unless the signals are given enough time to propagate through the gates connected form the input to the output.  The longest propagation delay time in an adder is the time it takes the carry to propagate through the full adders.

 The signal form the carry input to the output carry propagates through an AND gate and an OR gate, which equals 2 gate levels. o If there are 4 full adders in the binary adder, the output carry would have 2×4=8 gate levels , form to o For an -bit adder, gate levels for the carry to propagate form input to output are required.

Ai B i

P i

G i

S i

C (^) i

Ci  1

PiC i

Pi CiG i

Full Adder with P and G

 The construction of a four-bit adder with a carry lookahead scheme is the

Logic Diagram for Carry Lookahead Generator Carry Lookahead

 - C 0 P 0 G 0 P 1 G 1 P 2 G following: - C - C - C 
  • B Generator
    • A - P four-bit adder with a carry lookahead scheme - G
  • B
  • A 2 P - G
  • B
    • A 1 P - G
    • B
      • A - P - G
        • C - C - S - S - S - S - C - C - C - C - C - P - P - P - P

4. Binary Subtractor  To perform the subtraction , we can use the 2's complements , so the subtraction can be converted to addition.  2's complement can be obtained by talking the 1’s complement and adding 1 to the LSD bit.

  1. 1’s complement can be implemented with inventors.
  2. 1 can be added to the sum through the input carry.  The circuit for subtracting consists of an adder with inverters placed between each data input and the corresponding input of the full adder.

The input carry must be equal to 1.

5. Binary Adder–Subtractor  The addition and subtraction operations can be combined into one circuit

with one common binary adder by including an exclusive-OR gate with

each full-adder.

The mode input controls the operation as the following:

o ( →adder. o → subtractor.

 Each XOR gate receives signal and

o When then and the carry = 0, then the circuit performs the operation. o When then and the carry = 1, then the circuit performs the operation.

 The exclusive-OR with output is for detecting an overflow.