CS 3351 Digital Principles & Computer Organization
CS 3351 Digital Principles & Computer Organization
Combinational Circuits – Karnaugh Map - Analysis and Design Procedures – Binary Adder – Subtractor –
Decimal Adder - Magnitude Comparator – Decoder – Encoder – Multiplexers - Demultiplexers
CS 3352-DP&CO UNIT I
1. Combinational Logic
The digital system consists of two types of circuits, namely
(i) Combinational circuits
(ii) Sequential circuits
Combinational Circuits
1. A combinational circuit consists of logic gates whose outputs at any time
are determined from only the present combination of inputs.
2. For n input variables, there are 2n possible combinations
of the binary inputs.
3. For each possible combination, there is one and only one
possible output combination.
4. A combinational logic circuit can be described by m Boolean functions and each output can be expressed in
terms of n input variables.
1. Analysis Procedure
1. The analysis of a combinational circuit requires that we determine the function that the circuit implements.
2. The analysis can be performed manually by finding the Boolean functions or truth table or by using a
computer simulation program.
3. The first step in the analysis is to make sure that the given circuit is combinational and not sequential.
4. The diagram of a combinational circuit has logic gates with no feedback paths or memory elements.
5. To obtain the output Boolean functions from a logic diagram,
i) Label all gate outputs that are a function of input variables with arbitrary symbols. Determine the
Boolean functions for each gate output.
ii) Label the gates that are a function of input variables and previously labeled gateswith other arbitrary
symbols. Find the Boolean functions for these gates.
iii) Repeat the process outlined in step 2 until the outputs of the circuit are obtained.
iv) By repeated substitution of previously defined functions, obtain the outputBoolean functions in terms
of input variables.
For analysis, let us consider the logic diagram:
The circuit has three binary inputs— A, B, and C and two binary outputs— F1 and F2.
The Boolean functions for these two outputs are
F1 = T3 + T2
F2 =AB +AC+BC
T1=A+B+C
T2=ABC
T3= F2 ‗T1
To obtain F1 as a function of A,B,C, we form a series of substitutions as follows
F1 = T3 + T2 = F2 ‗T1 + T2
= (AB +AC+BC)‘ (A+B+C) + ABC
CS 3352-DP&CO UNIT I
=(A‘+B‘)(A‘+C‘)(B‘+C‘)(A+B+C)+ABC
=(A‘+B‘C‘)(AB‘+AC‘+BC‘+B‘C) +ABC
=A‘BC‘+A‘B‘C
The derivation of the truth table for a circuit is a straightforward process once the output Boolean
functions are known.
1. Determine the number of input variables in the circuit. For n inputs, form the 2n possible input
combinations and list the binary numbers from 0 to (2n - 1) in a table.
2. Label the outputs of selected gates with arbitrary symbols.
3. Obtain the truth table for the outputs of those gates which are a function of the input variables only.
4. Proceed to obtain the truth table for the outputs of those gates which are a function of previously defined
values until the columns for all outputs are determined
Truth Table for the Logic Diagram of Fig
2. Design Procedure
The procedure involves the following steps:
1. From the specifications of the circuit, determine the required number of inputs and outputs and assign a
symbol to each.
2. Derive the truth table that defines the required relationship between inputs and outputs.
3. Obtain the simplified Boolean functions for each output as a function of the input variables.
4. Draw the logic diagram from the simplified expression.
5. The simplified sum-of-products expressions obtained from the truth table are
S = x‘y + xy‘
C = xy
CS 3352-DP&CO UNIT I
Block Diagram
4. As there are three input variables, eight different input combinations are possible.
5. The truth table of the full adder is listed in Table
It can also be implemented with two half adders and one OR gate.
In fig The S output from the second half adder is the exclusive-OR of z and the output of the first half adder,
giving S = z (x y)
= z‘(xy‘ + x‘y) + z (xy‘ + x‘y)‘
= z‘(xy‘ + x‘y) + z (xy + x‘y‘)
= xy‘z‘ + x‘yz‘ + xyz + x‘y‘z
The carry output is
C = z (xy‘ + x‘y) + xy = xy‘z + x‘yz + xy
2.4. Full-Subtractor
1. A full-subtractor has three inputs and two outputs.
2. x,y and z are the inputs to be subtracted in which z represents borrow from the next stage.
D and B are the outputs.
3. Truth table for a full- subtractor
Inputs Outputs
x y z D S
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
CS 3352-DP&CO UNIT I
1 1 0 0 0
1 1 1 1 1
yz yz
x 00 01 11 10 x 00 01 11 10
0
1 1 1 1 1
0
1 1 1
1 1
It can also be implemented with two half subtractors and one OR gate.
The boolean expression for difference and borrow can be written as
D = x'y'z + x'yz' + xy'z' + xyz
= (x'y' + xy)z + (x'y + xy')z'
= (x y)'z+ (x y)z'
=x y z
B = x'.y + x'.z+ y.z
1. A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers.
2. 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.
CS 3352-DP&CO UNIT I
3. An n bit adder requires n full adder.
4. The carries are connected in a chain through the full adders. The input carry to the adder is C0, and it
ripples through the full adders to the output carry C4.
5. All the carries must be generated for the correct sum bits to appear at the outputs. Therefore, the sum and
carry outputs of any stage cannot be produced until the input carry occurs. This delay is known as carry
propagation delay.
Carry Propagation
1. In parallel adder all the bits of the augend and addend are available for computation at the same time.
2. The signal must propagate through the gates before the correct output sum is available in the output
terminals. The total propagation time is equal to the propagation delay of a typical gate, times the number
of gate levels in the circuit.
3. The longest propagation delay time in an adder is the time it takes the carry to propagate through the full
adders. Since each bit of the sum output depends on the value of the input carry.
4. There are several techniques for the reduction of carry propagation delay time. However, the most widely
used method employs the principle of look ahead carry generation
When the mode input (M) is at a low logic, i.e. '0', the circuit act as an adder and when the mode input is
at a high logic, i.e. '1', the circuit act as a subtractor.
The exclusive-OR gate connected in series receives input M and one of the inputs B.
When M is at a low logic, we have B Ex-or 0 = B.
The full-adders receive the value of B, the input carry is 0, and the circuit performs A plus B.
When M is at a high logic, we have B Ex-or 1 = B' and C0 = 1.
The B inputs are complemented, and a 1 is added through the input carry. The circuit performs the operation A
plus the 2's complement of B.
An overflow condition can be detected by observing the carry into the sign bit position and the carry out of the
sign bit position. If these two carries are not equal, an overflow has occurred
Let the carry out of the full adder adding the least significant bit be called c0. Then, the carry out of the
full adder adding the next least significant bit is c1. Thus, the carry out of the full adder adding the most
significant bits is c(k - 1). This assumes that we are adding two k bit numbers.
We can write the formula as: V = c(k-1) XOR c(k-2)
This is effectively XORing the carry-in and the carry-out of the leftmost full adder.
The XOR of the carry-in and carry-out differ if there's either a 1 being carried in, and a 0 being carried out, or if
there's a 0 being carried in, and a 1 being carried out.
Case 1: 0 carried in, and 1 carried out If a 0 is carried, then the only way that 1 can be carried out is if x(k-1) = 1
and y(k-1) = 1. That way, the sum is 0, and the carry out is 1. This is the case when you add two negative
numbers, but the result is non-negative.
Case 1: 1 carried in, and 0 carried out The only way 0 can be carried out if there's a 1 carried in is if x(k-1) = 0
and y(k-1) = 0. In that case, 0 is carried out, and the sum is 1. This is the case when you add two non-negative
numbers and get a negative result.
3. 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 ,A<B.
Consider two numbers A & B with four digits each.
A=A3A2A1A0
B=B3B2B1B0
CS 3352-DP&CO UNIT I
The two numbers are equal if all pairs of significant digit are equal i.e., if A3=B3 and A2=B2 and A1=B1 and
A0=B0
The equality relation of each pair of bits can be expressed logically with an equivalence function
xi =AiBi+Ai‘Bi‘ i=0,1,2,3
The binary variable (A=B) is 1 if the input numbers A & B are equal. For the equality condition to exist, all xi
variables must be equal to 1.This indicates an AND operation of all variables
(A=B) = x3 x2 x1 x0
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.
The sequential comparison can be expressed logically by the two Boolean functions
(A > B) = A3B3‘ + x3 A 2B2‘ + x3x2A1B1‘ + x3x2x1A0B0‘
(A < B) = A3’B3 + x3A2‘B2 + x3x2A1’B1 + x3x2x1A0B0’
Draw the logic diagram.
Example 4.1. Implement the given function using Multiplexer F (A, B, C) = Σ (0, 2, 6, 7)
Step 1: Select the multiplexer. Here Boolean expression has 3 variables, thus we require 22=4:1 MUX.
Variable B& C –Selection lines & A- input to the MUX.
Step 2: Derive inputs for MUX using implementation table
Implementation table
Implementation table is the list of the inputs of the MUX and under them list of all the minterms in two rows.
Encircle the minterms which is included in the given function
If the two minterms in a column are not circled, apply 0 to the corresponding multiplexer input.
If the two minterms are circled, apply 1 to the corresponding multiplexer input.
If the bottom minterm is circled and top is not circled, apply true form of the variable to the corresponding
multiplexer input.
If the top minterm is circled and bottom is not circled, apply complement of the variable to the corresponding
multiplexer input.
Here in I0 column top minterm alone is circled , so apply C‘ to I0
in I1 column top minterms alone is circled, so apply C‘ to I1
in I2 column both minterms are not circled, so apply 0 to I2
in I3 column both minterms are circled, so apply C to I3
Alternate method
Step 1: select the multiplexer same as above said.
Step 2: Find the truth table for the given Boolean expression
Inputs output
A B C F
0 0 0 1
F= C‘
0 0 1 0
0 1 0 1
F= C‘
0 1 1 0
1 0 0 0 F= 0
1 0 1 0
1 1 0 1 F= 1
1 1 1 1
Example 4.3. implement the following Boolean function with an 8 to 1 line multiplexer
F(A,B,C,D) = Σ (2,4,6,9,10,11,15)
Given Boolean expression is a function of 4 variable(A,B,C,D) , 3 variable(A,B,C) can be used as selection lines
i.e 3 selection lines . evaluate the output as a function of D.
5.Demultiplexer
DEMULTIPLEXERS: (abbreviated as demux)
The demultiplexer performs the exact opposite function of Multiplexer.
A Demultiplexer is a circuit that receives information on a single line and transmits this information on one
of 2 n possible output lines.
The selection of specific output line is controlled by the values of n selection lines.
Selection output
inputs
S1 S0 Y3 Y2 Y1 Y0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0
6. Decoders:
A decoder is a combinational circuit that converts binary information from n input lines to a maximum of 2n
unique output lines.
If the n -bit coded information has unused combinations, the decoder may have fewer than 2n outputs.
Y3 I1 I0 Y2 I1 I0
Y1 I1 I0 Y0 I1 I0
Block Diagram
Truth table
Y3
Y2
Y1
Y0
I1
I0
Logic Diagram
6.2. 3to-8 line decoder:
1. The three inputs are decoded into eight outputs,
2. Each output represents one of the minterms of the three input variables.
3. A particular application of this decoder is Binary-to-octal conversion.
4. The input variables represent a binary number, and the outputs represent the eight digits of a number
in the octal number system.
CS 3352-DP&CO UNIT I
The OR gate for output S forms the logical sum of minterms 1,2, 4, and 7.
The OR gates for output C forms the logical sum of minterms 3, 5, 6, and 7.
Example .Construct 4-to-16 line decoder using two 3-to-8 line decoder
CS 3352-DP&CO UNIT I
1. Decoders with enable inputs can be connected together to form a larger decoder circuit.
2. Two 3-to-8-line decoders with enable inputs connected to form a 4-to-16-line decoder.
3. When w =0, the top decoder is enabled and the other is disabled.
4. The bottom decoder outputs are all 0‘s, and the top eight outputs generate minterms 0000 to 0111.
5. When w = 1, bottom decoder is enabled.
6. The bottom decoder outputs generate minterms 1000 to 1111, while the outputs of the top decoder are all
0‘s.
A seven segment display is normally used for displaying any one of the decimal digits from 0 to 9.
A BCD to seven segment decoder accepts decimal digits in BCD and generates the corresponding seven
segment code.
Truth Table:
Decimal Inputs Outputs
Digits A B C D a b c d e f g
0 0 0 0 0 1 1 1 1 1 1 0
1 0 0 0 1 0 1 1 0 0 0 0
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
10 1 0 1 0 x x x x x x x
11 1 0 1 1 x x x x x x x
12 1 1 0 0 x x x x x x x
13 1 1 0 1 x x x x x x x
14 1 1 1 0 x x x x x x x
15 1 1 1 1 x x x x x x x
CS 3352-DP&CO UNIT I
K-Map Simplification:
Logic Diagram:
CS 3352-DP&CO UNIT I
7. Encoder
An encoder is a digital circuit that performs the inverse operation of a decoder.
An encoder has 2n (or fewer) input lines and n output lines.
The output lines generate the binary code corresponding to the input value.
Types:
4 to 2 line Encoder
8 to 3 line Encoder[ Octal to Binary]
16 to 4 line Encoder[ Hexadecimal to Binary]
Decimal to BCD Encoder
Priority Encoder
The encoder can be implemented with OR gates whose inputs are determined directly from the truth table.
z = D1 + D3 + D5 + D7
y = D2 + D3 + D6 + D7
x = D4 + D5 + D6 + D7
Truth table
Logic Diagram
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 W X Y Z Logic Diagram:
1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 0 0 1 0 0 0 0 0 1 0 1
0 0 0 0 0 0 1 0 0 0 0 1 1 0
0 0 0 0 0 0 0 1 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 0 1
W=D8+D9
X=D4+D5+D6+D7
Y=D2+D3+D6+D7
Z=D1+D3+D5+D7+D9
CS 3352-DP&CO UNIT I
Disadvantage of Encoder:
1. If two inputs are active simultaneously, the output produces an undefined combination.
if D3 and D6 are 1 simultaneously, the output of the encoder will be 111.The output 111 does not
represent either binary 3 or binary 6.
To resolve this ambiguity, encoder circuits must establish an input priority to ensure that only one input is
encoded.
2. When all the inputs are 0, all outputs are 0, but this output is the same as when D0 is equal to 1.
The discrepancy can be resolved by providing one more output to indicate whether at least one input is equal to 1.
V is a valid bit indicator that 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 other two outputs are not inspected when V equals 0 and are specified as don‘t-care conditions.
Instead of listing all 16 minterms of four variables, the truth table uses an X to represent either 1 or 0.
For example, X100 represents the two minterms 0100 and 1100.
Simplified expression of outputs obtained from K-Map simplification
D2D3
D2D3
00 01 11 10 00 01 11 10
D0D1 X 1 1 1
D0D1 X 1 1
00 00
1 1 1 01
1 1 1
01
1 1 1 11
1 1 1
11
1 1 1 10
1 1
10
A A
Pe
B
c B Po
c
3- bit even parity generator
3- bit odd parity generator
BC
A 00 01 11 10
0
1 1
1
1 1
Kmap for Pe
Truth table
Inputs output 5. Form the truth table C consists of the eight minterms with binary
A B C P C numerical values having odd number of 1‘s.
0 0 0 0 0 C=A B C P
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0 A
0 1 0 0 1 B
0 1 0 1 0
C
0 1 1 0 0
0 1 1 1 1 C
1 0 0 0 1 P
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
CS 3352-DP&CO UNIT I
Code converters
CS 3352-DP&CO UNIT I
CS 3352-DP&CO UNIT I
Unit I
1. Define Combinational circuit.
A combinational circuit consists of logical gates whose outputs at any time are determined from
the present combination of inputs. A combinational circuit performs an operation that can be
specified logically by a set of Boolean functions. It consists of input variables, gates and output
variables.
6. what is decoder?
Decoder is a multiple input multiple output logic circuit which converts coded input into coded output. In
a binary decoder n inputs produces 2n outputs.
13. Write the truth table of 2 to 4 line decoder and draw its logic diagram
Y3 I1 I0 Y2 I1 I0
Y1 I1 I0 Y0 I1 I0
Y3
Logic diagram
Y2
Y1
Y0
I1
I0
14. Mention the uses of decoder
Uses of decoder are
Code converter
Implementation of combinational circuits
Address decoding
19. Design the combinational circuit with 3 inputs and 1 output. The output is 1when the binary value of
the input is less than 3. The output is 0 otherwise. (May/June ‘16)
Truth table
yz
x 00 01 11 10
1 1 1
F=x‘y‘+x‘z‘
1
20. State the differences between combinational logic and sequential logic.