Professional Documents
Culture Documents
Lecture 4 - Chapter 4 - Part A
Lecture 4 - Chapter 4 - Part A
Lecture 4 - Chapter 4 - Part A
For n input variables, there are For each possible input combination,
2𝑛 possible binary combinations. there is one possible output value.
2 3
Logic Diagram
𝐴0 𝐵0
𝐴0 is Augend
𝐶1 HA
𝐵0 is Addend
𝑆0 is Sum
𝐶1 is Output carry
𝑆0
Nermin Salem ELE 215 - L4 Block Diagram 11
Addend Carry from previous
Augend
operation
Full Adder 𝑥 𝑦
𝐶1 FA 𝑧
𝑆0
Logic Diagram Block Diagram
Nermin Salem ELE 215 - L4 12
Binary Adder
A binary adder is a digital circuit that produces the arithmetic sum of
two binary numbers. It can be constructed with full adders connected in
cascade, with the output carry from each full adder connected to the
input carry of the next full adder in the chain.
When M = 0,
the circuit is an
adder.
when M = 1, the
circuit becomes a
subtractor.
• An overflow V cannot occur after an addition if one number is positive and the other is negative.
• An overflow may occur if the two numbers added are both positive or both negative.
• An overflow condition can be detected by observing the carry into the sign bit position and the carry out of the sign bit position.
• These two carries are not equal, an overflow has occurred. This is indicated in the examples in which the two carries are explicitly shown.
• If the two carries are applied to an exclusive-OR gate, an overflow is detected when the output of the gate is equal to 1.
Nermin Salem ELE 215 - L4 17
Decimal Adder – BCD Adder
• When the binary sum is equal to or less
than 1001, the corresponding BCD
number is identical, and therefore no
conversion is needed.
• When the binary sum is greater than 1001,
we obtain an invalid BCD representation.
The addition of binary 6 (0110) to the
binary sum converts it to the correct BCD
representation and produces an output
carry as required.
• K is an output carry
• The condition for a correction and an
output carry can be expressed by the
Boolean function:
𝐶 = 𝐾 + 𝑍8 𝑍4 + 𝑍8 𝑍2
Nermin Salem
ELE 215 - L4 21
Magnitude Comparator
A magnitude comparator is a combinational circuit that compares two numbers A and
B and determines their relative magnitudes. The outcome of the comparison is
specified by three binary variables that indicate:
A>B,A=B,A<B
Consider two numbers, A and B , with four digits each. Write the coefficients of the
numbers in descending order of significance:
𝐴 = 𝐴3 𝐴2 𝐴1 𝐴0 𝐵 = 𝐵3 𝐵2 𝐵1 𝐵0
• For equality to exist, all 𝑥𝑖 variables must be equal to 1, a condition that dictates an
AND operation of all variables: (𝐴 = 𝐵) = 𝑥3 𝑥2 𝑥1 𝑥0
• To determine whether A is greater or less than B , we inspect the relative magnitudes of
pairs of significant digits, starting from the most significant position. If the two digits of a
pair are equal, we compare the next lower significant pair of digits. The comparison
continues until a pair of unequal digits is reached. If the corresponding digit of A is 1 and
that of B is 0, we conclude that A > B. If the corresponding digit of A is 0 and that of B is 1,
we have A < B: