Dpco Unit 1
Dpco Unit 1
E DPCO NOTES
UNIT 1
COMBINATIONAL LOGIC
INTRODUCTION
The digital system consists of two types of circuits, namely
(i) Combinational circuits
(ii) Sequential circuits
Combinational circuit consists of logic gates whose output at any time is
determined from the present combination of inputs. The logic gate is the most
basic building block of combinational logic. The logical function performed by
a combinational circuit is fully defined by a set of Boolean expressions.
Sequential logic circuit comprises both logic gates and the state of storage
elements such as flip-flops. As a consequence, the output of a sequential circuit
depends not only on present value of inputs but also on the past state of inputs.
In the previous chapter, we have discussed binary numbers, codes, Boolean
algebra and simplification of Boolean function and logic gates. In this chapter,
formulation and analysis of various systematic designs of combinational circuits
will be discussed.
A combinational circuit consists of input variables, logic gates, and output
variables. The logic gates accept signals from inputs and output signals are
generated according to the logic circuits employed in it. Binary information
from the given data transforms to desired output data in this process. Both input
and output are obviously the binary signals, i.e., both the input and output
signals are of two possible states, logic 1 and logic 0.
UNIT
1
J.N.N.I.E DPCO NOTES
DESIGN PROCEDURES
Any combinational circuit can be designed by the following steps of design
procedure.
1. The problem is stated.
UNIT
1
J.N.N.I.E DPCO NOTES
Solution:
Truth Table:
K-map Simplification:
Logic Diagram:
The combinational circuit can be drawn as,
ARITHMETIC CIRCUITS
In this section, we will discuss those combinational logic building blocks that can
be used to perform addition and subtraction operations on binary numbers.
Addition and subtraction are the two most commonly used arithmetic
operations, as the other two, namely multiplication and division, are
respectively the
UNIT
1
J.N.N.I.E DPCO NOTES
Truth Table:
K-map simplification:
Inputs Outputs
A B Sum Carr
(S) y (C)
The Boolean expressions for the SUM and 0 0 0 0
CARRY outputs are given by the equations, 0 1 1 0
1 0 1 0
1 1 0 1
The first one representing the SUM output is that of an EX-OR gate, the second
one representing the CARRY output is that of an AND gate.
The logic diagram of the half adder is,
UNIT
1
J.N.N.I.E DPCO NOTES
FULL-ADDER
A full adder is a combinational circuit that forms the arithmetic sum of three
input bits. It consists of three inputs and two outputs.
Two of the input variables, represent the significant bits to be added. The third
input represents the carry from previous lower significant position. The block
diagram of full adder is given by,
The full adder circuit overcomes the limitation of the half-adder, which can be
used to add two bits only. As there are three input variables, eight different
input combinations are possible.
Truth Table:
Inputs Outputs
A B Cin Sum Carry
(S) (Cout)
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
UNIT
1
J.N.N.I.E DPCO NOTES
1 1 0 0 1
1 1 1 1 1
K map
The
logic diagram of the full adder can also be implemented with two half-adders
and one OR gate. The S output from the second half adder is the exclusive-OR
of Cin and the output of the first half-adder, giving
UNIT
1
J.N.N.I.E DPCO NOTES
HALF -SUBTRACTOR
A half-subtractor is a combinational circuit that can be used to subtract one
binary digit from another to produce a DIFFERENCE output and a BORROW
output. The BORROW output here specifies whether a ‘1’ has been borrowed to
perform the subtraction.
UNIT
1
J.N.N.I.E DPCO NOTES
The truth table of half-subtractor, showing all possible input combinations and
the corresponding outputs are shown above
UNIT
1
J.N.N.I.E DPCO NOTES
Bo. The BORROW output bit tells whether the minuend bit needs to borrow a
‘1’ from the next possible higher minuend bit.
UNIT
1
J.N.N.I.E DPCO NOTES
4-BITBINARYPARALLELADDER
Since all the bits of augend and add end are fed into the adder circuits
simultaneously and the additions in each position are taking place at the same
time, this circuit is known as parallel adder.
Letthe4-bit words to be added be represented by,
The bits are added with full adders, starting from the least significant position,
to form the sum it and carry bit. The input carry C0 in the least significant
position must be 0. The carry output of the lower order stage is connected to the
carry input of the next higher order stage. Hence this type of adder is called
ripple-carry adder.
In the least significant stage, A0, B0 and C0 (which is 0) are added resulting in
sum S0 and carry C1. This carry C1 becomes the carry input to the second
stage. Similarly in the second stage, A1, B1 and C1 are added resulting in sum
S1 and carry C2, in the third stage, A2, B2 and C2 are added resulting in sum
S2 and carry C3, in the third stage, A3, B3 and C3 are added resulting in sum
S3 and C4, which is the output carry. Thus the circuit results in a sum (S3 S2 S1
S0) and a carry output (Cout).
UNIT
1
J.N.N.I.E DPCO NOTES
Though the parallel binary adder is said to generate its output immediately after
the inputs are applied, its speed of operation is limited by the carry propagation
delay through all stages. However, there are several methods to reduce this
delay. One of the methods of speeding up this process is look-ahead carry
addition which eliminates the ripple-carry delay.
In the least significant stage, A0, B0 and C0 (which is 0) are added resulting in
sum S0 and carry C1. This carry C1 becomes the carry input to the second
stage. Similarly in the second stage, A1, B1 and C1 are added resulting in sum
S1 and carry C2, in the third stage, A2, B2 and C2 are added resulting in sum
S2 and carry C3, in the third stage, A3, B3 and C3 are added resulting in sum
S3 and C4, which is the output carry. Thus the circuit results in a sum (S3 S2 S1
S0) and a carry output (Cout).
Though the parallel binary adder is said to generate its output immediately after
the inputs are applied, its speed of operation is limited by the carry propagation
delay through all stages. However, there are several methods to reduce this
delay. One of the methods of speeding up this process is look-ahead carry
addition which eliminates the ripple-carry delay.
CARRY LOOK AHEAD ADDER
In Parallel adder, all the bits of the augend and the addend are available for
computation at the same time. The carry output of each full-adder stage is
connected to the carry input of the next high-order stage. Since each bit of the
sum output depends on the value of the input carry, time delay occurs in the
addition process. This time delay is called as carry propagation delay.
For example, addition of two numbers (1111+ 1011) gives the result as 1010.
Addition of the LSB position produces a carry into the second position. This
carry when added to the bits of the second position, produces a carry into the
third position. This carry when added to bits of the third position, produces a
carry into the last position. The sum bit generated in the last position (MSB)
depends on the
UNIT
1
J.N.N.I.E DPCO NOTES
carry that was generated by the addition in the previous position. i.e., the adder
will not produce correct result until LSB carry has propagated through the
intermediate full-adders. This represents a time delay that depends on the
propagation delay produced in an each full-adder. For example, if each full
adder is considered to have a propagation delay of 8nsec, then S3 will not react
its correct value until 24 nsec after LSB is generated. Therefore total time
required to perform addition is 24+ 8 = 32nsec.
The method of speeding up this process by eliminating inter stage carry delay is
called look ahead-carry addition. This method utilizes logic gates to look at
the lower order bits of the augend and addend to see if a higher-order carry is to
be generated. It uses two functions: carry generate and carry propagate.
Consider the circuit of the full-adder shown above. Here we define two
functions: carry generate (Gi) and carry propagate (Pi) as,
UNIT
1
J.N.N.I.E DPCO NOTES
Note that C3 does not have to wait for C2 and C1 to propagate; in fact C3 is
propagated at the same time as C1 and C2.
Using a Look-ahead Generator we can easily construct a 4-bit parallel adder
with a Look-ahead carry scheme. Each sum output requires two exclusive-OR
gates. The output of the first exclusive-OR gate generates the Pi variable, and
the AND gate generates the Gi variable. The carries are propagated through the
carry look- ahead generator and applied as inputs to the second exclusive-OR
gate. All output carries are generated after a delay through two levels of gates.
Thus, outputs S1 through S3 have equal propagation delay times.
UNIT
1
J.N.N.I.E DPCO NOTES
The addition and subtraction operation can be combined into one circuit with
one common binary adder. This is done by including an exclusive-OR gate with
each full adder. A 4-bit adder Subtractor circuit is shown below.
UNIT
1
J.N.N.I.E DPCO NOTES
The mode input M controls the operation. When M= 0, the circuit is an adder
and when M=1, the circuit becomes a Subtractor. Each exclusive-OR gate
receives input M and one of the inputs of B. When M=0, we have B 0= B. The
full adders receive the value of B, the input carry is 0, and the circuit performs
A plus B. When M=1, we have B 1= B’ and C0=1. The B inputs are all
complemented and a 1 is added through the input carry. The circuit performs the
operation A plus the 2’s complement of B. The exclusive-OR with output V is
for detecting an overflow.
The digital system handles the decimal number in the form of binary coded
decimal numbers (BCD). A BCD adder is a circuit that adds two BCD bits and
produces a sum digit also in BCD.
Consider the arithmetic addition of two decimal digits in BCD, together with an
input carry from a previous stage. Since each input digit does not exceed 9, the
output sum cannot be greater than 9+ 9+1 = 19; the 1 is the sum being an input
carry. The adder will form the sum in binary and produce a result that ranges
from 0 through 19.
These binary numbers are labeled by symbols C, S3, S2, S1, S0, C is the carry.
The columns under the binary sum list the binary values that appear in the
outputs
of the 4-bit binary adder. The output sum of the two decimal digits must be
represented in BCD.
UNIT
1
J.N.N.I.E DPCO NOTES
and
• One more 4-bit adder to add 6 (0110)2 with the sum of the first 4-bit adder, if
the sum is greater than 9 or carry is 1.
The logic circuit to detect sum greater than 9 can be determined by simplifying
the Boolean expression of the given truth table.
The two decimal digits, together with the input carry, are first added in the top4-
bit binary adder to provide the binary sum. When the output carry is equal to
zero, nothing is added to the binary sum. When it is equal to one, binary
(0110)2 is added to the binary sum through the bottom 4-bit adder.
UNIT
1
J.N.N.I.E DPCO NOTES
The output carry generated from the bottom adder can be ignored, since it
supplies information already available at the output carry terminal. The output
carry from one stage must be connected to the input carry of the next higher-
order stage
UNIT
1
J.N.N.I.E DPCO NOTES
The multiplexer acts like an electronic switch that selects one of the two
sources.
UNIT
1
J.N.N.I.E DPCO NOTES
Truth table:
S Y
0 I0
1 I1
4-to-1-line Multiplexer
A 4-to-1-line multiplexer has four (2n) input lines, two (n) select lines and one
output line. It is the multiplexer consisting of four input channels and
information of one of the channels can be selected and transmitted to an output
line according to the select inputs combinations. Selection of one of the four
input channel is possible by two selection inputs.
Each of the four inputs I0 through I3, is applied to one input of AND gate.
Selection lines S1 and S0 are decoded to select a particular AND gate. The
outputs of the AND gate are applied to a single OR gate that provides the 1-line
output
Function table:
S1 S0 Y
0 0 I0
0 1 I1
UNIT
1
J.N.N.I.E DPCO NOTES
1 0 I2
1 1 I3
To demonstrate the circuit operation, consider the case when S1S0= 10. The
AND gate associated with input I2 has two of its inputs equal to 1 and the third
input connected to I2.
The other three AND gates have at least one input equal to 0, which makes their
outputs equal to 0. The OR output is now equal to the value of I2, providing a
path from the selected input to the output.
The data output is equal to I0 only if S1= 0 and S0= 0; Y= I0S1’S0’.
The data output is equal to I1 only if S1= 0 and S0= 1; Y= I1S1’S0.
The data output is equal to I2 only if S1= 1 and S0= 0; Y= I2S1S0’.
The data output is equal to I3 only if S1= 1 and S0= 1; Y= I3S1S0.
When these terms are ORed, the total expression for the data output is,
Y= I0S1’S0’+ I1S1’S0 +I2S1S0’+ I3S1S0.
As in decoder, multiplexers may have an enable input to control the operation of
the unit.
When the enable input is in the inactive state, the outputs are disabled, and when
it is in the active state, the circuit functions as a normal multiplexer
UNIT
1
J.N.N.I.E DPCO NOTES
This circuit has four multiplexers, each capable of selecting one of two input
lines. Output Y0 can be selected to come from either A0 or B0. Similarly,
output Y1 may have the value of A1 or B1, and so on. Input selection line, S
selects one of the lines in each of the four multiplexers. The enable input E must
be active for normal operation.
Although the circuit contains four 2-to-1-Line multiplexers, it is viewed as a
circuit that selects one of two 4-bit sets of data lines. The unit is enabled when
E= 0. Then if S= 0, the four A inputs have a path to the four outputs. On the
other hand, if S=1, the four B inputs are applied to the outputs. The outputs have
all 0’s when E= 1, regardless of the value of S.
Application:
1. They are used as a data selector to select out of many data inputs.
UNIT
1
J.N.N.I.E DPCO NOTES
ii ii. List under them all the minterms in two rows as shown below.
The first half of the minterms is associated with A’ and the second half with A.
The given function is implemented by circling the minterms of the function and
applying the following rules to find the values for the inputs of the multiplexer.
1. If both the minterms in the column are not circled, apply 0 to the
corresponding input.
2. If both the minterms in the column are circled, apply 1 to the corresponding
input.
3. If the bottom minterm is circled and the top is not circled, apply C to the
input.
4. If the top minterm is circled and the bottom is not circled, apply C’ to the
input.
UNIT
1
J.N.N.I.E DPCO NOTES
Multiplexer Implementation:
2. Implement the Boolean function using 8: 1 and also using 4:1 multiplexer
F (A, B, C, D) = Σm (0, 1, 2, 4, 6, 9, 12, 14)
Solution:
Variables, n= 4 (A, B, C, D) Select
lines= n-1 = 3 (S2, S1, S0)
2n-1 to MUX i.e., 23 to 1 = 8 to 1 MUX
Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
UNIT
1
J.N.N.I.E DPCO NOTES
UNIT
1
J.N.N.I.E DPCO NOTES
Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
DEMULTIPLEXER
UNIT
1
J.N.N.I.E DPCO NOTES
The input variable Din has a path to all four outputs, but the input information is
directed to only one of the output lines. The truth table of the 1-to-4
demultiplexer is shown below.
Enabl S1 S0 Din Y0 Y1 Y2 Y3
e
0 x x x 0 0 0 0
1 0 0 0 0 0 0 0
1 0 0 1 1 0 0 0
1 0 1 0 0 0 0 0
1 0 1 1 0 1 0 0
1 1 0 0 0 0 0 0
1 1 0 1 0 0 1 0
1 1 1 0 0 0 0 0
1 1 1 1 0 0 0 1
From the truth table, it is clear that the data input, Din is connected to the output
Y0, when S1= 0 and S0= 0 and the data input is connected to output Y1 when
S1= 0 and S0= 1. Similarly, the data input is connected to output Y2 and Y3
when S1= 1 and S0= 0 and when S1= 1 and S0= 1, respectively. Also, from the
truth table, the expression for outputs can be written as follows,
UNIT
1
J.N.N.I.E DPCO NOTES
Y0= S1’S0’Din
Y1= S1’S0Din
Y2= S1S0’Din
Y3= S1S0Din
1- to-8 Demultiplexer
S3 S2 S1 S0 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
0 x x x 0 0 0 0 0 0 0 0
UNIT
1
J.N.N.I.E DPCO NOTES
1 0 0 0 0 0 0 0 0 0 0 1
1 0 0 1 0 0 0 0 0 0 1 0
1 0 1 0 0 0 0 0 0 1 0 0
1 0 1 1 0 0 0 0 1 0 0 0
1 1 0 0 0 0 0 1 0 0 0 0
1 1 0 1 0 0 1 0 0 0 0 0
1 1 1 0 0 1 0 0 0 0 0 0
1 1 1 1 1 0 0 0 0 0 0 0
A 1-to-8 demultiplexer has a single input, Din, eight outputs (Y0 to Y7) and
three select inputs (S2, S1 and S0). It distributes one input line to eight output
lines based on the select inputs. The truth table of 1-to-8 demultiplexer is shown
below. Din
Now using the above expressions, the logic diagram of a 1-to-8 demultiplexer
can be drawn as shown below. Here, the single data line, Din is connected to all
the eight AND gates, but only one of the eight AND gates will be enabled by
the select input lines. For example, if S2S1S0= 000, then only AND gate-0 will
be enabled and thereby the data input, Din will appear at Y0. Similarly, the
different combinations of the select inputs, the input Din will appear at the
respective output.
UNIT
1
J.N.N.I.E DPCO NOTES
UNIT
1
J.N.N.I.E DPCO NOTES
Applications:
1. It can be used as a decoder
DECODERS
UNIT
1
J.N.N.I.E DPCO NOTES
Inputs Outputs
UNIT
1
J.N.N.I.E DPCO NOTES
Ena A B Y3 Y2 Y1 Y0
ble
0 x x 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
As shown in the truth table, if enable input is 1 (EN= 1) only one of the outputs
(Y0 – Y3), is active for a given input.
The output Y0 is active, ie., Y0= 1 when inputs A= B= 0,
Y1 is active when inputs, A= 0 and B= 1,
Y2 is active, when input A= 1 and B= 0,
Y3 is active, when inputs A= B= 1.
The output variables are mutually exclusive because only one output can be
equal to 1 at any one time.
The output line whose value is equal to 1 represents the minterm equivalent of
the binary number presently available in the input lines.
Inputs Outputs
A B C Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0 1 0 0 0 0 0 0 0
UNIT
1
J.N.N.I.E DPCO NOTES
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
UNIT
1
J.N.N.I.E DPCO NOTES
Each segment is made up of a material that emits light when current is passed
through it. The segments activated during each digit display are tabulated as
Truth table:
UNIT
1
J.N.N.I.E DPCO NOTES
2 0 0 1 0 1 1 0 1 1 0 1
3 0 0 1 1 1 1 1 1 0 0 1
4 0 1 0 0 0 1 1 0 0 1 1
5 0 1 0 1 1 0 1 1 0 1 1
6 0 1 1 0 1 0 1 1 1 1 1
7 0 1 1 1 1 1 1 0 0 0 0
8 1 0 0 0 1 1 1 1 1 1 1
9 1 0 0 1 1 1 1 1 0 1 1
UNIT
1
J.N.N.I.E DPCO NOTES
Applications of decoders:
1. Decoders are used in counter system.
4. Address decoding
6. Code converters
ENCODERS
An encoder is a digital circuit that performs the inverse operation of a decoder.
Hence, the opposite of the decoding process is called encoding. An encoder is a
UNIT
1
J.N.N.I.E DPCO NOTES
It has 2n input lines, only one which 1 is active at any time and ‘n’ output lines.
It encodes one of the active inputs to a coded binary output with ‘n’ bits. In an
encoder, the number of outputs is less than the number of inputs.
Octal-to-Binary Encoder
It has eight inputs (one for each of the octal digits) and the three outputs that
generate the corresponding binary number. It is assumed that only one input has
a value of 1 at any given time.
The encoder can be implemented with OR gates whose inputs are determined
directly from the truth table. Output z is equal to 1, when the input octal digit is
1 or 3 or 5 or 7. Output y is 1 for octal digits 2, 3, 6, or 7 and the output is 1 for
digits 4, 5, 6 or 7.
Inputs Outputs
D0 D1 D2 D3 D4 D5 D6 D7 A B C
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
UNIT
1
J.N.N.I.E DPCO NOTES
0 0 0 0 0 0 0 1 1 1 1
These conditions can be expressed by the following output Boolean functions:
z= D1+ D3+ D5+ D7
y= D2+ D3+ D6+ D7
x= D4+ D5+ D6+ D7
The encoder can be implemented with three OR gates. The encoder defined in
the below table, has the limitation that only one input can be active at any given
time. If two inputs are active simultaneously, output produces an undefined
combination.
For eg., if D3 and D6 are 1 simultaneously, the output of the encoder may be
111. This does not represent either D6 or D3. To resolve this problem, encoder
circuits must establish an input priority to ensure that only one input is encoded.
If we establish a higher priority for inputs with higher subscript numbers and if
D3 and D6 are 1 at the same time, the output will be 110 because D6 has higher
priority than D3.
Octal-to-Binary Encoder
Another problem in the octal-to-binary encoder is that an output with all 0’s is
generated when all the inputs are 0; this output is same as when D0 is equal to
1. The discrepancy can be resolved by providing one more output to indicate
that atleast one input is equal to 1.
Priority Encoder
A priority encoder is an encoder circuit that includes the priority function. In
priority encoder, if two or more inputs are equal to 1 at the same time, the input
having the highest priority will take precedence.
In addition to the two outputs x and y, the circuit has a third output, V (valid bit
indicator). It is set to 1 when one or more inputs are equal to 1. If all inputs are
0, there is no valid input and V is equal to 0.
Another problem in the octal-to-binary encoder is that an output with all 0’s is
generated when all the inputs are 0; this output is same as when D0 is equal to
1.
UNIT
1
J.N.N.I.E DPCO NOTES
The discrepancy can be resolved by providing one more output to indicate that
atleast one input is equal to 1.
Priority Encoder
A priority encoder is an encoder circuit that includes the priority function. In
priority encoder, if two or more inputs are equal to 1 at the same time, the input
having the highest priority will take precedence.
In addition to the two outputs x and y, the circuit has a third output, V (valid bit
indicator). It is set to 1 when one or more inputs are equal to 1. If all inputs are
0, there is no valid input and V is equal to 0. The higher the subscript number,
higher the priority of the input. Input D3, has the highest priority. So, regardless
of the values of the other inputs, when D3 is 1, the output for xy is 11.
D2 has the next priority level. The output is 10, if D2= 1 provided D3= 0. The
output for D1 is generated only if higher priority inputs are 0, and so on down
the priority levels.
Inputs Outputs
D0 D1 D2 D3 x y V
0 0 0 0 x x 0
1 0 0 0 0 0 1
x 1 0 0 0 1 1
x x 1 0 1 0 1
x x x 1 1 1 1
Although the above table has only five rows, when each don’t care condition is
replaced first by 0 and then by 1, we obtain all 16 possible input combinations.
For example, the third row in the table with X100 represents minterms 0100 and
1100. The don’t care condition is replaced by 0 and 1 as shown in the table
below. Modified Truth table:
UNIT
1
J.N.N.I.E DPCO NOTES
Inputs Outputs
D0 D1 D2 D3 x y V
0 0 0 0 x x 0
1 0 0 0 0 0 1
0 1 0 0 0 1 1
1 1 0 0
0 0 1 0 1 0 1
0 1 1 0
1 0 1 0
1 1 1 0
0 0 0 1 1 1 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
UNIT
1
J.N.N.I.E DPCO NOTES
MAGNITUDE COMPARATOR
A magnitude comparator is a combinational circuit that compares two given
numbers (A and B) and determines whether one is equal to, less than or greater
than the other. The output is in the form of three binary variables representing
the conditions A = B, A>B and A<B, if A and B are the two numbers being
compared.
For comparison of two n-bit numbers, the classical method to achieve the
Boolean expressions requires a truth table of 22n entries and becomes too
lengthy and cumbersome.
Inputs Outputs
A1 A0 B1 B0 A>B A=B A<B
UNIT
1
J.N.N.I.E DPCO NOTES
0 0 0 0 0 1 0
0 0 0 1 0 0 1
0 0 1 0 0 0 1
0 0 1 1 0 0 1
0 1 0 0 1 0 0
0 1 0 1 0 1 0
0 1 1 0 0 0 1
0 1 1 1 0 0 1
1 0 0 0 1 0 0
1 0 0 1 1 0 0
1 0 1 0 0 1 0
1 0 1 1 0 0 1
1 1 0 0 1 0 0
1 1 0 1 1 0 0
1 1 1 0 1 0 0
1 1 1 1 0 1 0
UNIT
1
J.N.N.I.E DPCO NOTES
UNIT
1
J.N.N.I.E DPCO NOTES
where, Xi =1 only if the pair of bits in position i are equal (ie., if both are 1 or
both are 0).
To satisfy the equality condition of two numbers A and B, it is necessary that all
Xi must be equal to logic 1. This indicates the AND operation of all Xi
variables. In other words, we can write the Boolean expression for two equal 4-
bit numbers. (A = B) = X3X2X1 X0.
The binary variable (A=B) is equal to 1 only if all pairs of digits of the two
numbers are equal.
To determine if A is greater than or less than B, we inspect the relative
magnitudes of pairs of significant bits starting from the most significant bit. If
the two digits of the most significant position are equal, the next significant pair
of digits is compared. The comparison process is continued until a pair of
unequal digits is found. It may be concluded that A>B, if the corresponding
digit of A is 1 and B is 0. If the corresponding digit of A is 0 and B is 1, we
conclude that A<B. Therefore, we can derive the logical expression of such
sequential comparison by the following two Boolean functions,
(A>B) = A3B3′ +X3A2B2′ +X3X2A1B1′ +X3X2X1A0B0′
(A<B) = A3′B3 +X3A2′B2 +X3X2A1′B1 +X3X2X1A0′B0
The symbols (A>B) and (A<B) are binary output variables that are equal to 1
when A>B or A<B, respectively.
UNIT
1
J.N.N.I.E DPCO NOTES
The gate implementation of the three output variables just derived is simpler
than it seems because it involves a certain amount of repetition. The unequal
outputs can use the same gates that are needed to generate the equal output. The
logic diagram of the 4-bit magnitude comparator is shown below,
The four x outputs are generated with exclusive-NOR circuits and applied to an
AND gate to give the binary output variable (A=B). The other two outputs use
the x variables to generate the Boolean functions listed above. This is a
multilevel implementation and has a regular pattern
UNIT
1