Chapter 2 FCnew
Chapter 2 FCnew
Logic Circuits
The circuits which perform logical operation on two or
more inputs to obtain certain output are called logic
circuits.
Logic circuits are of two types:
Combinational logic circuits
Sequential logic circuits
Characteristics of Combinational logic circuit
Combinational logic circuit is a type of digital logic
circuit in which the output at any time depends upon
present inputs only.
It does not have a memory unit
It has n number of inputs and m number of outputs
Combinational circuit consists of input variables,
logic gates and output variables
The logic function performed by a combinational
circuit is fully defined by a set of Boolean
expressions.
1
Design of Logic Circuit
Q1: Implement the logic circuit for the following Boolean
expression:
X=AB+CDE
Ans:
Ans:
2
Q3: Implement the logic circuit for the following Boolean
expression
Y=ABC+D+E
Ans:
3
Half Adder
The half-adder is an arithmetic circuit that can be used
to add two binary digits. It accepts two binary digits as
inputs and produces two outputs sum and carry.
The block diagram of half adder is as shown below:
4
Therefore, the logic expressions for half adder are given
by,
S=A B
C = AB
The logic diagram for half adder is as shown below:
5
Full Adder
A full adder circuit is an arithmetic circuit that can be
used to add three binary digits. It accepts two input bits
and an input carry and generates sum and carry
outputs.
The block diagram of full adder is as shown below:
6
The logic diagram of full adder is as shown below:
7
Half Subtractor
The half-subtractor is a combinational circuit which is
used to perform subtraction of two bits. It accepts two
binary digits as inputs and produces two outputs:
difference and borrow.
The block diagram of half subtractor is as shown below:
8
Fig: half subtractor logic diagram
Full Subtractor
A full subtractor is a combinational circuit which
performs subtraction of two binary digits taking borrow
into consideration. It accepts two input bits and an input
borrow and produces difference and borrow outputs.
The block diagram of full subtractor is shown below:
9
Truth table of full subtractor
10
Comparator
A comparator is a combinational circuit that compares
the magnitudes of two given binary numbers and
determines whether one is equal to, less than or greater
than the other.
The comparator has 3 outputs representing the
conditions A=B, A>B and A<B, if A and B are the two
numbers being compared.
The following figure shows the block diagram of a n-bit
magnitude comparator:
2 bit comparator
A comparator used to compare two binary numbers
each of two bits is called a 2-bit Magnitude comparator.
It consists of four inputs and three outputs to generate
less than, equal to and greater than between two binary
numbers.
The block diagram for a 2-bit comparator is given
below:
11
Fig: block diagram of 2 bit comparator
12
Multiplexer
The multiplexer is a combinational logic circuit that has
many inputs and one output. It seclects any one input
from several inputs and pass it to the output line.The
value of select lines determine which input is connected
to the output. Multiplexer is also called as a data
selector.
n
In general a multiplexer has 2 inputs, n select lines and
only one output.
The general block diagram of a multiplexer is shown
below:
13
2:1 multiplexer
A 2:1 multiplexer has two inputs D0 and D1, one select
line S, enable input E and one output Y.
The block diagram of a 2:1 multiplexer is shown below:
14
4:1 Multiplexer
A 4:1 multiplexer has 4 inputs D0, D1, D2 and D3, 2
select lines S0 and S1, one enable input E, and one
output Y.
The block diagram of 4:1 MUX is as shown below:
15
The logic equation of 4:1 MUX is given as below:
16
Demultiplexer
Demultiplexer is a combinational logic circuit which has
one input and many outputs. It is also called as a data
distributer. It passes the input to one of the output line
depending on the value of select lines.
n
In general, the demultiplexer has one input, 2 outputs
and n select lines.
The general block diagram of a demultiplexer is as
shown below:
1:2 demultiplexer
1:2 De-mux has only one input D, one select line S and
two outputs Y0 and Y1.
The block diagram of a 1:2 demultiplexer is as shown
below:
17
The truth table of 1:2 demultiplexer is as given below:
1:4 demultiplexer
1:4 De- Multiplexer has
one input D, two selection lines,
S1 & S0 and four outputs Y3, Y2,
18
Y1 & Y0.
The block diagram of 1:4 demultiplexer is as given
below:
19
The logic diagram of 1:4 demux is as shown below:
Encoder
It is a combinational logic circuit that has 2n input lines
and n output lines. It does the reverse function of
20
decoder. It is a device which converts information signal
in to coded form. Encoder is used at the transmitter side.
The general block diagram of an encoder is as shown
below:
21
The truth table of decimal to BCD encoder is as given
below:
Decoder
Decoder does the reverse function of encoder. It is a
n
combinational logic circuit that has n inputs and 2
outputs. One of these outputs will be active High based
on the combination of inputs present. Decoder converts
coded signal into original information signal. It is used at
the receiver side.
The logic symbol of a decoder is as shown below:
23
BCD to decimal decoder
The BCD-to-decimal decoder converts each BCD code
(8421 code) into one of ten possible decimal digit
indications. It is frequently referred as a 4-line-to-10-line
decoder.
The logic symbol of BCD to decimal decoder is shown
below:
24
The logic expressions are:
25
BCD to 7 Segment Decoder ( OR BCD to 7 segment code converter)
26
The 7 segment displays can be common cathode or common anode type. For
common cathode display, the output of the decoder must be high in order to blink the
segment.
The truth table of BCD to 7 segment decoder for common cathode display is shown
below:
27
IMPORTANT QUESTIONS AND ANSWERS
Ans:
Applications:
Ans:
28
The sum and carry expressions of full adder are:
The logic diagram of full adder has 2 XOR gates, 2 AND gates and
1 OR gate.
A full adder can be constructed using two half adders.
Applications:
Ans:
D=A B
29
Applications:
Used in calculators
Ans:
The logic diagram of full subtractor has 2 XOR gates, 2 AND gates
and 2 NOT gates and 1 OR gate.
A full subtractor can be constructed using two half subtractors
Applications:
30
Q5: List the features and applications of encoders
Ans:
Features of encoders:
n
It is a combinational logic circuit with 2 inputs and n outputs.
It does the reverse function of decoder.
It converts information signal in to coded form.
Encoder is used at the transmitter side.
Encoders can be built using basic gates
Applications:
Ans:
Features of decoders:
Applications:
31
Used in data demultiplexing
Used in 7 segment displays
Used in microprocessor memory systems
Used in computer I/O systems
Used to decode the instructions
Used in code conversion
Used in many output devices like monitors, printers etc.
Ans:
Features of comparators:
Applications:
32
Q7: List the features and applications of multiplexers
Ans:
Features of multiplexers
Applications:
Ans:
Features:
33
De multiplexer has select lines to pass the input to one of the
output lines
Applications:
34
SEQUENTIAL CIRCUITS
Sequential circuits are the type of logic circuits whose output not
only depends on present inputs but also on previous outputs.
35
Types of sequential circuit
Clocked flip flops acts as memory Unclocked flip flops acts as memory
element element
36
Comparison between combinational and sequential circuits
Clock signal is not required for its Most of the sequential circuits
operation require clock signal for their
operation
Ex: Ex:
adders, flip flops,
subtractors, counters,
encoders, shift registers etc.
decoders,
multiplexers etc
37
Types and applications of shift registers
Shift registers are a type of sequential circuit used for storing and
transfering digital data and typically do not possess a characteristic
internal sequence of states. They contain a group of flip flops.
The serial in/serial out shift register accepts data serially one bit at a time
on a single line and produces the output in serial form.
The serial in parallel out shift registers accept the data serially one bit at
a time and produces the output simultaneously in parallel form
38
3.Parallel in parallel out shift register (PIPO)
The parallel in parallel out shift register accepts the data bits
simultaneously in parallel form and immediately produces the output
simultaneously in parallel form.
39
4.Parallel in serial out shift register (PISO)
The parallel in serial out shift register accepts the data simultaneously in
parallel form and produces the output serially one bit at a time.
40
Types and applications of counters
Counter is a group of flip flops used for counting the clock pulses. It is a
type of finite state machine.
Counters are classified into two types according to the way they are
clocked:
1. Asynchronous counter
2. Synchronous counter
1.Asynchronous counter
2.Synchronous counter
A synchronous counter is one in which all the flip-flops in the counter are
clocked at the same time by a common clock pulse..
Applications of counters
Frequency counters
Digital clocks
Analog to digital converters
Time measurement
Frequency divider
Triangular wave generator
41
Flip Flops
The R-S flip-flop is the most basic of all flip-flops. The letters ‘R’ and ‘S’
stand for RESET and SET.
42
Truth table of R-S flip flop
1 0 0 Qn No change
1 0 1 0 1 RESET
1 1 0 1 0 SET
1 1 1 X X INVALID
Working:
When clock signal is high, the input NAND gates are enabled and the
following operations occur:
Case 1: when S= 0, R=0, there is no change in the output. The flip flop
remains in the previous state.
Case 2: when S= 0, R=1, the output Qn+1 =0, =1. The flip flop is
said to be in Reset state
Case 3: when S= 1, R=0, the output Qn+1 =1, =0 . The flip flop is
said to be in Set state
Case 4: when S= 1, R=1, both the outputs are same. The flip flop is said
to be in Invalid state
43
D flip flop
D flip flop is known as Delay flip flop. When the clock is high, the data bit
(0 or 1) present at the D input is transferred to the output.
1 0 0 1 RESET
1 1 1 0 SET
Working:
When clock is high, the output Q n+1 will hold the value of D. i.e. if D=0,
Q n+1=0, flip flop is in reset state. If D=1, Q n+1=1, flip flop is in set state.
44
T flip flop
T flip flop is known as Toggle flip flop. The flip flop changes its state
every time it is triggered at its input.
45
If T= 0 (i.e., J = K = 0) prior to a clock pulse, the Qn+1 output will not
change with the clock pulse. It will hold the present state.
Logic symbol
Logic circuit
46
Truth table
1 0 0 Qn No change
1 0 1 0 1 RESET
1 1 0 1 0 SET
1 1 1 - - Toggles
Working
When J and K are 1, the output toggles from the previous state. The flip
flop is in toggle state.
47