DDCO (Module - 2)
DDCO (Module - 2)
MODULE-2
Combinational Logic and Sequential Logic
Syllabus:
Combinational Logic: Introduction, Combinational Circuits, Design Procedure, Binary Adder-
Subtractor, Decoders, Encoders, Multiplexers.
The n input binary variables come from an external source; the m output
variables are produced by the internal combinational logic circuit and go to
an external destination. Some of the Examples are, Adders, Subtractors,
Decoders, Encoders, Multiplexers etc
A truth table for a combinational circuit consists of input columns and output
columns. The input columns are obtained from the 2n binary numbers for
the n input variables. The binary values for the outputs are determined from
the stated specifications. The output functions specified in the truth table give
the exact definition of the combinational circuit.
BCD stands for Binary Coded Decimal. BCD is a coding scheme used to
represent decimal numbers in the binary format. In BCD coding scheme, each
decimal digit, from 0 to 9, is encoded as a group of 4-bits.
The process of converting BCD to Excess-3 is quite simple . The Excess-3 code
can be calculated by adding 3, i.e., 0011 to each four -digit BCD code. Below
is the truth table for the conversion of BCD to Excess-3 code.
1 0 0 0 1 0 1 0 0
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0
10 1 0 1 0 X X X X
11 1 0 1 1 X X X X
12 1 1 0 0 X X X X
13 1 1 0 1 X X X X
14 1 1 1 0 X X X X
15 1 1 1 1 X X X X
Step 3: Obtain the simplified Boolean functions for each output as a function
of the input variables. (From K map)
Step-4: Draw the Logic Diagram for the above Boolean expressions.
Step 2: Create the truth table that defines the required relationship
between inputs and outputs.
Truth Table
Input Output
x y Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Full Adder
A combinational circuit that performs the Arithmetic Sum of three bits and
generates Sum and Carry is called Full Adder. It performs the addition of three
bits (two significant bits and a previous carry).
Design of Full Adder:
Step 1: Decide the number of inputs and outputs
It has three Inputs and two outputs, Let the inputs be x,y,z and outputs be Sum(S) and
Carry(C)
Step 2: Create the truth table that defines the required relationship
between inputs and outputs.
Truth table:
Decimal Input Output
x y z Sum (S) Carry(C)
0 0 0 0 0 0
1 0 0 1 1 0
2 0 1 0 1 0
3 0 1 1 0 1
4 1 0 0 1 0
5 1 0 1 0 1
6 1 1 0 0 1
7 1 1 1 1 1
Step-4: Draw the Logic Diagram for the above Boolean expressions.
Implementation of Sum and Carry of Full Adder using Basic Gates
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 carry output from each full adder connected to the carry input of the
next full adder in the chain. Addition of n-bit numbers requires a chain of n
Full Adders.
4-bit Binary Adder:
Let’s consider two 4-bit binary numbers A and B as inputs to the Digital
Circuit. Binary number A being A0 A1 A2 A3 and B being B0 B1 B2 B3.
The circuit consists of 4 full adders since we are performing operations on
4-bit numbers.
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. The Sum outputs generate the required sum bits S3,S2,S1,S0. An n -bit
adder requires n full adders, with each output carry connected to the input
carry of the next higher order full adder.
The addition and subtraction operations can be combined into one circuit
with one common binary adder by including an exclusive -OR gate with each
full adder. A four-bit adder–subtractor circuit is shown in above Fig.. The
mode input M controls the operation. W hen M = 0, the circuit is an adder,
and when M = 1, the circuit becomes a subtractor.
DECODERS:
Discrete quantities of information are represented in digital systems by binary
codes. The name “Decoder” means to translate or decode the coded
information from one format into another.
A binary code of n bits is capable of representing up to 2 n distinct
elements of coded information. A decoder is a combinational circuit that
converts binary information from n input lines to a maximum of 2n unique
output lines. The decoders presented here are called n -to- m -line decoders,
where m <= 2n. Their purpose is to generate the 2n minterms from n input
variables. Each combination of inputs will assert a unique output.
2 to 4 Line Decoder:
It has Two inputs and Four outputs. Also an Enable input is considered. An
Enable Input is used to Enable or disable the Decoder. At any point of time
only one output is HIGH and remaining outputs are LOW.
Enable input(E)
From the truth table we can write the boolean function for each output
3 to 8 Line Decoder:
It has three inputs and Eight outputs. Enable Input is used just to Enable or
disable the circuit. A decoder provides the 2n minterms for n input variables.
Each asserted output of the decoder is associated with a unique pattern of
input bits. Hence in 3 to 8 line decoder provides 8 minterms of input variables
and decoded into 8 bit binary form for each input combination. At any point
of time only one output is 1 and others outputs are 0.
From the truth table, we can write Boolean function for each output
variable in terms of input variable by observing each output column.
Logic Diagram :
When w= 0, then E =1 for the top decoder and hence it is enabled and the
corresponding Enable input for the lower Decoder E=0 and hence it is
disabled. The bottom decoder outputs are all 0’s, and the top eight outputs
generate minterms 0000 to 0111(D0 to D7).
Truth Table:
Inputs Outputs
From the truth table of the full adder (observe 1 in Sum and carry column),
we obtain the functions for the combinational circuit in sum-of-minterms
form:
Sum = S(x, y, z) = ∑m(1, 2, 4, 7)
Carry = C(x, y, z) = ∑m(3, 5, 6, 7)
Since there are three inputs and a total of eight minterms, we need a three-
to-eight-line decoder. The implementation is shown in Fig. The decoder
generates the eight minterms for x , y , and z . The OR gate for output S forms
the logical sum of minterms 1, 2, 4, and 7. The OR gate for output C forms
the logical sum of minte rms 3, 5, 6, and 7.
ENCODERS:
An Encoder is a digital circuit that performs the inverse operation of a
decoder. An encoder is a digital circuit that converts a set of binary inputs
into a unique binary code. It has maximum 2n input lines and n output lines.
Hence it Encodes the information from 2n inputs into an n-bit code. It will
produce a binary code equivalent to the input, which is active High.
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,
3, 5, 7. Output y is 1 for octal digits 2, 3, 6, 7, and output x is 1 for digits 4, 5, 6, 7.
These conditions can be expressed by the following Boolean output functions:
Note: Draw the Logic diagram for the above Boolean equations to obtain
Priority Encoder:
In case of an ordinary encoder, one and only one input can be activated at
any given time. But in the case of some practical digital systems, two or more
decimal inputs can unintentionally become active at the same ti me that might
cause a confusion to generate the encoded output. In such cases, the primary
function of the encoder is to select the input with the highest priority and this
is done using Priority Encoder.
In addition to the two outputs x and y, the circuit has a third output
designated by V; this 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
Truth Table:
INPUTS OUTPUTS
D3 D2 D1 D0 x y v
0 0 0 0 0 0 0
0 0 0 1 0 0 1
0 0 1 X 0 1 1
0 1 X X 1 0 1
1 X X X 1 1 1
To obtain the Boolean expressions for each output variable, we need to check
for all 16 combinations and the corresponding minterms need to be entered
in K map.
The simplified Boolean expressions for the priority encoder are obtained from
the K maps. The priority encoder is implemented according to the following
Boolean functions:
x = D 2 + D3
y = D3 + D1 D’2
V = D 0 + D 1 + D 2 + D3
Multiplexers:
A Multiplexer is a data selector. A multiplexer is a combinational circuit that
selects binary information from one of many input lines and directs it to a
single output line. The selection of a particular input line is controlled by a
set of selection lines. Normally, there are 2 n input lines and n selection lines.
The bit combinations of select lines determine which input is to be selected.
Logic Diagram :
From the above truth ,if select lines value S 1S0 = 00, Input I0 is selected and
the data available at Io is routed to output Y, Therefore, we have Y=I0 when
S1S0 = 00
Similarly, if select lines value S 1S0 = 01, Input I1 is selected and it routed to
output, Therefore, we have Y=I1 when S1S0= 01
Similarly, if select lines value S 1S0= 10, Input I2 is selected and it is routed to
output, Therefore, we have Y=I2 when S1S0 = 10
Similarly, if select lines value S 1S0 = 11, Input I3 is selected and it routed to
output, Therefore, we have Y=I3 when S1S0= 11
From truth we get the logical expression for output Y in the SOP
form will be as under
Fig.Logic diagram
8:1 Multiplexer
8 X 1 Multiplexer has 8 data inputs D0, D1, D2, D3, D4, D5, D6 & D7, with
3 select lines S0, S1, & S2 and one output line Y. One of these data inputs
will be connected to the output Y based on the values of selection lines.
Truth table
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
From the truth table, We can write the Boolean expression representing the
output Y. In the logic circuit diagram shown below, 8-to-1 multiplexer can be
implemented by using 8 AND gates, 1 OR gate and 3 NOT gates. The output
gets connected to only one of the n data inputs at a gi ven instant of time. The
output is selected based on the truth table of this integrated circuit.
Procedure:
STORAGE ELEMENTS:
LATCHES and FLIP FLOPS:
A storage element in a digital circuit can maintain a binary state indefinitely
until directed by an input signal to switch states.
Storage elements that operate with signal levels are referred to as latches and
if storage elements controlled by a clock transition are referred as flip-flops.
Latches are said to be level sensitive devices; on the other hand, flip-flops are
edge-sensitive devices. Each Latch or a flip flop can store one bit of binary
information.
S R Latch:(Set-Reset) Latches:
The SR latch has two stable states and can store a single bit of information;
the two stable states are known as Set(S) and Reset(R), hence the name SR.
The latch also provides two outputs, namely Q and Q-bar (the inverse of Q).
The S input sets the output to 1, while the R input resets the output to 0.
When both S and R are at 1, the latch is said to be in an “undefined” state.
The NAND gates provide an output of 1 whenever one of the input of NAND
gate is 0. In the case of S = 0 and R = 0, the output of both NAND gates goes
to 1 then Q and Q’ both comes 1 violating the basic definition of Latch. Hence
it is said tobe invalid state.
When S=0, the upper NAND gate provides an output of 1, so output Q=1(SET
State) and Q’=0 .
When R=0, the lower NAND gate provides an output of 1, so output Q’=1 but
Q=0(RE SET State)
When S=1, R=1, both NAND gate output depends on previous state of the
output. ie Present state is same as previous state (no change in the output
state)
It consists of the basic SR latch and two additional NAND gates. The control
input En acts as an enable signal for the other two inputs. The outputs of
the NAND gates stay at the logic-1 level as long as the enable signal
remains at 0.
This is the quiescent condition for the SR latch. When the enable input goes
to 1, information from the S or R input is allowed to affect the latch. The set
state is reached with S = 1, R = 0, and En = 1.To change to the reset state,
the inputs must be S = 0, R = 1, and En = 1.
In either case, when En returns to 0, the circuit remains in its current state.
The control input disables the circuit by applying 0 to En, so that the state of
the output does not change regardless of the values of S and R . Moreover,
when En = 1 and both the S and R inputs are equal to 0, the state of the
circuit does not change. These conditions are listed in the function table
accompanying the diagram.
An indeterminate condition occurs when all three inputs are equal to 1. This
condition places 0’s on both inputs of the basic SR latch, which puts it in the
undefined state. When the enable input goes back to 0, one cannot
conclusively determine the next state, because it depends on whether the S
or R input goes to 0 first. This indeterminate condition makes this circuit
difficult to manage .
The D input goes directly to the S input, and its complement is applied to the
R input. As long as the enable input is at 0, the cross-coupled SR latch has
both inputs at the 1 level and the circuit cannot change state regardless of
the value of D .
FLIP-FLOPS:
Edge triggered flip flop operates only on the rising or falling edge of the clock
pulse. There are two types
The type of edge-triggered flip-flop whose output changes its state only on the
rising edge (edge that goes from low to high) of the clock pulse is called a
positive edge-triggered flip-flop. The positive edge triggered flip flop is also
called a rising edge-triggered flip-flop.
The type of edge-triggered flip flop whose output changes its state only on the
falling edge (edge that goes from high to low) of the clock pulse is called a
negative edge-triggered flip-flop. The negative edge triggered flip flop is also
known as a falling edge -triggered flip-flop.
When the clock is 0, the output of the inverter is 1. The slave latch is enabled,
and its output Q is equal to the master output Y . The master latch is disabled
because Clk = 0.
When the input pulse changes to the logic-1 level, the data from the external
D input are transferred to the master. The slave, however, is disabled as long
as the clock remains at the 1 level, because its enable input is equal to 0.
Any change in the input changes the master output at Y, but cannot affect
the slave output. When the clock pulse returns to 0, the master is disabled
and is isolated from the D input. At the same time, the slave is enabled and
the value of Y is transferred to the output of the flip-flop at Q . Thus, a change
in the output of the flip-flop can be triggered only by and during the transition
of the clock from 1 to 0.