Combinational Circuits
Combinational Circuits
SAMPLE OF THE STUDY MATERIAL PART OF CHAPTER 5 Combinational & Sequential Circuits
5.1 Introduction
Digital circuits can be classified into two types: Combinational digital circuits and Sequential digital circuits.
Page : 218
Digital Electronics
Page : 219
Digital Electronics
In this memory device, if A and Q are initially at logic 0, then Q remains at logic 0. However if the single input A ever becomes a logic 1, then the output Q will be logic 1 ever after, regardless of any further changes in the input at A. In this simple memory, the output is a function of the state of the memory element only; after the memory is ``written'' then it cannot be changed back. However, it can be ``read.'' Such a device could be used as a simple read only memory, which could be ``programmed'' only once. Often a state table or timing diagram is used to describe the behavior of a sequential device. Figure 5.4 shows both a state table and a timing diagram for this simple memory. The state table shows the state which the device enters after an input (the ``next state''), for all possible states and inputs. For this device, the output is the value stored in the memory
Present State 0 0 1 1 State table Input Next State A 0 0 1 1 0 1 1 1 Output 0 1 1 1 A time
Fig. 5.4 Sequential Circuit Timing Diagram Note that the output of the memory is used as one of the inputs; this is called feedback and is characteristic of programmable memory devices. (Without feedback, a ``permanent'' electronic memory device would not be possible.) The use of feedback in a device can introduce problems which are not found in strictly combinational circuits. In particular, it is possible to inadvertently construct devices for which the output is not determined by the inputs, and for which it is not possible to predict the output. A simple example is an inverter with its input connected to its output. Such a device is logically inconsistent; in a physical implementation the device would probably either oscillate from 1 to 0 to 1 or remain at an intermediate value between logic 0 and logic 1, producing an invalid and erroneous output. Examples for sequential digital circuits are Registers, Shift register, Counters etc.
Page : 220
Digital Electronics
Half Adder: A half adder is a logical circuit that performs an addition operation on two binary digits. The half adder produces a sum and a carry value which are both binary digits. X 0 0 1 1 Sum = Carry = XY X Y H. A. Sum Carry X Y Sum = X Carry = XY Fig 5.5 Half Adder Y Y 0 1 0 1 Carry 0 0 0 1 Sum 0 1 1 0
Borrow =X
Fig. 5.6 Half Subtractor Half adder can be converted into half subtractor with an additional inverter. Full adder: Full adder circuit adds three bit binary numbers (X,Y,Z) & outputs two nos. of one bit binary numbers, Sum & Carry.
Page : 221
Digital Electronics X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1
Carry 0 0 0 1 0 1 1 1
Carry
Fig. 5.7 Full Adder Full adder can be implemented by using two half adders and an OR gate. X Y Z X Y Z H.A. H.A. Sum Carry
Sum
Carry
Fig. 5.8 Full Adder Full subtractor: It subtracts one bit from the other by taking pervious borrow into account and generates difference and borrow
Page : 222
Digital Electronics
Truth Table X 0 0 0 0 1 1 1 1 Y Z 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1
Borrow 0 1 1 1 0 0 0 1
F.S.
Fig. 5.9 Full Subtractor Full subtractor can be implemented by using two half- subtractors and an OR gate. X Y Z X Y Z H.S H.S Diff.
Borrow
Diff.
Borrow
Fig. 5.10 Full Subtractor Full adder can be converted into full subtractor with an additional inverter. Four bit binary parallel adder can be constructed by using three full adders and one half adder or by using four full adders with input carry for least significant bit full adder is zero. Four bit binary parallel adder shown in figure is also called as Ripple carry adder.
Page : 223
Digital Electronics B3 A3 B2 A2
FA3 Cout S3 B3 A3
FA2 S2 B2 A2
FA1 S1 B1 A1
FA0 S0 B0 A0
Cin=0
FA3 Cout S3
FA2 S2
FA1 S1
HA S0
Fig. 5.11 Binary Parallel Adder Carry Look- Ahead adder is faster than ripple carry adder.
Example:
Implement Boolean function F = using half adder.
Solution:
F = AB = AB = (AB) A B HA C C Fig. 5.12 Decoder: A decoder is a logic circuit that converts an n bit binary input code into M (=2n) output lines such that each output line will be activated for only one of the possible combinations of inputs. (OR) A decoder is a Combinational circuit that converts binary information from n input lines to a maximum of 2n unique output lines. E.g. 2 4 line Decoder (it is also called one four line decoder)
Page : 224
C S HA S C F= (AB) C
Digital Electronics
Decoders are available in two different types of output forms: (1) Active high output type decoders and (2) Active low output type of decoders. Active high output type of decoders are constructed with AND gates and active low output type of decoders are constructed with NAND gates. Truth table of active high output type of decoder is given below: Y X Y 0 0 0 1 1 0 1 1
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
X 2 Y
Fig. 5.13 Binary Decoder with Active High Output Active low output types of decoders will give the output low for given input combination and all other outputs are high. Truth table of active low output type of decoder Y X Y 0 0 0 1 1 0 1 1
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0
X 2 Y
Fig. 5.14 Binary Decoder with Active Low Output 3 to 8 line decoder is also called Binary-to-Octal decoder or converter. It is also called 1of 8 decoder, because only one of the 8 outputs is active at a time.
Page : 225
Digital Electronics
Decoders are widely used in the memory system of computer, where they respond to the address code input from the CPU to activate the memory storage location specified by the address code. Decoders are also used to convert binary data to a form suitable for displaying on decimal read outs. Decoders can be used to implement combinational circuits, Boolean functions etc.
X Y Z
decoder
Fig 5.15
Example:
Implement 3 decoder using decoder.
Solution:
Page : 226
Digital Electronics
Fig 5.16 Demultiplexer: A decoder with enable input, acts as demultiplexer. "Demultiplexer", is a logical circuit that takes a single input source and sends it to one of several 2n possible output lines. The selection of specific output line is controlled by the bit values of n selection lines. E 1 0 0 0 0 A X 0 0 1 1 B X 0 1 0 1 E i/p
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
5.5 Multiplexer
A multiplexer or mux is a device that selects one of several analog or digital input signals and forwards the selected input into a single line. A multiplexer of 2n inputs has n select lines, which are used to select which input line to send to the output.
Page : 227
Digital Electronics
Fig. 5.18 Binary Multiplexer Multiplexers can be used for the implementation of Boolean functions, combinational circuits. They can also used for parallel to serial conversion. Multiplexer is also called data selector or universal circuit. All three variable Boolean equations can be implemented by using 8 1 multiplexer without using any additional gates. Some but not all three variable Boolean equations can also be implemented with 4 1 mux without using any additional gates.
with
mux
Page : 228
Digital Electronics
When AB = 00, F is equal to C, similarly for all other combinations of AB, input to mux is defined in terms of C. Encoder: A decoder identifies a particular code present at the input terminals of the circuit. The inverse process is called Encoding.An Encoder has number of inputs (2n) one and only one of which is in the high state or active, and an n-bit code is generated upon which of the inputs is excited. An encoder is a digital function that produces a reverse operation from that of a decoder. An encoder has (2n or less) input lines and n output lines. The output lines generate the binary code for the input variables. An example of an encoder shown in fig. The octal to binary encoder consists of eight inputs, one for each of the digits, and three outputs that generate the corresponding binary number. The encoder in figure below assumes that only one input line can be equal to 1 at any time; otherwise the circuit has no meaning. Note that the circuit has eight inputs and could have =256 possible input combinations. Only eight of these combinations have any meaning. The other inputs combinations are dont care conditions.
Fig. 5.20 Octal to Binary Encoder ROM (read Only Memory): ROM is nothing but the combination of decoder and Encoder. It is a semi conductor memory and which is a permanent memory, ROM can also be defined as a Simple Code conversion unit. M outputs N inputs Fig. 5.21
Page : 229
Digital Electronics
ROM = Fixed AND, Programmable OR PAL = Programmable AND, Fixed OR PLA = Programmable AND, Programmable OR.
Important Points
Two cross coupled inverters will form a basic latch which can store one bit of information. Flip-flops: Flip-Flop is also called Bistable multivibrator. It can store one bit of information. In a flip-flop one output is always complement of the other output. Flip-flop has two stable states.
Fig. 5.22 Clocked SR flip-flop The disadvantage of S-R flip-flop is for S=1, R=1 output cannot be determined. This can be eliminated in J-K flip-flop. S-R flip flop can be converted to J-K flip-flop by using the two equation S=JQ and R= KQ.
Page : 230
Digital Electronics
5.7 JK-flip-flop
A JK flip-flop is a refinement of the SR flip-flop in that the indeterminate state of the SR type is defined in the JK type. Inputs J and K behave like inputs S and R to set and clear the flipflop (note that in a JK flip-flop, the letter J is for set and the letter K is for clear). When logic 1 inputs are applied to both J and K simultaneously, the flip-flop switches to its complement state, ie., if Q=1, it switches to Q=0 and vice versa. A clocked JK flip-flop is shown in figure below. Output Q is ANDed with K and CP inputs so that the flip-flop is cleared during a clock pulse only if Q was previously 1. Similarly, ouput Q' is ANDed with J and CP inputs so that the flip-flop is set with a clock pulse only if Q' was previously 1. Note that because of the feedback connection in the JK flip-flop, a CP signal which remains a 1 (while J=K=1) after the outputs have been complemented once will cause repeated and continuous transitions of the outputs. To avoid this, the clock pulses must have a time duration less than the propagation delay through the flip-flop. The restriction on the pulse width can be eliminated with a master-slave or edge-triggered construction. The same reasoning also applies to the T flip-flop presented next.
K
Q CP
J K
CP J
Q 0 0 0 0 1 1 1 1
J 0 0 1 1 0 0 1 1
K 0 1 0 1 0 1 0 1
Q(t+1) 0 0 1 1 1 0 1 0
S Clk
P Q
J Clk K
R C
Fig 5.24 Race around problem is present in the J-K flip flop, when both J=K=1. Toggling the output more than one during the clock pulse is called Race around Problem. The race around problem in J-K flip-flop can be eliminated by using edge triggered flip-flop or master slave J-K flip flop or by the clock signal whose pulse width is less than or equal to the propagation delay of flip-flop. Master-slave flip-flop is a cascading of two J-K flip-flops. Positive or direct clock pulses are applied to master and inverted clock pulses are applied to the slave flip-flop.
5.8 D-flip-flop
The D flip-flop shown in figure below is a modification of the clocked SR flip-flop. The D input goes directly into the S input and the complement of the D input goes to the R input. The D input is sampled during the occurrence of a clock pulse. If it is 1, the flip-flop is switched to the set state (unless it was already set). If it is 0, the flip-flop switches to the clear state. K Q CP CP D Q
Page : 232
Digital Electronics Q 0 0 1 1 D 0 1 0 1
(C) D Flip-flop Transition table Fig. 5.25 Clocked D flip-flop It is also called a Delay flip-flop. By connecting an inverter in between J and K input terminals, D flip-flop is obtained. K always receives the compliment of J. Truth table
D 0 1
J Clk K
0 1
Q Q
D Clk
Q Q
Fig. 5.26 Implementation of D Flip Flop Using JK Flip Flop D flip-flop is used to provide delay. The bit on the D line is transferred to the output at the next clock pulse.
5.9 T Flip-flop
The T flip-flop is a single input version of the JK flip-flop. As shown in figure below, the T flipflop is obtained from the JK type if both inputs are tied together. The output of the T flip-flop "toggles" with each clock pulse.
K CP
Q CP
T K
Page : 233
Digital Electronics Q 0 0 1 1 T 0 1 0 1
(C) T Flip-flop Transition table Fig. 5.27 Clocked T flip-flop Truth table T 0 1 T
J Clk K
Q Q
T Clk
Q Q
Fig. 5.28 Implementation of T Flip Flop Using JK Flip Flop If X KHz clock signal is applied to a T flip flop when T=1, then the output (Q) signal frequency is given by X/2KHz. Thus it acts as a frequency divider.
Setup Time (t s ): Time interval immediately preceding the active transition of clock signal
during which the control input must be maintained at the proper level.
Hold Time (t H ): The time interval immediately following the active transition of the clock
signal during which the synchronous control input must be maintained at the proper level.
Page : 234
Digital Electronics
Clock
Clock
Hold time
Universal Shift Register: A register which is able to shift the information from left to
right or from right to left and which can perform all four operations is called universal shift register.
Digital Electronics
4. Multiplication and Division. 5. Ring counter and twisted ring counter. 6. Digital delay line (serial input and serial output operations). Left shift operation is nothing but multiplied by 2. Eg: Q 3 Q 2 Q1 Q0
=5
= 10
Shift left by n positions is equivalent to multiplication by 2n. If least significant bit = 0, then right shift operation by one position is same as Division by 2. Eg: Q 3 Q 2 Q 1 Q 0
=10
=5
=5
0 0
=2 (instead of 2.5)
Ring Counter: Shift register can be used as ring counter when Q 0 output terminal is
connected to serial input terminal. An n-bit ring counter can have n different output states. It can count n-clock pulses. Ring Counter
Page : 236
Digital Electronics
Fig. 5.30 Mod 3, divide by 3 counter, N : 1 counter Twisted Ring counter: It is also called Johnsons Ring counter. It is formed when output terminal is connected to the serial input terminal of the shift register. An n-bit twisted ring counter can have maximum of 2n different output states. Twisted Ring Counter is also called Johnson counter.
5.11 COUNTERS
The Counter is driven by a clock signal and can be used to count the number of clock cycles. Counter is nothing but a frequency divider circuit. Two types of counters are available: 1. Synchronous. 2. Asynchronous.
Page : 237
Digital Electronics
Synchronous counters are also called parallel counters. In this type clock pulses are applied simultaneously to all the flip-flops. Asynchronous counters are also called Ripple or serial counters. In this type of counters the output of one flip-flop is connected to the clock input of next flip-flop and so on.
1 clk 1
J CL K
J CL K
J CL
K 1
Fig. 5.33 For up counter, X = 1 So, clk = Q For down counter, X = 0 So, clk = A counter having n-flip-flops can have 2n output states i.e. it can count 2n clock pulses (0 to 2n 1). The largest binary number that can be represented by an n-bit counter has a decimal equivalent of (2n - 1). Example. : n = 3, then 2n - 1 = 23 - 1 = 7. A counter can be made to count either in the up mode or in the down mode. Synchronous counters are faster than asynchronous counters.
Page : 238
Digital Electronics
The modulus of a counter is the total number of states through which the counter can progress. For example mod-8 counter is having 8 different states (000 to 111). The output signal frequency of Mod-n counter is 1/n th of the input clock frequency. Hence that counter is also called divide by n counter. The number of flip-flops (n) required to construct Mod N counter can be obtained from the following formula: 2n-1 < N 2n. A decade counter is also called Mod- 10 or divide by 10 counter requires 4 flip-flops. Any binary counter can be a modulus counter where as the modulus counter need not be a binary counter. Six flip-flops are required to construct mod-60 counter. Two types of synchronous counters are available. 1. Series carry 2. Parallel carry.
Page : 239