[go: up one dir, main page]

0% found this document useful (0 votes)
158 views7 pages

Digital Design LAB Lab 5 Adder Subtractor

This document discusses various digital logic circuits used for addition and subtraction. It describes half adders, full adders, half subtractors, full subtractors, and how to build multi-bit adders and adder/subtractors using these basic building blocks. The key circuits covered are the half adder, full adder, half subtractor, full subtractor, 4-bit ripple carry adder, and an adder/subtractor circuit. Applications include using adders for address calculation and performing both addition and subtraction with one circuit.

Uploaded by

Walied Farghaly
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views7 pages

Digital Design LAB Lab 5 Adder Subtractor

This document discusses various digital logic circuits used for addition and subtraction. It describes half adders, full adders, half subtractors, full subtractors, and how to build multi-bit adders and adder/subtractors using these basic building blocks. The key circuits covered are the half adder, full adder, half subtractor, full subtractor, 4-bit ripple carry adder, and an adder/subtractor circuit. Applications include using adders for address calculation and performing both addition and subtraction with one circuit.

Uploaded by

Walied Farghaly
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering Fall 2011 ECOM 4113: Digital Design LAB

Eng. Ahmed Abumarasa

Digital Design LAB Lab 5 ADDER SUBTRACTOR

Introduction:
In electronics, an adder or summer is a digital circuit that performs addition of numbers. In many computers and other kinds of processors, adders are used not only in the arithmetic logic unit(s), but also in other parts of the processor, where they are used to calculate addresses, table indices, and similar.

Half Adder:
A half adder adds two one-bit binary numbers A and B. It has two outputs, S and C (the value theoretically carried on to the next addition); the final sum is 2C + S. The simplest halfadder design, pictured on the right, incorporates an XOR gate for S and an AND gate for C. Half adders cannot be used compositely, given their incapacity for a carry-in bit.

A 0 0 1 1

input B 0 1 0 1

S 0 1 1 0

Output C 0 0 0 1

S = A xor B. C = A.B

Full Adder:
A full adder adds binary numbers and accounts for values carried in as well as out. A one-bit full adder adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands, and Cin is a bit carried in (in theory from a past addition). The circuit produces a two-bit output sum typically represented by the signals Cout and S, where . The one-bit full adder's truth table is: input A 0 0 0 0 1 1 1 1 S = A xor B xor Cin. Cout = A.B + A.Cin + B.Cin = (A xor B).Cin + A.Cin B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 S 0 1 1 0 1 0 0 1 output Cout 0 0 0 1 0 1 1 1

Half subtractor :
The half-subtractor is a combinational circuit which is used to perform subtraction of two bits. It has two inputs, X (minuend) and Y (subtrahend) and two outputs D (difference) and B (borrow). input Y 0 1 0 1 Output B 0 1 0 0

X 0 0 1 1

D 0 1 1 0

D = X xor Y. B = X.Y

Full subtractor :
The full-subtractor is a combinational circuit which is used to perform subtraction of three bits. It has three inputs, X (minuend) and Y (subtrahend) and Z (subtrahend) and two outputs D (difference) and B (borrow). D = X- Y- Z. B = 1 if (X < y+ z) input X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 D 0 1 1 0 1 0 0 1 output B 0 1 1 1 0 0 0 1

D = X xor Y xor Z. B = Z.( X xnor Y) + X.Y

4-bit Adder:
It is possible to create a logical circuit using multiple full adders to add N-bit numbers. Each full adder inputs a Cin, which is the Cout of the previous adder. This kind of adder is a ripple carry adder, since each carry bit "ripples" to the next full adder. Note that the first (and only the first) full adder may be replaced by a half adder.

Adder-Subtractor:
In digital circuits, an addersubtractor is a circuit that is capable of adding or subtracting numbers (in particular, binary). Below is a circuit that does adding or subtracting depending on a control signal. It is also possible to construct a circuit that performs both addition and subtraction at the same time.

M: controller, adding when M=0 and Subtracting when M=1. Adding: A+B. Sub: A-B.

V: overflow flag, denote that an overflow happened when V=1.

Lab work:
Implement the four circuit (half and full adder and subtractor). Implement the 4-bit adder-subtractor.

You might also like