UNIT-II COMBINATIONAL LOGIC
Two Marks
1. What are combinational circuits?
A combinational circuit consists of input variables, logic gates and output
variables. It consists of logic gates whose output at any time are determined from
the present combination of inputs.
Examples: Adders, Subtractors, encoder, decoder, multiplexers, demultiplexers,
comparators, code converters, parity checker and parity generator.
2. Define Adder.
An adder is a digital circuit that performs addition of numbers. Adders can be
constructed for many numerical representations such as binary-coded decimal or
excess-3, the most common adders operate on binary numbers
3. Define Half adder.
A combinational circuit that performs the addition of two bits is called a half
adder. A half adder has two inputs (A and B) and two outputs (Sum and carry).
4. Write the truth table of Half adder.
Inputs Outputs
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
5. Define Full adder.
A combinational circuit that performs the addition of three bits is called a full
adder. A full adder has three inputs (A,B and Cin) and two outputs (Sum and Cout).
6. Write the truth table of Full adder.
Inputs Outputs
A B Cin Sum 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
1 1 0 0 1
1 1 1 1 1
7. Define Subtractor.
Subtractor circuits take two binary numbers as input and subtract one binary
number input from the other binary number input. It gives two outputs, difference
and borrow.
8. Define Half subtractor.
The half subtractor is a combinational circuit which is used to perform subtraction
of two bits. It has two inputs [A(minuend) and B(subtrahend)] and two outputs
[D(difference) and B (Borrow)].
9. Write the truth table of half subtractor.
Inputs Outputs
A B Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
10. Define Full subtractor.
The full subtractor is a combinational circuit which is used to perform subtraction
of three bits. It has three inputs [A(minuend), B(subtrahend) and C(borrow-in)]
and two outputs [D(difference) and B (Borrow)].
11. Write the truth table of full subtractor.
Inputs Outputs
A B C Difference Borrow
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
12. Define 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 whether A>B, A=B or A<B.
13. Define BCD adder.
A BCD adder is a circuit that adds two BCD digits in parallel and produces a sum
digit also in BCD.
14. Define encoder.
An encoder is a device used to change a signal or data into a code. The code may
serve any of a number of purposes such as compressing information for
transmission or storage. An encoder consist of 2n inputs and n outputs.
15. Write the truth table of 4:2 encoder
Inputs Outputs
D0 D1 D2 D3 X Y
1 0 0 0 0 0
0 1 0 0 0 1
0 0 1 0 1 0
0 0 0 1 1 1
16. Write the truth table of 8:3 encoder
Inputs Outputs
D0 D1 D2 D3 D4 D5 D6 D7 X Y Z
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
0 0 0 0 0 0 0 1 1 1 1
17. Define priority encoder.
A priority encoder is such that if two or more inputs are given at the same time,
the input having the highest priority will take precedence.
18. Define decoder.
It is a combinational circuit which converts binary information from n input lines
to maximum of 2n unique output lines. Decoders have many applications from
producing system alerts in alarm systems to performing the task of driving
multiple devices in microprocessor systems.
19. Write the truth table of 2:4 decoder
Inputs Outputs
X Y D0 D1 D2 D3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
20. Write the truth table of 3:8 decoder
Inputs Outputs
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
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
21. Define code converter.
A code converter is a combinational circuit that makes a two system compatible
even though each was a different binary code.
Types:
BCD to Excess 3 code converter Excess 3 to BCD code converter
Binary to Gray code converter Binary to BCD code converter
Gray to Binary code converter BCD to Gray code converter
22. Define Multiplexer.
It is a combinational circuit that selects one of many input signals and outputs that
into a single line. It is also known as data selector. A multiplexer of 2n input lines
has n select bits, which are used to select which input line to send to the output. It
consists of 2n inputs, n selection lines and single output.
23. Give the application of multiplexer.
It is used as a data selector to select one out of many data inputs.
It is used for simplification of logic design.
In designing the combinational circuits.
Parallel to serial conversion.
Logic function generation.
Data routing.
24. Write the truth table of 2×1 MUX
S Y
0 D0
1 D1
D0, D1 Input lines S Selection line Y Output line
25. Write the truth table of 4×1 MUX
S1 S0 Y
0 0 D0
0 1 D1
1 0 D2
1 1 D3
D0, D1, D2, D3 Input lines
S1, S0 Selection line
Y Output line
26. Write the truth table of 8×1 MUX
S2 S1 S0 Y
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 0 0 D4
1 0 1 D5
1 1 0 D6
1 1 1 D7
D0, D1, D2, D3, D4, D5, D6, D7 Input lines
S2, S1, S0 Selection lines
Y Output line
27. Define Demultiplexer.
It is a combinational circuit consist of one input, 2n output lines and n selection
lines. It receives information on a single line and transmit same information on
one of 2n possible output lines. This output line controlled by n number of
selection lines.
28. How can a decoder be converted to a demultiplexer?
A decoder with an enable inputs is referred as demultiplexer.
29. Write the truth table of 1×2 DEMUX (Input (EN = 1))
Input Selection line Output
(EN) S D0 D1
1 0 1 0
1 1 0 1
30. Write the truth table of 1×2 DEMUX (Input (EN = 0))
Input Selection line Output
(EN) S D0 D1
0 0 0 1
0 1 1 0
31. Write the truth table of 1×4 DEMUX (Input (EN = 1))
Input S1 S0 Output
(EN) D0 D1 D2 D3
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 0 1
32. Write the truth table of 1×4 DEMUX (Input (EN = 0))
Input S1 S0 Output
(EN) D0 D1 D2 D3
0 0 0 0 1 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 1
0 1 1 1 1 1 0
33. Write the truth table of 1×8 DEMUX (Input (EN = 1))
Input S2 S1 S0 Output
(EN) D0 D1 D2 D3 D4 D5 D6 D7
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 0 0 0 1 0 0 0 0 0
1 0 1 1 0 0 0 1 0 0 0 0
1 1 0 0 0 0 0 0 1 0 0 0
1 1 0 1 0 0 0 0 0 1 0 0
1 1 1 0 0 0 0 0 0 0 1 0
1 1 1 1 0 0 0 0 0 0 0 1
34. Write the truth table of 1×8 DEMUX (Input (EN = 0))
Input S2 S1 S0 Output
(EN) D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 0 0 1 1 1 1 1 1 1
0 0 0 1 1 0 1 1 1 1 1 1
0 0 1 0 1 1 0 1 1 1 1 1
0 0 1 1 1 1 1 0 1 1 1 1
0 1 0 0 1 1 1 1 0 1 1 1
0 1 0 1 1 1 1 1 1 0 1 1
0 1 1 0 1 1 1 1 1 1 0 1
0 1 1 1 1 1 1 1 1 1 1 0
35. What are the types of Code Converters?
Binary to Gray Code Converter
Gray to Binary Code Converter
UNIT-2
COMBINATIONAL CIRCUITS\
Combinational circuit is a circuit in which we combine the different gates in the circuit, for example
encoder, decoder, multiplexer and demultiplexer. Some of the characteristics of combinational circuits
are following −
The output of combinational circuit at any instant of time, depends only on the levels present at
input terminals.
The combinational circuit do not use any memory. The previous state of input does not have any
effect on the present state of the circuit.
A combinational circuit can have an n number of inputs and m number of outputs.
BLOCK DIAGRAM:
Adder
Half adder
Full adder
Subtractor
Half Subtractor
Full Subtractor
ADDER:
An adder is a digital logic circuit in electronics that implements addition of numbers.
In many computers and other kinds of processors, adders are used not only in the arithmetic logic
units, but also in other parts of the processor, where they are used to calculate addresses,
increment and decrement operators, and similar operations.
Adders are classified into two types:
Half adder.
Full adder.
Let us first take a look at the addition of single bits.
´ 0+0 = 0
´ 0+1 = 1
´ 1+0 = 1
´ 1+1 =10 (i.e. 1+1=0 with carry = 1)
HALF ADDER:
The Half adder adds two single binary digits A and B.
It has two outputs, sum (S) and carry (C).
The carry signal represents an overflow into the next digit of a multi-digit addition
Block Diagram:
Truth Table:
Truth table using K-Map:
Analysing Result:
No of inputs = 2
No of outputs = 2
Inputs are A , B.
Outputs are Sum , Carry.
Sum can be obtained using XOR logic gate.
Carry can be obtained using AND logic gate.
Logic Diagram:
FULL ADDER
A Full adder adds binary numbers and accounts for values carried in as well as out.
The main difference between a half-adder and a full-adder is that the full-adder has three
inputs and two outputs.
A one-bit full adder adds three one-bit numbers, often written as A, B, and Cin.
It has two outputs, sum (S) and carry (Cout).
BLOCK DIAGRAM:
TRUTH TABLE:
SOLVING TRUTH TABLE USING K-MAP:
ANALYSING RESULTS:
No of inputs = 3
No of outputs = 2
Inputs are A , B, Cin.
Outputs are Sum , Cout.
LOGIC DIAGRAM:
SUBTRACTOR:
An Subtractor is a digital logic circuit in electronics that implements subtraction of numbers.
In many computers and other kinds of processors, Subtractor are used not only in the arithmetic
logic units, but also in other parts of the processor, where they are used to calculate addresses,
increment and decrement operators, and similar operations.
Substractor are classified into two types:
1)Half Subtractor.
2)Full Subtractor.
Let us first take a look at the subtraction of single bits.
´0-0 = 0
´0-1 = 11 (i.e. 0-1 = 1 with borrow = 1)
´1-0 = 1
´1-1 = 0
HALF SUBTRACTOR:
The half Subtractor subtracts two single binary digits A and B.
It has two outputs, Difference (D) and borrow (B).
The borrow signal represents an overflow into the next digit of a multi-digit subtraction.
BLOCK DIAGRAM:
TRUTH TABLE:
SOLVING TRUTH TABLE USING K-MAP:
ANALYSING RESULTS:
No of inputs = 2
No of outputs = 2
Inputs are A , B.
Outputs are Difference , Borrow.
Difference can be obtained using XOR logic gate.
Borrow can be obtained using NOT and AND logic gate.
LOGIC DIAGRAM:
FULL SUBTRACTOR:
A full Subtractor subtracts binary numbers and accounts for values borrowed in as well as out.
The main difference between a half- Subtractor and a full- Subtractor is that the full-Subtractor
has three inputs and two outputs.
A one-bit full Subtractor subtracts three one-bit numbers, often written as A, B, and Bin.
It has two outputs, Difference (D) and borrow (B).
BLOCK DIAGRAM:
TRUTH TABLE:
SOLVING TRUTH TABLE USING K-MAP:
ANALYSING RESULTS:
No of inputs = 3
No of outputs = 2
Inputs are A , B, Bin.
Outputs are Difference , Bout
LOGIC DIAGRAM:
BCD ADDER:
Also Known as 8421 digit. A 4-bit binary adder.
Adds two 4-bit digits having a BCD. Resulting format 4-bit output digit.
Sum exceeding decimal value of 9, a carry’s generated.
The BCD-Adder is used in the computers and the calculators that perform arithmetic operation
directly in the decimal number system. The BCD-Adder accepts the binary-coded form of
decimal numbers.
FUNCTIONS OF BCD ADDER:
A 4-bit BCD code’s used to represent 0 to 9 digits.
Adding BCD numbers using BCD addition.
Adding 6 with the sum while exceeding 9 and generating a carry. By adding 6 to the sum, make
an invalid digit valid.
ALGORITHM FOR BCD ADDER:
If sum is up to 9
ü
Use the regular Adder.
If the sum > 9
ü
Use the regular adder and add 6 to the result
WHY ADD 6 to the result?
Sum of two BCD digits exceeding 9.
A carry is generated.
Converting the invalid digit into valid digit.
Carry generated by adding 6 to the invalid BCD digit’s passed on to the next BCD digit.
BCD ADDER (SUM UPTO 9):
Number C S3 S2 S1 S0
0 0 0 0 0 0
1 0 0 0 0 1
2 0 0 0 1 0
3 0 0 0 1 1
4 0 0 1 0 0
5 0 0 1 0 1
6 0 0 1 1 0
7 0 0 1 1 1
8 0 1 0 0 0
9 0 1 0 0 1
BCD ADDER BLOCK DIAGRAM:
MAGNITUDE COMPARATOR:
• It is a combinational logic circuit.
• Digital Comparator is used to compare the value of two binary digits.
• There are two types of digital comparator
(i) Identity Comparator
(ii) Magnitude Comparator.
• IDENTITY COMPARATOR: This comparator has only one output terminal for when
A=B, either A=B=1 (High) or A=B=0 (Low)
• MAGNITUDE COMPARATOR: This Comparator has three output terminals namely
A>B, A=B, A<B. Depending on the result of comparison, one of these output will be
high (1)
• Block Diagram of Magnitude Comparator is shown in Fig. 1
2-Bit Comparator:
• A comparator which is used to compare two binary numbers each of two bits is called a
2-bit magnitude comparator.
• Fig. 2 shows the block diagram of 2-Bit Magnitude comparator.
• It has four inputs and three outputs.
• Inputs are A0 ,A1,B0 and B1 and Outputs are Y1, Y2 and Y3
TRUTH TABLE:
INPUT OUTPUT
A1 A0 B1 B0 Y1=A<B Y2=(A=B) Y3=A>B
0 0 0 0 0 1 0
0 0 0 1 1 0 0
0 0 1 0 1 0 0
0 0 1 1 1 0 0
0 1 0 0 0 0 1
0 1 0 1 0 1 0
0 1 1 0 1 0 0
0 1 1 1 1 0 0
1 0 0 0 0 0 1
1 0 0 1 0 0 1
1 0 1 0 0 1 0
1 0 1 1 1 0 0
1 1 0 0 0 0 1
1 1 0 1 0 0 1
1 1 1 0 0 0 1
1 1 1 1 0 1 0