04: Combinational & Sequential Logic Circuits
IT1206 – Computer Systems
Level I - Semester 1
© 2020 e-Learning Centre, UCSC
4. Combinational & Sequential Logic Circuits
4.1 Adders
4.2 Decoders
4.3 Multiplexers
4.4 Arithmetic Logic Unit
4.5 Flip Flop – SR,JK,D(Data)
@ 2020 e-Learning Centre, UCSC
2
Combinational Logic
• Boolean algebra is a natural way to represent digital
information. It helps to represents operations of a computer
and understand how a computer makes decisions.
• Adders, decoders, multiplexers are just a few examples of
Combinational Logic circuits.
• Combinational Logic Circuits are memoryless digital logic
circuits whose output at any instant in time depends only on
the combination of its inputs.
• These are made up from basic logic NAND, NOR or NOT
gates that are “combined” or connected to produce more
complex switching circuits.
© 2020 e-Learning Centre, UCSC
3
Combinational Logic cont.…
• The three main ways of specifying the function of a combinational
logic circuit are:
1. Boolean Algebra – This forms the algebraic expression
showing the operation of the logic circuit for
each input variable either Logical True or
False that results in a Logical True output.
2. Truth Table – A truth table defines the function of a logic
circuit by providing a concise list that shows all
the output states in a tabular form for each
possible combination of input variable that the circuit could
encounter.
3. Logic Diagram – This is a graphical representation of a logic
circuit that shows the wiring and connections of
each individual logic gate, represented by a
specific graphical symbol, that implements the logic circuit.
© 2020 e-Learning Centre, UCSC
4
Classification of Combinational Logic
Multiplexers
Data Transmission
Decoders
Classification of Arithmetic & Adders
Combinational Logic Logical Functions Subtractors
BCD to 7 segment
Code Converters
converter
© 2020 e-Learning Centre, UCSC
5
4.1 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.
• There are two main types of Adders:
1)half adder.
2) full adder
© 2020 e-Learning Centre, UCSC
6
© 2020 e-Learning Centre, UCSC
7
4.1.1 Half Adder
• Finds the sum of two bits
• The sum can be found using the
XOR operation and the carry using
the AND operation.
© 2020 e-Learning Centre, UCSC
8
4.1.2 Full Adder
• Full Adder is the adder which adds three inputs and produces
two outputs. The first two inputs are A and B and the third
input is an input carry (as C-IN). The output carry is designated
as C-OUT and the normal output is designated as S which is
SUM.
© 2020 e-Learning Centre, UCSC
9
4.1.2 Full Adder cont.….
• The truth table for a full adder is:
@ 2020 e-Learning Centre, UCSC
10
4.1.3 Full Adder using Half Adders
• We can use half adders to construct a full adder by
including gates for processing the carry bit.
• 2 Half Adders and a OR gate is required to implement
a Full Adder.
© 2020 e-Learning Centre, UCSC
11
4.1.4 Ripple-carry Adder (I)
• A single adder can add only two single bit numbers.
• To add multiple bit numbers, we can construct a circuit by
combining a series of full adders (see the figure at the
bottom).
• The carry bit “ripples” from one adder to the next; hence,
this configuration is called a ripple-carry adder.
• This will help to create Adders which can add two numbers
with multiple bits.
Y15 …. Y1 Y0
+
X15 …. X1 X0
O15 …. O1 O0
12 12
© 2020 e-Learning Centre, UCSC
12
4.1.4 Ripple-carry Adder (II)…
© 2020 e-Learning Centre, UCSC
13
13
4.2 Decoder
• Binary code of N digits can be used to store 2N distinct
elements of coded information. This is what encoders and
decoders are used for. Encoders convert 2N lines of input
into a code of N bits(inputs) and Decoders decode the N
bits into 2N lines.
• Ex. Decoder can be used to select a memory location
according a binary value placed on the address lines of a
memory bus.
© 2020 e-Learning Centre, UCSC
14
14
2-to-4 Decoder
© 2020 e-Learning Centre, UCSC
15
15
4.3 Multiplexer
• It is a combinational circuit which have many inputs and a
single output depending on the control signal to select
which input to be on output.
• For N input lines, logn(base2) selection lines, or we can say
that for 2n input lines, n selection lines are required.
• Multiplexers are also known as “Data n selector, parallel
to serial convertor, many to one circuit, universal logic
circuit”.
• Multiplexers are mainly used to increase amount of the
data that can be sent over the network within certain
amount of time and bandwidth.
© 2020 e-Learning Centre, UCSC
16
16
Activity 01 : 4-to-1 Multiplexer
If S0 = 1 and S1 = 0,
which input is
selected as output?
© 2020 e-Learning Centre, UCSC
17
17
3.The simple switch-and-diode circuit shown here is an example
of a digital encoder. Explain what this circuit does, as the switch
is moved from position to position:
© 2020 e-Learning Centre, UCSC
1919
4.4 Arithmetic Logic Unit (ALU)
© 2020 e-Learning Centre, UCSC
20
20
• Computers need to do more than just addition
• arithmetic operations: + – * / %
• logical operations: & | ~ << >>
• Need a circuit that can select operation to perform
• ALUs routinely perform the following operations:
• Logical Operations: These include AND, OR, NOT, XOR,
NOR, NAND, etc.
• Bit-Shifting Operations: This pertains to shifting the
positions of the bits by a certain number of places to the
right or left, which is considered a multiplication operation.
• Arithmetic Operations: This refers to bit addition and
subtraction. Although multiplication and division are
sometimes used, these operations are more expensive to
make. Addition can be used to substitute for multiplication
and subtraction for division.
© 2020 e-Learning Centre, UCSC
21
21
Arithmetic Logic Unit (ALU) - Example
© 2020 e-Learning Centre, UCSC
22
22
Sequential Logic Circuits
• Combinational logic circuits are perfect for situations which
require the immediate application of a Boolean function to a
set of inputs
• But, there are times when we need a circuit to change its value
with consideration to its current state as well as its inputs
• Therefore, these circuits must “remember” their current state
• Sequential Logic Circuits use flip-flops as memory elements
and in which their output is dependent on the input state
© 2020 e-Learning Centre, UCSC
23
23
© 2020 e-Learning Centre, UCSC
24
24
Sequential Logic Circuits cont.…
sequential logic circuits can be divided into the following three main
categories:
1. Event Driven – asynchronous circuits that change state
immediately when enabled.
2. Clock Driven – synchronous circuits that are synchronized to a
specific clock signal.
3. Pulse Driven – which is a combination of the two that
responds to triggering pulses.
© 2020 e-Learning Centre, UCSC
25
25
Sequencing Events
• Sequential logic circuits require a means by which events
can be sequenced
• State changes are controlled by clocks
• A “clock” is a special circuit that sends electrical pulses
through a circuit
• Clocks produce electrical waveforms such as this one
© 2020 e-Learning Centre, UCSC
26
26
Feedback in Sequential Logic Circuits
• Sequential circuits rely on feedback to retain their state
values
• Feedback in digital circuits occurs when an output is
looped back to the input
• Example,
• If Q is 0 it will always be 0, if it is 1, it will always be 1
© 2020 e-Learning Centre, UCSC
27
27
4.5 Flip Flop
• Flip flop is a sequential circuit which generally samples its
inputs and changes its outputs only at particular instants of
time (not continuously).
• Flip flop is said to be edge sensitive or edge triggered rather
than being level triggered like latches.
• The most common types of flip flops are:
• SR flip-flop: Is similar to an SR latch. Besides the CLOCK input, an SR
flip-flop has two inputs, labeled SET and RESET.
• D flip-flop: Has just one input in addition to the CLOCK input. This
input is called the DATA input.
• JK flip-flop: A JK flip-flop has two inputs, labeled J and K. The J input
corresponds to the SET input in an SR flip-flop, and the
K input corresponds to the RESET input.
© 2020 e-Learning Centre, UCSC
2828
SR Flip-flop (Set-Reset)
• The SR flip-flop, also known as a SR Latch.
• This has two inputs, one which will “SET” the device (meaning
the output = “1”), and is labelled S and one which will
“RESET” the device (meaning the output = “0”), labelled R.
• The behavior of an SR flip flop is described by a characteristic
table
• Q(t) output at time t
• Q(t+1) output after the next clock pulse
© 2020 e-Learning Centre, UCSC
29
SR Flip-flop: Block Diagram
© 2020 e-Learning Centre, UCSC
30
SR Flip-flop: Circuit Diagram
© 2020 e-Learning Centre, UCSC
31
SR Flip-flop: Truth Table
© 2020 e-Learning Centre, UCSC
32
JK Flip-flop (Jack Kilby)
• Modified version of the SR flip-flop to provide a stable
state when both inputs are 1.
• Master Slave JK FF is a cascade of two SR FF with feedback
from the output of second to input of first. Master is a
positive level triggered. But due to the presence of the
inverter in the clock line, the slave will respond to the
negative level. Hence when the clock = 1 (positive level) the
master is active and the slave is inactive. Whereas when
clock = 0 (low level) the slave is active and master is
inactive
© 2020 e-Learning Centre, UCSC
33
33
JK Flip-flop: Circuit Diagram
© 2020 e-Learning Centre, UCSC
34
34
JK Flip-flop: Truth Table
© 2020 e-Learning Centre, UCSC
35
35
JK Flip-flop: Binary Counter
• The low-order bit is
complemented at each clock
pulse
• Whenever it changes from 1 to
0, the next bit is
complemented, and so on
through the other flip-flops
© 2020 e-Learning Centre, UCSC
36
D Flip-flop (Data)
• Fundamental circuit of computer
memory.
• Used to store 1 bit.
• Can be implemented with gates.
• Also known as Data Latch, Delay flip
flop, D-type Bistable, D-type Flip
Flop or just simply a D Flip Flop
• Not combinatorial logic
• because current output may
depend on previous state
• Example of sequential logic
• current output depends on
inputs and prior output
© 2020 e-Learning Centre, UCSC
37
37
D Flip-flop
© 2020 e-Learning Centre, UCSC
38
38
D Flip-flop: Writing
39
© 2020 e-Learning Centre, UCSC
39
D Flip-flop: Reading
© 2020 e-Learning Centre, UCSC
40
40
D Flip-flop: Block Diagram
© 2020 e-Learning Centre, UCSC
41
41
D Flip-flop: 4-bit Register
© 2020 e-Learning Centre, UCSC
42
42
Memory
• Memory can store many bits independently
• register banks contain many flip-flops
• Need to identify which bit (flip-flop) to read or write
• Give each flip-flop a unique number (address)
© 2020 e-Learning Centre, UCSC
43
43
Memory: Circuit Diagram
© 2020 e-Learning Centre, UCSC
44
44
Memory: Writing
© 2020 e-Learning Centre, UCSC
4545
Memory: Reading
© 2020 e-Learning Centre, UCSC
4646
Memory: 4-words, 3 bits/word
© 2020 e-Learning Centre, UCSC
4747
Activity - 03
• Determine the final output states over time for the following circuit, built
from D-type gated latches:
At what specific times in the pulse diagram does the final output assume the
input’s state? How does this behavior differ from the normal response of a
D-type latch?
© 2020 e-Learning Centre, UCSC
48
2.Determine the output states for this J-K flip-flop, given the
pulse inputs shown:
© 2020 e-Learning Centre, UCSC
49
49
Pre- requites
• Computers are implementations of Boolean logic.
• Boolean functions are completely described by Truth Tables.
• Logic gates are small circuits that implement Boolean
operators.
• The basic gates are AND, OR and NOT.
• The “universal gates” are NOR and NAND.
© 2020 e-Learning Centre, UCSC
50
Summary
• Computer circuits consist of combinational logic circuits
and sequential logic circuits
• Combinational circuits produce outputs (almost)
immediately when their inputs change
• Sequential circuits have internal states as well as
combinations of input and output logic
• The outputs may also depend on the states left behind
by previous inputs
• Sequential circuits may require clocks to control their
changes of state
• The basic sequential circuit unit is the flip-flop
© 2020 e-Learning Centre, UCSC
51
51