Digital Logic Design Notes from www.exploreroots.com Page 1 DIGITAL CIRCUITS: COMBINATIONAL CIRCUITS The digital circuits are of 2 types: 1.Combinational circuits: In this type of circuits, output depends only on present inputs and we don’t need memory element. 1.Sequential circuits: In this type of circuits output depends on both present inputs and past output hence we need memory elements. We’ll first study combinational circuits.Combinational circuits: Combinational circuits consist of input binary variables, logic gates and output binary variables. While considering the design of combinational circuits we need to see that we use minimum number of gates, we have minimum propagation time or delay etc ADDERS: Lets design the combinatonal circuit for binary adder. A combinational circuit that performs the addition of two bits is called Half adderwhile the circuit which adds 3 bits is called Full adder. Half adder: For this adder we have two inputs and two outputs. The two inputs are those 2 bits a and b which are to be added and the the 2 outputs are the sum and the carry. The following table shows the result of different combinations of inputs: a b S(sum) C(carry) 0 0 0 0 1 0 1 0 0 1 1 0 1 1 0 1 Now we can see from the table that carry is one only when both inputs are 1 while sum is 1 when only one of the two is 1 like a XOR gate.So
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Digital Logic Design Notes from www.exploreroots.com Page 1
DIGITAL CIRCUITS:
COMBINATIONAL CIRCUITS
The digital circuits are of 2 types:
1. Combinational circuits: In this type of circuits, output depends only on present
inputs and we don’t need memory element.
1. Sequential circuits: In this type of circuits output depends on both present inputs
and past output hence we need memory elements.
We’ll first study combinational circuits.
Combinational circuits: Combinational circuits consist of input binary variables, logicgates and output binary variables. While considering the design of combinational circuitswe need to see that we use minimum number of gates, we have minimum propagation timeor delay etc
ADDERS:
Lets design the combinatonal circuit for binary adder. A combinational circuit that performsthe addition of two bits is called Half adder while the circuit which adds 3 bits is called Fulladder .
Half adder: For this adder we have two inputs and two outputs. The two inputs are those 2bits a and b which are to be added and the the 2 outputs are the sum and the carry. Thefollowing table shows the result of different combinations of inputs:
a b S(sum) C(carry)
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1
Now we can see from the table that carry is one only when both inputs are 1 while sum is 1when only one of the two is 1 like a XOR gate.So
Digital Logic Design Notes from www.exploreroots.com Page 3
FULL ADDER(FA):
The full adder has 3 inputs and 2 ouputs. The first 2 inputs are the 2 bits a & b to add whilethe 3rd input c is the carry from the previous significant bit while the outputs are the same:sum S and the carry C. The following table shows the result of different combinations of inputs:
a b c S(sum) C(carry)
0 0 0 0 0
0 1 0 1 0
1 0 0 1 0
1 1 0 0 1
0 0 1 1 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 1
K-map for the output variable SUM is as follow:
This circuit is a level 3 circuit as we also need inverters at level 1, then we have 4 3-input AND gates at level 2 and 4-input OR gate at level 3. So we need 3 gate delays (3Δ) to get
Digital Logic Design Notes from www.exploreroots.com Page 4
When we implement this circuit we see that this is a level 2 circuit as we have AND gates atlevel 1 and 3-input OR gate at level 2 and hence we need 2 gate delays (2Δ) to get carryoutput.
Lets now put the equations in different form:
S = ab’c’ + a’b’c + a’bc’ + abc = Σ (1,2,4,7)
= b’ (ac’ + a’c) + b (a’c’ + ac) = b’ (ac’ + a’c) + b (ac’ + a’c)’
=b’ (a xor c) + b (a xor c)’ {We know (ac’ + a’c)’ = a’c’ + ac and a’c + ac’ =a xor c}
= b’z + z’b= b xor z {z= (a xor c)}
= b xor a xor c
S = a xor b xor c
and C = ab + ac + bc = ab(c + c’) + ac (b + b’) + bc (a + a’) = abc + abc’ + abc + ab’c + abc+ a’bc = abc +a’bc+ab’c+abc’= Σ(3,5,6,7)
So we can draw the circuits using XOR, NOT, AND & OR gates
So we can vary the value of b to get a different number system. We specify the value of thebase as suffix to the number to represent which number system is being used. There arefollowing number systems which are generally used to represent a value.
Digital Logic Design Notes from www.exploreroots.com Page 6
Serial adder:
This is the one which would accept bit by bit input of the n-bit numbers and there is a bit bybit output of the n-bit Sum. In this adder we would be required one full adder and a memoryelement.
Hence we see we require lesser hardware. The circuit for serial addition is as follow:
Parallel adder:
Parallel adder is the one where we input the all the bits of two given numbers and we don’tneed any memory element.
Carry propagate adder (CPA) or Ripple carry adder: In this adder we need n full addersfor n bit adder. In this adder we use the n full adders in cascaded from to implement theripple carry adder. This type of adder is also called carry propagation adder. The circuit for 4-bit parallel adder is as follow:
Let’s now calculate the time required for the carry to propagate from adder 1 to last adder and when we get the final result.
If at time t=0 we input the variables, we’ll the carry of 1st adder at t=2Δ which would be
propagated to 2nd adder and at t=3Δ we get the sum variable S1. When at t=2Δ carry C1 ispropagated to 2nd adder, we get the carry output of 2nd adder at t=4Δ and at t=5Δ we getthe S2. At t=4Δ we have carry available at
Digital Logic Design Notes from www.exploreroots.com Page 7
3rd adder so its carry output comes at t=6Δ and sum output comes at t=7Δ. Similarly weget the final carry of 4 bit parallel adder at t=8Δ and sum S4 & hence complete output att=9Δ.
And for n-bit adder we have the total time taken as 2 * (n-1) Δ + 3Δ = (2n+1) Δ
For 16-bit adder we have the
Time delay= (2*16+1) Δ = 33Δ
which is quiet large
Carry look-ahead adder (CLA):
We know that Ci+1 is dependent on previous carry Ci as follow relation:
Ci+1 =Ai Bi + Ai Ci +Bi Ci
which can be written as Ci+1 = Gi + Pi Ci
Gi is called carry generate function as it generates carry when A i =1 & Bi =1 and Pi is calledcarry propagate function because it propagates the carry when we have A i =1 or Bi =1.Using these Gi and Pi we can get following equations:
These equations suggest that C2, C3, C4, C5 can be calculated from C1 directly. Hence it
is called carry look ahead adder. This is a 4 stage circuit.
We have AND gates at level 1 and OR gate at level 2 in the circuit. Also fan-in of the ORgate in level 2 & that of AND gate is 5 and we have a maximum fan-in of about 8 So wecan’t extend this circuit to higher stage carry look ahead but can use this 4-stage circuit incascaded form. In the following diagram we have cascaded two 4-stage circuits to make itfor 8 bit adder.
Digital Logic Design Notes from www.exploreroots.com Page 8
So if we have all Gi and Pi and C1 available then we can calculate all the carries only ingate delay equal to 2Δ and we can obtain all Gi and Pi from the inputs in 1 gate delay(1Δ ).Hence we can calculate the carry in 3 gate delays (3Δ) for 4-stage circuit to calculate C4and to obtain the S5 we need 3 gate delays (3Δ). Hence we need a total of 6 gate delays
(6Δ) for 4-stage CLA circuit.
For a 16-bit adder we need total delay= Δ + 2Δ + 2Δ + 2Δ + 2Δ + 3Δ = 12Δ which is alsoillustrated below:
so we see that we have been able to reduce the delay for a 16 bit adder from 33Δ to 12Δwhich is lesser by a factor of about 3 times.
Digital Logic Design Notes from www.exploreroots.com Page 9
Q-Implement BCD to Excess 3 converter using parallel adder.
Ans: As we know to get Excess-3 from BCD we need to add 3 (0011) to the BCD number.So the circuit to implement the above is:
Subtractors:
Similar to the adder, we can also design subtractors and we also have half and fullsubtractors.
Half subtractor (HS): This circuit subtracts two bits and gives Borrow and Differenceas 2outputs. The following table shows the result for different combinations of inputs:
a b B(borrow) D(difference)= D = a – b
0 0 0 0
1 0 0 1
0 1 1 1
1 1 0 0
We scan easily see that diference is 1 only when we have one of the inputs as 1 and other as 0 just like a XOR gate. So equation for difference is D= a’b + ab’
Digital Logic Design Notes from www.exploreroots.com Page 11
Full subtractor (FS):
This has 3 inputs- 2 are the numbers to be subtracted and c is the borrow which is taken for previous bit and we have 2 outputs Difference and the Borrow. The following table showsthe results for all combinations of inputs:
a b c B(borrow) D(difference)= D = a – b – c
0 0 0 0 0
0 1 0 1 1
1 0 0 0 1
1 1 0 0 0
0 0 1 1 1
0 1 1 1 0
1 0 1 0 0
1 1 1 1 1
So we can get the equations for the D and B from the K-maps as shown on next page.
K-map for the output variable Difference is as follow:
We need 3 gate delays (3Δ) to get the output.
K-map for the variable Borrow is as follow:
Note that we have taken opposite values of variable a in the K-map.
Digital Logic Design Notes from www.exploreroots.com Page 12
We can get the output in 2 gate delays as we assume that a, b the input numbers arestored in flipflops hence we can have the complimented a from the flipflop directly. So wedon’t consider the delay of the inverter shown in the circuit.
Similar to the adder we have D = ab’c’ + a’b’c + a’bc’ + abc = a xor b xor c
And B= a’b + a’c + bc
And we have the following circuit diagram for full subtractor:
Similar to the adder circuit we have the delay for borrow look ahead subtractor is for a 16-bit adder as
= Δ + 2Δ + 2Δ + 2Δ + 2Δ + 3Δ = 12Δ which is also illustrated below:
And delay is reduced by factor of 3.
Subtraction using adder:
We can also do subtraction using adders. As we have already studied that we can dosubtraction by 2’s compliment method in which we add 2’s compliment of subtrahend tominuend and 2’s compliment can be found by inverting all bits of subtrahend and thenadding one. So we have to do as
F= A – B = A + 2’S compliment of B = A + 1’S compliment of B + 1
So we give A at one input, invert of B at 2nd input and give 1 at carry. Hence we implementthe above function.
Digital Logic Design Notes from www.exploreroots.com Page 16
4-bit ADDER and SUBTRACTOR in a SINGLE CIRCUIT
Q- Implement the 4-bit ADDER and SUBTRACTOR in a single circuit where we selectone of the two using a select pin SEL.
Ans: The following circuit would work as required: In this circuit we use property of XOR
gate by which XOR gate acts as a inverter when we have one input as 1.
When sel = 0 we get B1B2B3B4 un-complimented through XOR gate and also we havecarry to circuit as 0 hence we get the result as sum of A and B
Y = A + B
When sel = 0 we get B1B2B3B4 complimented through XOR gate (as one input of XORgate is 1) and also we have carry to circuit as 1 hence we get the result as difference of Aand B
Y = A – B
COMPARATORS
Here we’ll be designing circuits to compare different binary numbers. Suppose we havetwo numbers A & B at the input and 3 output as A>B, A=B, A<B and only one of the threeoutputs would be high accordingly if A is greater than or equal to or less than B.
1-bit comparator: Let’s begin with 1 bit comparator and from the name we can easilymake out that this circuit would be used to compare 1 bit binary numbers. If we list all theinput combinations at the input then we get the following table describing the correspondingoutputs.
Digital Logic Design Notes from www.exploreroots.com Page 19
We can also obtain these equations orally as for A1 A0 to be greater than B1B0 either A1 is
greater than B1 (i.e. A1=1 & B1=0) or A1 is equal to B1 (or A1is not less than B1i.e. (f(A1<B1))’= (A1’B1)’= (A1 + B1‘) & A0 is greater than B0 (i.e. A0=1 & B0=0).
Hence the equation we get is f (A>B) = A1B1‘+ (A1 + B1’) A0B0’ = A1B1‘+ A0 B1’B0’+ A1A0B0’
Digital Logic Design Notes from www.exploreroots.com Page 20
We can also get the equation orally similar to the above case.
Now we can implement the above equation easily. Similarly we can implement other higher comparators
OBTAINING HIGHER COMPARATOR USING LOWER COMPARATORS
Q-Can we implement higher comparator 4-bit comparator using 2-bit comparators.
Ans: Yes we can implement the above required as follow:
Firstly lower two bits of A & B are compared and then next bits and then next. We feed theresult of first 2 bits to lower bit of next comparator. Then we feed the result of thiscomparator to lower bit of next comparator. This way with the use of 3 2-bit comparators weget 4-bit comparator.
Digital Logic Design Notes from www.exploreroots.com Page 21
We firstly compare 11 (A1 A0) and 10 (B1B0) and we get a HIGH at f (A>B). Hence we put aHIGH at A0 & a LOW at B0 and A2 & B2 at A1 B1 pins of next comparator. So if A2 is greater than B2 then we get a high at f(A>B) for 3 bits and if A2 is less than B2then we get a highat f(A<B) for 3 bits and if A2 is equal to B2 then we compare A0and B0. Similarly we repeatthis and get the result.
Similarly we can obtain other higher bit comparators.
QUESTIONS
Q- Implement the function of 10-bit comparator using 4-bit comparators.
Ans: We can implement this as follow:
Decoders:
n to m decoder is the combinational circuit which convert binary information from n lines of
input to m lines of output and m=<2 n. Let’s have an example of 3 to 8 decoder. Thisencoder just puts the 1 on the line which is equal to the decimal equivalent of binarynumber abc2 at the input and 0 on the remaining lines. There is an ENABLE input whichwhen 0 activates the decoder circuit otherwise decoder is deactivated and it does notmatter what we have at the inputs any more. The following table shows the functioning of decoder:
Digital Logic Design Notes from www.exploreroots.com Page 23
When we have a=0 b=0 then top most decoder is enabled and 1 is placed on the outputline out of 0 to 3 based on the value of cd2
When we have a=0 b=1 then 2nd decoder from top is enabled and 1 is placed on the outputline out of 4 to 7 based on the value of cd2
When we have a=1 b=0 then 3rd decoder is enabled and 1 is placed on the output line outof 8 to 11 based on the value of cd2
When we have a=1 b=1 then bottom most decoder is enabled and 1 is placed on the outputline out of 12 to 15 based on the value of cd 2
Hence top 4 outputs generate min terms 0000 to 0011, next 4 generates min terms0100 to 0111, next generates 1000 to 1011 and the last 4 outputs generate min terms
1100 to 1111.
(b) Similarly we can obtain the circuit to obtain 4 to 16 decoder using 3 to 8 decodersHerefirst 8 outputs generate min terms 0000 to 0111 while next 8 generate 1000 to 1111.
Digital Logic Design Notes from www.exploreroots.com Page 24
Demultiplexer:It is a combinational circuit which receives 1-bit information and puts this information on theline which is selected by the binary input on the selection lines. This is different fromdecoder circuit as there is also an information line and we don’t have to put 1 every time onoutput (as in decoder) but the bit which is present on information line. It is also generallycalled by Demux.
Following is block representation for Demux
We can also have n-bit inputs in place of 1-bit inputs and hence we’ll have n-bit outputwhich can be represented as
Digital Logic Design Notes from www.exploreroots.com Page 25
This digital circuit does exact opposite of the function of a decoder. It converts theinformation from 2 n to n lines. The truth table is:
We can easily design the circuit diagram from this table. How ever if mistakenly we have ‘1’
at two of the inputs then we’ll have wrong answer from the circuit. But the encoders whichcome in the form of ICs are priority encoders. These encoders establish a priority to makesure that only highest input is encoded in case of two or more inputs. So if we have 1s atinput line 2 and 5, then we’ll have output as 101 as encoder would accept highest inputwhich is 5.
QUESTIONS
Q- Implement the Octal to Binary encoder (only first 8 numbers).
Ans: In this circuit, we have 8 inputs and 3 outputs. The octal number is feed into theencoder by placing a high (1) on the corresponding line and we get the binary equivalent asoutput.
From the above truth table we can easily get equations and implement the circuit.
Similarly we have decimal to binary encoder where we have 10 inputs and 4 outputs. The
decimal number is feed into the encoder by placing a high (1) on the corresponding line andwe get the binary equivalent as output.
Digital Logic Design Notes from www.exploreroots.com Page 26
Multiplexers:
It is a combinational circuit which selects one of the 2n input lines and transmits theinformation from that line to the output line. The selection of the input line depends upon the
‘n’ input selection lines. It is also called data selector and is also referred to by only MUX.
Smallest MUX we have is 2 to 1 mux which has 2 input lines, 1 output line and 1 selection line. We
also have 4 to 1, 8 to 1 mux and so on
Q- Implement the 2 to 1 MUX
Ans: Here we have 2 input, 1 selection pin and 1 output pin and truth table is
SEL(s) Y
0 D0
1 D1
So the equation for MUX can be written as
Y = s’D0 + sD1
which can be implemented using gates as follow:
For a 4 to 1 MUX we have total of 6 inputs (4 input lines and 2 selection lines). So we’llhave 64 combinations. The block representation and the truth table is as:
Digital Logic Design Notes from www.exploreroots.com Page 29
Ans: While implementing any function using MUX, if we have N variables in the functionthen we take (N-1) variables on the selection lines and 1 variable is used for inputs of MUX. As we have N-1 variables on selection lines we need to have 2 N-1 to 1 MUX. We just haveto connect A, A’, 0 or 1 to different input lines.
e.g. To implement the function F(A, B, C)= Σ (1, 2, 5, 7) using (a)8 to 1 MUX (b)4 to 1MUX
Ans: (a) We can implement it using all three variables at selection lines. We put 1 on themin term lines which are present in functions and 0 on the rest.
(b)F= A’B’C + A’BC’ + AB’C + ABC
N=3 so we use 2
N-1
= 2
2
= 4 to 1 MUX.
Suppose we have B, C on the selection lines. So when we have BC=00, put B=0, C=0 inthe function and we see output of the function should be 0 hence we connect 0 to 0th inputline.
When BC=01, then output of the function should be A’+ A = 1. Hence we connect 1 to 1st line.
When BC=10, then output of the function should be A’. Hence we connect A’ to 2nd line.
When BC=11, then output of the function should be A. Hence we connect A to 3 rd line.
Digital Logic Design Notes from www.exploreroots.com Page 30
BOOLEAN FUNCTION IMPLEMENTATION USING MUXes-PART II
Another procedure to implement the function using MUX
Take one variable for input lines and rest of the term for selection lines.
Then list the min terms with the variable selected in complimented form in 1st rowand list the
The min terms with variable selected in un-complimented form in 2nd row. Then encircle the min terms which are present in the function.
o If we have no circled variable in the column, then we put 0 on the
corresponding line
o If we have both circled variables, then we put 1 on the line
o If bottom variable is circled and top is not circled, apply A to input lineo If bottom variable is not circled and top is circled, apply A’ to input line
Digital Logic Design Notes from www.exploreroots.com Page 32
e.g. To implement the function F(A, B, C)= Σ (1, 2, 5, 7) using MUX usingdifferent variable as selection variable.
Let’s now take the variable B for input lines and A & C for selection lines. The min termswith B in compliment form are 0, 1, 4, 5 and the min terms with B in un-complimented formare 2, 3, 6, 7
So we list the min terms as follow:
So the circuit is as follow:
e.g. To implement the function F(A, B, C, D)= Σ (1, 2, 5, 7, 9, 14) using MUX
using different variable as selection variable.Let’s now take the variable A for input lines and B, C & D for selection lines.
N=4 so MUX is 2 N-1= 23 = 8 to 1
So min terms with A in compliment form are 0 – 7
So min terms with A in un-compliment form are 8 – 15
Digital Logic Design Notes from www.exploreroots.com Page 33
IMPLEMENTATION OF LOGIC GATES USING MUX
Q- Using 2 to 1 MUX implement the following 2-input gates: (a) OR (b) AND (c) NOR(d) NAND (e) XOR (f) XNOR (g) NOT.
Ans: To implement the above for every gate, either we can derive the different gates usingthe logic (the truth table) or the procedure to implement any function with MUX (discussedearlier)
(a)OR
Truth table:
So from above discussion we can derive the circuit as below:
Digital Logic Design Notes from www.exploreroots.com Page 44
Q- We are implementing a 3-input AND gate using the following circuit:
We can replace BLOCK with number of (a) Buffers or (b) Inverters. The delay of
buffer is Tp=2ns. Now we need to choose components such that we have proper output at F= X.Y.Z and the waveforms are as:
Ans: Now if we orally AND all 3 inputs we get that output of the circuit should be a LOWpulse although after a certain delay. So to ensure proper output at the output line F wehave to make sure that all the input signals reach the input lines of NOR gate after equaldelay.
If there is difference in delays then there would be many unwanted pulses.
We have F’ = X.Y.Z = X.Y + Z’ = INVERT(X AND Y) + INVERT (Z)
F = {INVERT(X AND Y)} NOR {INVERT (Z)}
As we need invert (Z) at input of OR gate. As there is already one inverter, hence while wedecide the components for BLOCK we have to make sure that output of the BLOCK isequal to Input of BLOCK.
Also as delay of inputs X & Y is 4+1 = 5 ns
Hence delay for input Z should also be 5 ns but delay of Z = delay (BLOCK) + delay(INVERTER)
Digital Logic Design Notes from www.exploreroots.com Page 46
And we get the required output.
Q- Now I make a certain change in the required output. The circuit is same asthe one in the above question but it is not required to be AND gate anymoreand output required is a HIGH pulse with width of 2 ns as:
Now one has to choose the BLOCK such that we get the above waveform as outputof the whole circuit.
Ans: In the previous question we had the 2 inputs of NOR gate as follow:
Digital Logic Design Notes from www.exploreroots.com Page 47
By modifying the BLOCK we can only change the 2nd I/P and 1st input would remain the same.Now if we analyze the required O/P also given below to see how we need to change the
2nd I/P
And we know that output is NOR of two inputs. And we get a ‘1’ only when we have ‘0’ atboth inputs.We need high pulse of width 2 ns so we need that both inputs remain ‘0’ for 2ns. Hence to get the required O/P we need to insert the extra delay of 2 ns to the 2nd pulse. And I/P pulses would be
As we just have to delay the 2nd pulse by 2 ns so we insert an extra buffer or two extrainverters in the BLOCK as shown on next page:
Digital Logic Design Notes from www.exploreroots.com Page 50
Q- Find out the situation when the following circuit of MUX 2 to 1 would notwork as expected and how can we eliminate the error.
Ans: When we have the static values at the inputs circuit would work fine but when ever
there is a transition in the value of Select pin we have a situation we neither of the two
inputs are selected. Following is the truth table for 2 to 1 MUX
SEL(s) Y
0 A
1 B
(a) Suppose we have the SEL = 1, then we have ‘B’ at the output and when we have SEL= 0we have ‘A’ at the output. But when there is a transition from SEL= 1 to SEL=0 there is
problem we face.
When we change SEL from 1 to 0, AND2 deactivates and hence ‘B’ is not passed and as wehave a delay of inverter, hence it would take 1 ns extra to activate the AND1 and hence even
A is not immediately passed. So we see that neither A nor B is passed to Z for this 1 ns.
(b) Suppose we have the SEL = 0, then we have ‘A’ at the output and when we have SEL=
1 we have ‘B’ at the output. But when there is a transition from SEL= 0 to SEL=1 there is
problem we face.
When we change SEL from 0 to 1, then it would take 1 ns extra to deactivate the AND1 and
hence input ‘A’ gets passed to OR gate for this 1 ns. Also immediately after the change of
SEL pin from 0 to1 we have the AND2 activated hence ‘B’ is also passed to OR gate for this
1 ns. So both the inputs A & B are passed to output for this 1 ns. But after the 1 ns we have
correctly only ‘B’ at the output
Hence we see that in both transitions we have error for period of 1 ns
To correct this we can have an extra Buffer in the circuit which has a delay same as that of
Digital Logic Design Notes from www.exploreroots.com Page 51
Q- Draw the circuit to check a PALINDROME number of even bits.
Ans: Palindrome number (in bits) is the number which is same whether seen from the firstand the last bit. E.g. 1001, 0110, 0000, 1111 in 4 bits
So to check this we need to have same value of bit at 1st bit and 4th bit, 2nd and 3rdbitposition for a 4-bit number. For a 6-bit number we need to have same bits at 1 stand 6th bit,2nd and 5th bit, 3rd and 4th bit positions.
Hence to check whether bits in different pairs have same value we need to have XNORgate and then AND them to see whether all pairs satisfy the condition.
Digital Logic Design Notes from www.exploreroots.com Page 52
We can verify this for a 4-bit number as done next.
So K-map for that is as
And hence we see that we need to XNOR the corresponding bits and then take AND of alloutputs of XNORs
Q- Design and implement the following with a combinational circuit (with Aand B being 4-bit numbers):
S1 S0 Output
0 0 A plus B
0 1 left shift A
1 0 A plus B plus 1
1 1 2A + 1
Ans: We need one 4-bit parallel ADDER and MUX to implement the above. As wecan see that we need atleast one A at the input of ADDER so put A at one of theinputs
And for the 2nd input we have to choose out of different options, hence we use a MUX
And we see that we have to add an extra 1 when s1=1 & s0=0 and s1=1 & s0=1. In bothcases we have s1=1 so we attach s1 to carry pin also.
Left shifting A would make it 2A hence we add A to A to get left shift of A.
Digital Logic Design Notes from www.exploreroots.com Page 53
Q- Design and implement the following with a combinational circuit (with Aand B being 4-bit numbers):
S2 S1 S0 Output
0 0 0 2A
0 0 1 A plus B
0 1 0 A plus B’
0 1 1 A minus 1
1 0 0 2A + 1
1 0 1 A plus B plus 1
1 1 0 A minus B (2’s compliment)
1 1 1 A
Ans: We need one 4-bit parallel ADDER and MUX to implement the above. As wecan see that we need at least one A at the input of ADDER so put A at one of theinputs
And for the 2nd input we have to choose out of different options, hence we use a MUX
Digital Logic Design Notes from www.exploreroots.com Page 58
SEQUENTIAL CIRCUITS
INTRODUCTION
In Sequential circuits output is a function of present inputs and pat output. These
circuits have a feedback element or memory element which stores the output of the circuitand makes it available at the input. The following is the general diagram of sequentialcircuits:
The binary information stored in the memory element that is fed back into the circuit definesthe state of the circuit. Sequential circuits are of two types:
Synchronous circuits: In these types of circuit, output is defined only on the basis of
values of inputs at discrete instants of time. In these circuits we use flip-flops as memorydevices and a common clock is used to control the working of the circuit. A clock is aperiodic wave which continuously changes its state from 1 to 0 and 0 to 1 as
When-ever pulse goes from high to low, it is called FALLING or TRAILING EDGE and whenpulse goes from low to high, it is called RISING EDGE.
Asynchronous circuits: In these types of circuit every change in the inputs affects outputand output depends on values at every instant of the inputs. All the circuits which don’thave any flip-flops or clock are called Asynchronous circuits. Hence all the combinationalcircuits are Asynchronous circuits.
Digital Logic Design Notes from www.exploreroots.com Page 59
CLOCK
A clock signal is defined by clock period or clock frequency. The clock period is definedas time interval after which clock repeats it self or we can define it as time gap between twoconsecutive falling edges or two consecutive rising edges and clock frequency is defined asnumber of clock pulses in a second.
Clock freq = 1/ clock period
Duty Cycle: of a periodic wave is defined as percentage of the clock period we have a HIGHpulse.
i.e. Duty cycle = (time for which pulse is 1)*100 / Clock period
If width of HIGH pulse = width of LOW pulse = t as shown above.
Then Duty cycle = t/ 2t *100 = 50%
If we are given duty cycle = 33%, then it means
100/3 = (time for which pulse is 1)*100 / Clock period
Hence width of HIGH pulse = (1/3) * clock period as shown below:
Digital Logic Design Notes from www.exploreroots.com Page 60
BISTABLE MULTIVIBRATOR
FLIP-FLOP is another name of Bi-stable Multi-vibrator . A flip-flop is the basic element of sequential circuit. It has the capability of storing 1 bit. The circuit of the Bi-stable Multi-vibrator using transistors is as follow:
The two transistors are used to store a single bit and they can hold data without external assistance as far
as power is supplied to the circuit. If Q is high we get high as an input to the transistor T1 and hence Q bar
is low and as Q bar is low we get LOW as input to transistor T2 and hence Q is HIGH. We can see how
output is maintained by the circuit itself. So we don’t need t refresh the circuit again and again.
DERIVING THE CIRCUIT OF FLIPFLOP (from digital components):
To understand the logic let’s consider a basic circuit of an inverter with a feedback asbelow:
Now what would be the output of the circuit?
We know what ever is at input, we’ll get inverse of that at output and as output is fed backto input so again it would be inverted and this way we’ll have a pulse oscillating between 0and 1. Hence the output is as follow:
And width of the pulse (either LOW or HIGH) would be equal to the total delay of the gate and wires. Hence
we have the clock period equal to 2*(gate delay + wire delay).
Digital Logic Design Notes from www.exploreroots.com Page 61
DERIVING CIRCUIT OF FLIPFLOP CONTD..
But basic function of a sequential element is to hold the value but in the above circuit wehave an oscillating value and hence no permanent value is stored.
To store a value what we can do is use 2 inverters and hence only one value would be
stored in the value as net effect of 2 inverters is same output as input. So we are able tostore one bit in the cell.
But even there is a problem associated with this circuit as we don’t know the value stored in
the circuit, as soon as we complete this circuit a value is stored immediately and circuitbecomes stable.
Let the stable value is 0 in the circuit as shown:
Now if we try to input a 1 to the circuit from the input as:
It would be of no use as providing a +5v (high) and a 0v (low) would result in sinking thewhole voltage and hence net input as zero voltage. We’ll not be able to change the value
stored as input would still be zero and hence value stored would be zero.
And hence there is no provision that we can set a value in the circuit.
Digital Logic Design Notes from www.exploreroots.com Page 62
DERIVING CIRCUIT OF FLIPFLOP CONTD..
To make this provision we make a change in the circuit as follow:
We have place an OR gate with one input as S and the other input being the feed backinput. So in this circuit initial value stored is 0.
Role of S: what ever is the value of S, that value is stored in the circuit. Now if we makeS=1 then we’ll get a 1 as output of OR gate and hence 1 is stored in the circuit. Now thesituation of the circuit is as follow:
DERIVING CIRCUIT OF FLIPFLOP CONTD..
Another problem in the circuit –
How to make it zero now:
now 1 is stored in the circuit and if we want to store a 0 again in the circuit then we makeS=0. But when we make S=0, we are not able to change the value from 1 to 0. So we findthat there is another problem with this circuit that we are not able change value to 0. Whatnow..?
Now we make another change in the circuit as follow so that we can change the value to 0or 1 as we want: As we have seen that we can put a 1 on the line using OR gate but weneed to put a 0 at the input of first inverter to store a 0 in the circuit. So what do we do
now? Let’s see values at different points in the circuit if a 0 is stored.
And we see that if we can place a 1 in the middle of two inverters we can change the valuestored to 0 and hence we include an OR gate in the middle of inverters as follow:
Digital Logic Design Notes from www.exploreroots.com Page 64
RS FLIPFLOP
When R=0, S=0 we don’t have a change in the output in the circuit.
When R=0, S=1 we have output as Q=1 and Q bar = 0
When R=1, S=0 we have the output as Q=0 and Q bar = 1
But when we have R=1, S=1, both R and S make outputs of their NOR gates 0. Hence wehave Q=0, Q bar = 0 which is not a valid case as Q & Q bar should be compliment of each other and hence we don’t consider this case. This is calledRACE CONDITION. Allthese cases can be collectively represented in a table as follow:
Let’s draw the timing diagram of the RS latch: t is the delay for a NOR gate.
Initially we have R=0, S=0 and Q=0. When value of S changes to 1, we see in the circuit of RSlatch, output of NOR gate (which is Q’) becomes 0 after delay of t ns. Hence both Q & Q’ ar e0.Now inputs of other NOR gate become R=0 & Q’=0 and hence we get Q as 1 after another delay of t ns which is shown in the timing diagram. Similarly other outputs are shown.
Digital Logic Design Notes from www.exploreroots.com Page 66
R'S' FLIPFLOP
The characteristics of the FF are as given in table:
Clocking RS latch:
We can control RS Latch with clock by ANDing both inputs with clock separately as:
Hence when we have CLK (OR E) = 1, R & S gets passed to the RS latch circuit and hencethe output is affected by the inputs only when CLK (OR E) = 1 and when CLK (OR E)=0,inputs are not passed to the circuit and hence whole circuit is isolated from R & S. As thiscircuit is enabled only when Level of the CLK (OR E) is HIGH and disabled when level of CLK (OR E) is LOW, this is called LEVEL SENSITIVE (LATCH). So when ever CLK (ORE) is high all the changes in the input are transmitted to the output as shown in thewaveforms below:
Digital Logic Design Notes from www.exploreroots.com Page 67
D Latch:
As we have already discussed that when ever we have both R & S equal to 1 we witnessan ambiguous state. Hence to avoid this we have made an arrangement in which we’llnever have both R & S equal. We connect the two inputs with an inverter between them asshown below:
This is the flip-flop which is most widely used in real world applications. This is also calleddelay Latch. The following table would show the overall functioning of the D-latch:
Digital Logic Design Notes from www.exploreroots.com Page 69
If previous Q=1, then we need to get output as Q=0 (compliment of previous output), Qbar=1. Hence we need inputs to the basic flip-flop as J=0, K=1 to clear the output. As wehave ANDed J with previous Q bar and K with Q, lower AND gate is activated and K=1 ispassed to clear the output.
When J=1, K=0
As J is ANDed with Q’ so J=1 would be passed only when we have we have Q’=1. Hencewhen we have Q=0 & Q’=1, upper AND gate is activated and J would be passed further and hence output would be set to 1. And if we have previous outputs as Q=1 & Q’=0, weneed not pass J as output would be same even if we pass it.
When J=0, K=1
As K is ANDed with Q, so K=1 would be passed further if we have previous Q=1 & Q’=0(lower AND gate is activated) and hence output would be cleared but if previous Q=0, Q’=1
then we need not pass the inputs J=0, K=1 (which would clear the output) as they’ll notaffect the output independent of whether inputs are passed or not.
When J=0, K=0
As both the inputs are zero, output is not affected.
The following table summarizes all the functioning:
Waveforms representing the behavior of JK latch are as:
Digital Logic Design Notes from www.exploreroots.com Page 71
But ideal is that we have only one transition in the output per clock. Hence to avoid thisproblem we use edge triggered flip-flops.
PROBLEM IN JK & T LATCH: When we have J=1, K=1 or T=1 then output iscomplimented and if CLK (OR E) is still HIGH, then when the new output is fed back, outputis complimented again and this way output is continuously complimented. This problem iscalled RACE AROUND PROBLEM. We can observe this as:
Let Q=1,Q’=0 with J=1, K=1 or T=1, then lower AND gate is enabled and hence J=0, K=1is passed and output is cleared and we have Q=0, Q’=1. If CLK (OR E) is still HIGH and
now as Q=0, Q’=1, then upper AND gate is activated and J=1, K=0 is passed, hence outputis now set i.e. Q=1,Q’=0 and so on….
To avoid this RACE AROUND PROBLEM we can make sure that pulse width of the clockis less than the propagation delay of the Latch. Due to this restriction JK & T latches aregenerally not used in this form but as edge triggered flip-flops which are discussed later.
ASYNCHRONOUS INPUTS:
There are two special inputs which are used to clear and preset the value of the flip-flop
asynchronously which are usually called CLEAR and PRESET respectively. These inputsare called asynchronous or direct inputs because these signal don’t wait for the clock tocome but can affect the output independent of the clock. These inputs can be of two types:
Active LOW: This means when the input is LOW, it would affect the output otherwise if input is HIGH then it causes no change.
Active HIGH: This means when input is HIGH then it can change the output otherwise if input is LOW, it doesn’t cause any change in the output.
These inputs can be adjusted in the circuit diagram of the flip-flop with Active HIGHDIRECT
Digital Logic Design Notes from www.exploreroots.com Page 73
Note: When we have both PRESET & CLEAR equal to 1 (in Active high inputs) wehave RACE CONDITION as PRESET tries to make output equal to 1 and CLEAR tries tomake output equal to 0 simultaneously which is not possible..
Similarly we have RACE CONDITION when both PRESET & CLEAR are equal to 0 in Active low inputs.
Different parameters of clock pulses:
Note that we need the width of PRESET pulse, CLEAR pulse etc to be greater than some
minimum values for proper operation of every flip-flop. This width is measured between50% transition points of rising and trailing edges of the given signal.
Setup and Hold time are measured w.r.t the activating clock edge. The Setup time is thedifference between the 50% transition point of DATA input before clock edge and 50%transition point of activating clock edge while Hold time is measured between 50%
transition point of activating clock edge and 50% transition point of the DATA after clockedge as shown below:
Digital Logic Design Notes from www.exploreroots.com Page 74
Propagation time is measured between 50% transition point of activating clock edge andthe 50% transition point of output for the corresponding edge but it is generally differentwhen output changes from 1 to 0 or 0 to 1. Hence we define propagation time TpHL asdifference between 50% transition point of activating clock edge and 50% transition point of the output change from HIGH to LOW
while propagation time TpLH as difference between 50% transition point of activating clockedge and 50% transition point of the output change from LOW to HIGH.
And we take average of both TpHL and TpLH to specify the propagation time
QUESTIONS:
Q-What is the difference between LATCH & FLIP-Flop?
Ans: We can easily find the answer after going through the theory given:
1. Latches are level sensitive while flip-flops are edge sensitive devices2. Hence latches faces problems like glitches in the output while no such problem
occurs in flip-flops.
3. As we can see from different circuits given earlier, we need more gates to
implement flip-flops than latches.
Q- Implement the function of D latch using MUX?
Ans: We know D-LATCH can be triggered when CLK is 1 (positive level triggered) or whenCLK is 0 (negative level triggered). Hence we can implement both of these as follow:
Digital Logic Design Notes from www.exploreroots.com Page 76
EDGE SENSITIVE LATCH (i.e. FLIP-FLOP):
Latches which are activated by the edge of the clock are called Flip-flops. If it is apositiveedged flip-flop then inputs are accepted only when a LOW to HIGH transition occurs in theclock and if it is a negative edged flip-flop then inputs are accepted only when there is aHIGH to LOW transition in the clock signal.
When we use a pulse triggered latches in the circuit then every fluctuation in the input isvisible in output. Hence we use edge triggered flip-flop and output is generated onlydepending upon the value of input at the clock edge. We represent the flip-flop similar tolatch but in flip-flops we place a triangle near CLK terminal as shown: And to represent anegative edged flip-flop we place a circle before the triangle (as we do in case of inverter)shown below:
One way to make flip-flop respond to edge of the clock only, we use a RC circuit to producea edged clock rather than a pulsed clock. This RC circuit generates spikes in response tothe transitions in the clock pulse as shown below and we use either positive or negativespikes and neglecting the other spike.
We can get only positive spike using following circuit:
We can also achieve edge triggering by other methods as explained next.
Digital Logic Design Notes from www.exploreroots.com Page 78
MASTER SLAVE FF - PART II
We can have a Master-Slave JK flip-flop as following diagram:
And while drawing the circuit diagram we instead of giving two feed backs (one for eachflip-flop), we’ll draw only a single feedback from the final output of the whole circuit to the
input of the circuit and implement the JK flip-flop. We can analyze the circuit as we did incase JK latch and see that JK flip-flop is implemented by following circuit:
-: Master Slave JK flip-flop:-
Following waveforms for positive edge triggered flip-flop would further illustrate the workingof an edge triggered flip-flops:
Digital Logic Design Notes from www.exploreroots.com Page 80
And we see that at the 4th and 5th edge we have the wrong transitions. Why so?
Before the 4th negative edge, there is small R pulse which resets the output of Master RSflip-flop and after resetting the output of master RS flip-flop R goes low. Now we have S=0& R=0 and output of master stays low and hence when transition of CLK occurs from 1 to 0,we have S=0 & R=1 (instead of S=1 & R=0) at the slave FF and hence final output is reset.So we notice that a high pulse at R has affected output even when pulse occurred muchbefore the negative edge.
Before the 5th negative edge, a short high pulse occurs at S input of master due to whichoutput of master is set to 1 and after some time S resets and we have S=0 & R=0 andhence output of master stays high and when CLK goes from 1 to 0, we have inputs of slave
as S=1 & R=0 (instead of S=0 & R=1) and hence final output is set to 1. We again notice apulse which occurs much before the edge and still affects the final output.
So we find a situation when a master-slave flip-flop doesn’t work as edge-triggered FF.Similar problem we’ll face in JK flip-flop as we have a no change condition in both FFs. Butwe can realize a edge-triggered FF with D Flip-flop without this problem as:
Digital Logic Design Notes from www.exploreroots.com Page 82
TIMING PARAMETERS OF A FLIP-FLOP:
There are basically 3 types of factors which affect the working of a flip-flop:
1. SETUP TIME
2. HOLD TIME
3. PROPAGATION TIME
SETUP TIME & HOLD TIME
Setup Time: This is defined as minimum amount of time required for which an input shouldbe stable just before the clock transition occurs. Suppose we have a positive edged JK flip-flop and setup time is t= 1ns seconds. If clock pulse with period 5 ns is going from 0 to 1 i.e.
first positive edge is coming at time t=1 ns then both inputs J & K should be stable for 1 nsfrom time t=0ns to t=1ns & t=5ns to t=6 ns & t=10 ns to t= 11 ns i.e. J & K should notchange during this period as shown:
Hold Time: This is defined as minimum amount of time required for which an input shouldbe stable just after the clock transition occurs. Suppose we have a positive edged JK flip-flop and Hold time is t= 1ns seconds. If clock pulse with period 5 ns is going from 0 to 1 i.e.first positive edge is coming at time t=1 ns then both inputs J & K should be stable for 1 ns
from time t=1ns to t=2ns & t=5ns to t=6 ns & t=11 ns to t= 12 ns i.e. J & K should notchange during this period as shown:
Digital Logic Design Notes from www.exploreroots.com Page 83
And both conditions can be represented as follow and inputs should be stable for at least 2ns:
Well there are some special timing requirements which must be fulfilled by the input
signal to get a valid output at the output terminal. If any of the above requirements is notfollowed and inputs change their value within any of setup time window or hold timewindow, then output of the flip-flop can not be predicted and flip-flop is said to enter in METASTABLE STATE and output can be either zero or one. This whole process iscalled METASTABILITY.
Digital Logic Design Notes from www.exploreroots.com Page 84
PROPAGATION TIME:
It is defined as the time after the clock transition, required for a flip-flop to generate output.This is also called CLOCK TO Q delay T clock-to-q.
e.g. Let’s draw the wave forms of inputs and outputs for D FLIP -FLOP which would
illustrate the above discussed:
Maximum Frequency of the clock signal:
To achieve the maximum frequency of the clock signal we can assume to start SETUP timeimmediately after the CLK to Q delay is finished.
This would mean that we can have the next positive edge (CLK to Q delay +
SETUP time) after the previous positive edge. And with 50% duty cycle, falling edgewould be right in the middle of positive edges. Hence we get the total minimum time
period and maximum frequency of the clock signal as
Digital Logic Design Notes from www.exploreroots.com Page 85
QUESTIONS
Q- We are given a D FF which is used as a divide by 2 circuit and specifications of the flip-flop are as:
T (setup) = 5ns T (hold time) = 4ns T (CLK to Q) = 9ns and circuit is as:
Ans: I’ll recommend drawing the 1st edge of clock and then to mark the various delayswhich we require for proper input to reach the flip-flops before the 2nd edge of the clock as:We know that we have to obey following conditions of setup & propagation time:
To get the minimum delay (maximum frequency of the circuit) , we eliminate the timebetween end of propagation time and starting of setup time and we get the clock
waveform as: Hence we get to know that minimumtime period as:
T = T (setup) + T (CLK to Q) = 5 + 9 = 14 ns = 14 * 10-9 s
And the maximum frequency we get is 1/ T = 1 / 14 = 109 / 14 = 71.4 MHz
Digital Logic Design Notes from www.exploreroots.com Page 86
QUESTIONS
Q- Find the maximum clock frequency of the following circuit and specifications of the flip-flop are as T (setup) = 5ns T (hold time) = 4ns T (CLK to Q) = 9ns andmaximum delay of the combinational circuit is T (c-delay) = 13 ns
Ans: As input to first flip-flop is directly available and hence this doesn’t affect clockfrequency but input to 2nd flip-flop reaches after various delays from the previous edge of the clock. We the above as follow:
And the complete clock can be represented as follow: c-delay is combinational delay
Hence clock time period = T CLK to Q + c-delay + Setup time = 9 + 13 + 5 = 27 ns
And maximum frequency of the circuit is F max = 1 / 27 = 3.7 MHz
Digital Logic Design Notes from www.exploreroots.com Page 87
QUESTIONS
Q- Find the maximum clock frequency of the following circuit and specifications of the flip-flop are as T (setup) = 5ns T (hold time) = 4ns T (CLK to Q) = 9ns andmaximum delay of the combinational circuit is T (c-delay) = 13 ns and delay of buffer is T (buf) = 2ns.
Ans: There is a change in the circuit from the previous questions that we have an extrabuffer in the way of clock signal to 2nd flip-flop. Due to this buffer, clock edge reaching2nd flip-flop delays by 2 ns. Note that we calculate the various delays for input of 2nd FF wrtthe clock edge of 1st flip-flop. And input going through all the delays should reach beforeclock edge reaches the 2nd flip-flop. Let me represent the above in a diagram as follow:
We firstly represent the delays wrt edge of 1st FF as
And the delayed input must reach before the edge reaches 2nd flip-flop
And we know that for 1st FF clock edge can reach anytime as there is direct input available.Hence we get that
Clock time period is T = T CLK to Q + cdelay + Setup time –clock delay for 2nd FF
= 9 + 13 + 5 – 2 = 25 ns
And maximum frequency of the circuit is F max = 1 / 25 = 4.0 MHz
Digital Logic Design Notes from www.exploreroots.com Page 88
QUESTIONS
Q- Find the maximum clock frequency of the following circuit and specifications of the different flip-flop are as T1 (setup) = 5ns T1 (hold time) = 4ns T1 (CLK to Q) = 9ns,T2 (setup) = 4ns T2 (hold time) = 3ns T2 (CLK to Q) = 7ns T3 (setup) = 4ns T3 (holdtime) = 4ns T3 (CLK to Q) = 9ns and delay of combinational circuit1 is 13 ns & of combinational circuit2 is 16ns in the following circuit.
Ans: Now we to take care of following conditions while calculating maximum frequency of the circuit:
Inputs of FF1 come directly hence only setup time of FF1 should be satisfied Various delays would matter for Inputs of FF2 wrt to the previous edge of FF1 Various delays would matter for Inputs of FF3 wrt to the previous edge of FF2
Let’s represent all delays with the different clock edges:
Hence we get to know that
If we calculate minimum clock period (Tmin) considering conditions to be fulfilled for edgeof FF1 then Tmin= T1 (setup) = 5 ns
Considering conditions to be fulfilled for edge of FF2 then Tmin= T1 (CLK to Q) +cdelay1 + setup2 = 9 + 13 + 4 = 26 ns
Considering conditions to be fulfilled for edge of FF3 then Tmin= T2 (CLK to Q) +cdelay2 + setup3 = 7 + 4 +16 = 27 ns
Now if we take clock period as 5 ns then we’ll not be able to satisfy the condition at clockedge of FF2 & FF3 (As clock is common for all)
Digital Logic Design Notes from www.exploreroots.com Page 89
If we take clock period as 26 ns, then we’ll be satisfying the condition at FF1 & FF2 butconditions of FF3 would not be satisfied & hence we cannot take this as clock period.
But if we take clock period as 27 ns then we satisfy the condition at every clock edge.
Hence minimum clock period to satisfy every condition is Tmin = 27 and maximum clockfrequency we get is 1/ 27 = 3.7 MHz
CHARACTERISTIC EQUATION OF RS FLIP-FLOP:
The truth table for RS Flip-flop is as follow:
Now let’s draw the K-map and get the equation for output Q. As the Qp and Qp bar arecompliment of each other so we’ll consider only one of those in K-MAP
Digital Logic Design Notes from www.exploreroots.com Page 91
The equation we get is
CHARACTERISTIC EQUATION OF T FLIP-FLOP:
THE TRUTH TABLE IS AS
And the equation we get is as:
EXCITATION TABLE OF FLIP-FLOPS
Excitation of a flip-flop is actually exact opposite of what a truth table is. The truth table for the flip-flop gives us the output for the given combination of inputs and present output whilean excitation table gives the input condition for the given output change.
E.g. As in truth table we say for T flip-flop if input T is 1 and previous Q is 0 then we haveoutput as 1 while in excitation table we are given that present output Q is 0 and new Q is 1
then input T is 1.
Next we write truth table of various flip-flops and then we write their excitation flip-flops.
Digital Logic Design Notes from www.exploreroots.com Page 92
EXCITATION TABLE OF RS Flip-flop:
The truth table of the RS flip-flops is as:
Now to write the excitation table of this flip-flop we first write the various output changespossible as:
Now we can see from that truth table that to change output from 0 to 0, we can keepinputs S, R as 0, 0 or 0, 1 and we can write both the combinations as 0, X which means we just need to keep S=0 and R can have either of two possible values.
Similarly we can note that for output change from 0 to 1, we keep inputs at S=1,R=0.Similarly we can find the other cases and we get the table as:
Similarly we can find out the excitation tables for other kind of flip-flops as shown next:
Digital Logic Design Notes from www.exploreroots.com Page 93
EXCITATION TABLE OF OTHER FFs
D Flip-flop: The excitation table of D flip-flop is as:
JK Flip-flop: The excitation table of JK flip-flop is as:
For output change from 0 to 1 we can either keep inputs J, K as 1, 0 or we can makeuse of toggle input combination J=1, K=1 to get compliment of the output.
Similarly the other case
T Flip-flop: The excitation table of T flip-flop is as:
Digital Logic Design Notes from www.exploreroots.com Page 94
CONVERSION OF ONE FLIP-FLOP TO OTHER:
As we have already seen from the way we derived D flip-flop from RS flip-flop or the waywe derived T flip-flop from JK flip-flop or the way we derived JK flip-flop from RS flip-
flop by feeding back outputs that to derive a flip-flop from the other flip-flop we need todesign a combinational arrangement before the given flip-flop to convert the given to workas required flip-flop. Hence the general diagram to obtain a flip-flop from the given flip-flopis as:
RS flip-flop to D flip-flop:
Let’s first now derive the D flip-flop from RS flip-flop which we have already done:
We first write the truth table for required D flip-flop as
Now we write the excitation table of given FF SR flip-flop as
Now we need to make a arrangement so that we manipulate input D to inputs R, S suchthat we get the same output with RS FF as that of D FF. So we combine the two tables
Digital Logic Design Notes from www.exploreroots.com Page 101
MEMORY
1-bit Memory Cell: We know that flip-flop can store either zero or one permanently until achange is made in the inputs. Hence flip-flop would work as 1-bit memory cell.
Registers:
A register is a group of 1- bit memory cells. To make a N-bit register we need N 1-bit memorycells.
Register with parallel load: We can represent a simple 4-bit register as: We can give thevalues to be stored at input and we get that value stored at the next clock pulse.
Digital Logic Design Notes from www.exploreroots.com Page 102
But in this circuit we have to maintain the inputs to keep the outputs unchanged as we don’thave the input condition in D Flip-flop for unchanged output. Hence we modify the abovecircuit with an extra
input LOAD which when ‘1’ would mean there is a new input data to be stored and LOAD=0would mean we have keep the stored data same. The modified circuit is as:
Digital Logic Design Notes from www.exploreroots.com Page 103
Shift register:
In this type of register value stored in the register can be either shifted to left or rightdepending upon the circuit as:
PARALLEL IN PARALLEL OUT:
This type of shift registers is already discussed above.
SERIAL IN SERIAL OUT:
Right shift: Here data is shifted by one bit from left to right with every clock tick.
Left shift: Here data is shifted by one bit from right to left with every clock tick
SERIAL IN PARALLEL OUT: In this type of register we firstly load data serially in theregister. For a 4-it register we’ll need 4 clock cycles to load data and then output comes outin parallel mode.
Digital Logic Design Notes from www.exploreroots.com Page 104
PARALLEL IN SERIAL OUT: In this type of shift registers we first input the Parallel databy using LOAD=1 and then data is shifted and data comes out serially.
Digital Logic Design Notes from www.exploreroots.com Page 105
Ring counter:
This is a special type of register in which 1 moves in the output in the ring i.e. initially outputof 1st FF is 1. On next edge this 1 is transferred to output of 2nd FF while previous outputbecomes 0. Similarly on next clock output of 3rd FF becomes 1. Similarly it continuous tilllast FF goes 1. After this 1st FF goes 1 goes again and whole procedure is repeated. Thisway 1 is moved in a ring as:
i.e.
Clock Q4 Q3 Q2 Q1
Initially 0001
1st tick 0010
2nd 0100
3rd 1000
4th 0001
And so on
Hence we use only 4 states out of 16 states possible in Ring counter.
Or we can say there are 12 unused states in Ring counter.
Digital Logic Design Notes from www.exploreroots.com Page 106
Circuit diagram to achieve Ring Counter is as:
To start the Ring counter, we firstly give START=0 and then rightmost FF is set and allothers are reset and hence initial output is 0001
We can also realize Ring counter using JK flip-flop as:
Application: We can use Ring counter in the system where we have to perform differentoperations sequentially and repeatedly. Suppose we have to do operations A, B, C & D.Firstly we have to do A, then B, then C, and then D. after performing all operations we have
to perform operation A and so on. In this case we can use Ring counter to initiate theseoperations sequentially.
Digital Logic Design Notes from www.exploreroots.com Page 107
Johnson Counter:
While Ring counter, we have connected Q of last to D of 1st FF, but in Johnson Counter weconnect Q bar of last to D of 1st FF as shown below and we also don’t need to connectpreset of 1st FF. This is also called Twisted Ring counter :
Digital Logic Design Notes from www.exploreroots.com Page 108
We can also note that we use only 8 out of 16 possible states and in general we haveused 2n states and hence we have 2n-2n unused states
Q- Design a circuit to transfer data serially from one shift register to other.
Ans: If we have a N-bit shift register then we need only N clock cycles to shift those N-bits
to the other register. If we apply more or less than this many clock cycles then our operation of shifting would not be as required. Hence we have to give a control pulse whichwould control that only N clock cycles are given to the registers. The circuit diagram is as
follow:
If we are to transfer data between 4 bit register then control pulse would be 4 clock cycleswide as shown so that only 4 clock cycles are passed.
Following table would show the values of two registers at different clock cycles
Register 1 Register 2 Output
1101 1001
First clock 1110 1100 1
2nd clock 0111 0110 0
3rd clock 1011 1011 0
4th 1101 1101 1
Hence we see that register1 retains its contents and register2 gets the value of register2which was required.
Digital Logic Design Notes from www.exploreroots.com Page 109
ASYNCHRONOUS COUNTERS - MOD-2 counter:
If we see that flip-flop is a mod-2 counter with starting count as 0. If we connect J & K toHIGH and supply clock to the flip-flop, we’ll see that flip-flop would count pulses 0, then 1and as it is a MOD-2 counter so it’ll reset and again count from 0.
And the output is as:
Also note that output pulse is of half the original frequency of the clock. Hence we can saythat flip-flop acts as a Divide by 2 circuit.
Ripple counter:
We can attach more flip-flops to make larger counter. We just use more flip-flops incascade and give output of first to the clock of 2nd and output of 2nd to clock of 3rdand so on.This way every flip-flop would divide frequency of the clock by 2 and hence we can obtain adivide by larger value circuit. Let’s see how we can make larger counters:
And following waveforms would illustrate how the above circuit does counting. It is actuallya MOD-8 counter so it would count from 0 to 7 and then again reset itself as shown:
With every negative edge, count is incremented and when the count reaches 7, next edgewould reset the value to 0.
Digital Logic Design Notes from www.exploreroots.com Page 110
Hence we can design a MOD-2n counter using n flip-lops in cascade
Counter other than MOD-2n
Q-Can we design a ripple counter other than MOD-2n?
Ans: Yes we can. For this we’ll first design the counter with value which is multiple of 2 but
greater than the count required. Then we use a combinational circuit to reset the counter after the required value of count is achieved. Let’s take an example:
Design a MOD-14 counter.
First we design a counter of 2’s multiple greater than 14 which is 16. So we first design aMOD-16 counter as:
Now we need to design a combinational circuit which would take care that counter is resetwhen count value reaches 13. For this we first draw the waveforms as:
Digital Logic Design Notes from www.exploreroots.com Page 111
As we have to count till 13 and reset again. We see that when-ever Q4=1, Q3=1 & Q1=1,when have to reset the value of all the flip-flops so that we get the value of count as 0.Hence we take NAND of these 3 variables due to which we get a zero when all 3 variablesare 1 and output of NAND gate is connected to all the ACTIVE LOW CLEAR lines to resetall flip-flops as follow. We also have to make sure that the output of this NAND gate is zero
only after 13.
And now we the output waveforms as:
And we can clearly observe that we have achieved MOD-14 counter as all count values are reset after 13
but in this method we have to observe the output waveforms and then decide the combinational circuit to
Digital Logic Design Notes from www.exploreroots.com Page 112
USING K-MAPS TO DESIGN COUNTER
Q- Design MOD-3 ripple counter using (a) Observing outputs (b) K-maps to designthe circuit.
Ans: (a)We can design the MOD 3 counter using 2 FFs as 3 is less than 4 i.e. 22 and
greater than 2. We can see directly that as we have to reset the counter only after 2 i.e.when output is 3 we reset the counter and hence we need to reset only when we have Q0=1 & Q1=1. Now firstly design MOD-4 counter using 2 FFs and then take NAND of Q0 & Q1and feed the output to CLEAR of both FFs.
(b) We firstly draw state diagram of the counter required as:
And we have the general circuit to design the other than MOD 2 n then we have the general
circuit as
And now we draw a table to list the different input combinations to Combinational circuitand their corresponding output as:
Digital Logic Design Notes from www.exploreroots.com Page 117
DOWN COUNTER: (Reverse counting)
Here we’ll be counting in reverse order i.e. count would start from 15 to 0 and again valuegoes from 0 to 15. We just make a change in the circuit as we give Q bar to the CLK of nextflip-flop or we use positive edged flip-flops and give Q to CLK of next flip-flop.
And the output waveform would be as:
Or
And the output waveform would be as:
In both cases we take (Q4 Q3 Q2 Q1) 2 as value of the count
Digital Logic Design Notes from www.exploreroots.com Page 118
Or
We can just use the same circuit as the UP counter but
Consider the following circuit
And we see that this circuit is a UP counter which count from 0 to 7 and then it is reset butthe same circuit can also work as DOWN counter when we take count as combination of
inverted outputs for each FF. i.e. . Hence output count of the above circuitwould go from 7 to 0 and then again it is set to 7.
Digital Logic Design Notes from www.exploreroots.com Page 120
And the whole circuit is as:
GLITCH:
A glitch is an unwanted pulse which gets generated due to little difference in the delays of signals. Whenever signals with glitches are used as clock then glitches causes unwantedtriggering of the flip-flop. e.g.
We can see in the wave-forms given above for MOD-14 counter that there is aglitch in the Q2 signal which is produced due to delay of AND gate to reset theFF.
Also a glitch can be generated when we AND two signals and there is a slight
delay between two signals. Such a combinational circuit is used when we have to
transfer data serially between two registers discussed already and we need limitednumber of clock cycles for proper working.
The following circuit was designed to produce enable signal (with 4 clock cycles)
Digital Logic Design Notes from www.exploreroots.com Page 121
But due to slight delay in the one of the input signals there is glitch in the output whichwould lead to mal-functioning of the circuit.
Synchronous Counter
In synchronous counters we have the same clock signal to all the flip-flops.
MOD-4 Synchronous counter: We discuss here a 2-bit synchronous counter. We have
the circuit for this as:s
We have the initial outputs as Q0=0 & Q1=0. Whenever the first negative clock edge comesO/P of 1st FF becomes 1 as we have J & K for 1st FF as 1 and hence output of 1st FFtoggles and changes from 0 to 1. But when 1 st cock edge had come output of 1st FF was 0.Hence J & K for 2nd FF for 1st edge are 0. So output of this FF doesn’t change and we getQ1=0. so the output is (Q1Q0)2= 012.
On the next edge, output of 1st FF changes from 1 to 0 as J & K are always 1 for this FF.Inputs for 2nd edge for 2nd FF are J=1 & K=1. Hence output changes from 0 to 1. so we getthe count as (Q1Q0)2= 102.
Digital Logic Design Notes from www.exploreroots.com Page 123
CLOCK SKEW
It is a phenomenon in which there is a difference between the times at which clock signalreaches different components in synchronous circuits. Or we can say that clock signal from
clock circuitry reaches different components in the circuit at different times.
e.g. If in the circuit given below, CLK signal reaches the two flip-flops at different times then
it is said that CLOCK SKEW exists in the system.
CAUSES: There are basically 2 reasons due to which clock skew exists in the system:
1. Distance: If there is a difference in the distances between the clock circuitry anddifferent components then clock signal has to travel through different length of
wires, hence clock signal would reach earlier where there is shorter distance andclock would reach later where there is longer distance.
2. Change in the material of wires: Also if there is a change in the material of wires then clock signal can travel faster in one wire and slower in other and hence
there would be change at the time at which clock signal reaches differentcomponents.
Effects of clock skew:
Disadvantage: If combinational logic delay is very short or clock skew is large
enough then output of 1st FF would change (hence input of 2nd FF is changed
overriding the previous input) before HOLD time condition for the input of 2nd FFis satisfied and hence circuit would not work properly due to this HOLD TIMEviolation. Or input of 2nd FF change to create SETUP time violations.
Advantage: We can see in the example given below that due to clock skew,minimum clock period of the clock is decreased (and hence frequency isincreased).
Digital Logic Design Notes from www.exploreroots.com Page 124
QUESTION
Q- Find the maximum clock frequency of the above circuit if specifications of the flip-flop are as T (setup) = 5ns T (hold time) = 4ns T (CLK to Q) =9ns and maximum delay of the combinational circuit is T (c-delay) = 13 ns.There is a clock skew of +3ns for 2nd FF in the above circuit.
Ans: We firstly represent the delays wrt edge of 1st FF as
And the delayed input must reach before the edge reaches 2nd flip-flop
The clock skew is basically the delay in clock signal reaching 2nd flip-flop. Hence this is
quiet similar to the previous question of a buffer in the pathway of clock.
Hence Clock time period is T = T CLK to Q + cdelay + Setup time – Clock Skew
= 9 + 13 + 5 – 3 = 24 ns
And maximum frequency of the circuit is F max = 1 / 24 = 4.16 MHz
Digital Logic Design Notes from www.exploreroots.com Page 126
Note: We can easily notice that we need the value of clock skew between onlyadjacent pair of Flip-flops. We have assumed the value of skew as 3 ns between thepairs.
And the minimum time period to satisfy every condition at every clock edge is 24 ns
Hence maximum clock frequency of the circuit is Fmax = 1/24 = 4.16 MHz
IMPORTANT: Clock skew is only meaningful between adjacent pair of flip-flops whileit’s meaningless to know about the cock skew between other pair of flip-flops. Hencein the above case we only need to know the value of clock skew between FF1 & FF2and FF2 & FF3 while skew between FF1 & FF3 is meaningless.
QUESTIONS
Q-Implement binary multiplication using shifter:
Eg. If we are multiply 11 * 4
Then 11 = 1011 4 = 0100
Algorithm: For multiplication we first multiply the LSB of 4 (multiplier) with multiplicand andthen shift it towards right. Then we multiply the next bit and then add it to the shifted result. Again we MULTIPLY, ADD & Shift or if bit of multiplier is 1 then ADD multiplicand andSHIFT and if bit of multiplier is 0 then ADD zero (or don’t perform ADD but just) SHIFT. We
Digital Logic Design Notes from www.exploreroots.com Page 128
Q- Find the maximum clock frequency of the following circuit andspecifications of the flip-flop are as T (setup) = 5ns T (hold time) = 4ns T (CLKto Q) = 9ns and delay of other components is T (buf) = 2ns,  T (AND) = 4ns, T (OR) = 4 ns,    T (NOT) = 2 ns in the following circuit.
Ans: We first need to calculate the maximum delay of combinational circuit so that proper input reaches the inputs of 2nd FF.
Delay of one path in combinational circuit is T (OR) + T (NOT) = 4 + 2 = 6 ns
Delay of other path in combinational circuit is T (NOT) + T (NOT) = 4 ns
We take maximum of those hence 6 ns.
Hence Clock time period T =T CLK to Q + cdelay + Setup time –clock delay for 2ndFF = 9+ 6 + 5–2 = 18ns Maximum Clock frequency = F max = 1/18 = 5.55 MHz
Q- Find the maximum clock frequency of the following circuit andspecifications of the different flip-flop are as T1 (setup) = 5ns T1 (hold time) =4ns T1 (CLK to Q) = 9ns, T2 (setup) = 4ns T2 (hold time) = 3ns T2 (CLK to Q) =7ns T3 (setup) = 4ns T3 (hold time) = 4ns T3 (CLK to Q) = 9ns and delay of combinational circuit1 is 13 ns & of combinational circuit2 is 16ns in thefollowing circuit. And delay of buffer is T (buf) = 2 ns.
Ans: This question is very similar to the question done earlier as we have to fulfill the same
conditions at clock edges it’s only the delay which has been introduced in the path way of clock signal. We represent everything as:
As for FF3 we are calculating delays wrt the previous clock edge of FF2 for differentconditions and there is delay of only 2 ns in clock wrt clock at FF2 hence only 2 ns issubtracted which can also be seen from the diagram.
Note: One can say that there is a total delay of 4 ns for clock of FF3 and hence 4 should be
subtracted but as we are calculating all delays wrt the clock edge of FF2 and the delaybetween clocks of FF2 & FF3 is only 2 ns (not 4 ns). Hence 2 is subtracted.
And the minimum time period to satisfy every condition at every clock edge is 25 ns
Hence maximum clock frequency of the circuit is Fmax = 1/25 = 4 MHz
Digital Logic Design Notes from www.exploreroots.com Page 130
Q- Find the maximum clock frequency of the following circuit andspecifications of the flip-flop are as T (setup) = 5ns T (hold time) = 4nsT (CLK to Q) = 9ns and maximum delay of the combinational circuit is T (c-delay) = 13 ns and delay of buffer is T (buf) = 2ns. Delay of OR & inverter is 3ns & 2 ns respectively.
Ans: The combinational circuit after the 2nd FF doesn’t affect the clock frequency of the
circuit as there is no gated component after that circuit. Hence we represent the delays wrtedge of 1st FF as
And the delayed input must reach before the edge reaches 2nd flip-flop
And we know that for 1st FF clock edge can reach anytime as there is direct input available.Hence we get that
Clock time period is T = T CLK to Q + cdelay + Setup time –clock delay for 2nd FF
= 9 + 13 + 5 – 2 = 25 ns
And maximum frequency of the circuit is F max = 1 / 25 = 4.0 MHz
Digital Logic Design Notes from www.exploreroots.com Page 131
Q- Find the maximum clock frequency of the following circuit andspecifications of the flip-flop are as T (setup) = 5ns T (hold time) = 8ns T (CLKto Q) = 2ns and delay of other components is T (buf) = 2ns, T (AND) = 4 ns, T(OR) = 4 ns, T (NOT) = 2 ns in the following circuit.(b) Also tell us if there isHOLD time violation at any of the flip-flops.
Ans: We first need to calculate the maximum delay of combinational circuit so that proper
input reaches the inputs of 2nd FF.
Delay of one path in combinational circuit is T (OR) + T (NOT) = 4 + 2 = 6 ns
Delay of other path in combinational circuit is T (NOT) + T (NOT) = 4 ns
We take maximum of those hence 6 ns.
Hence Clock time period T =T CLK to Q + cdelay + Setup time –clock delay for 2ndFF = 2 +6 + 5 –2 = 11ns Maximum Clock frequency = F max = 1/11 = 9.99 MHz
(b) HOLD TIME:
At 1st FF K input & one input of AND gate for J input is given externally which is supposedto be held stable for hold time but the other input is a feedback from 2 nd FF and this inputchanges only after minimum delay of T = T1 CLK to Q + cdelay + Setup time2 + T2 CLK toQ + delay of AND gate = 2 + 5 + 6 + 2 + 4 = 19 ns which is greater than Hold time of 1st FF.hence hold time condition is satisfied for 1st FF.
At 2nd FF K input changes after minimum delay of T = T2 CLK to Q+ delay of AND gate +Setup time1 + T1 CLK to Q + delay (inverter) + delay (inverter) = 2 + 4 + 5 + 2 + 2 + 2 = 17ns i.e. more than Hold time
one J input (o/p of 1st FF) changes after minimum delay of T = T2 CLK to Q+ delay of ANDgate + Setup time1 + T1 CLK to Q + delay (inverter) + delay (OR) = 2 + 4 + 5 + 2 + 2 + 4 =19 ns i.e. more than Hold time
While other input to J through OR gate is a feed back from o/p of 2nd FF and changes onlyafter time T = T2 CLK to Q + delay of AND gate = 6 ns which is less than hold time(=8ns).
Hence there is a Hold time violation. To correct this we include a buffer gate of 2 ns
delay in the feedback as shown: with this buffer now i/p changes after 8 ns which isequal to hold time. Hence condition satisfied.
Digital Logic Design Notes from www.exploreroots.com Page 132
Hence we can also note that HOLD time doesn’t depend upon the clock frequencywhile SETUP time violation depends upon the clock frequency.
Q-Implement a MOD-8 counter using Parallel-in Parallel-out register andAdder.
Ans: We have a 3-bit register with two common inputs CLK & CLEAR for all 3 FFs. So we
initiate the counter we clear all the FFs and then give clock. Whenever count reaches 7output of adder becomes 000 with carry 1 and carry is ignored and 000 is fed into register.We have the circuit as:
In the circuit block of 3 FFs is a register with 2 common inputs.
Digital Logic Design Notes from www.exploreroots.com Page 133
TIMING CIRCUITS
INTRODUCTION
The timing circuits are the special purpose circuits which are generally used indigital circuits. We have the following important types of timing circuits:
1. 555 Timers are used in timing circuits very often as they are more reliable and lost cost.We have the two modes of operation of 555 Timer:
Monostable operation Astable operation
2. Schmitt Trigger: This is used to sharpen up falling and rising edges of DATA signal.
Monostable operation:
In monostable operation we have only one state stable and other state unstable. We have ainput named Trigger to the 555 Timer. When we give no trigger timer stays in the stablestate but when we give trigger then timer goes to the other state for a fixed time period andthen goes back to the stable state. The stable state for 555 Timer is LOW state while HIGHstate is unstable state. Hence 555 Timer has a LOW output voltage initially. When we giventrigger then timer output voltage goes from LOW to HIGH and stays HIGH for W time delayand then resets again.
A Multi-vibrator is 2-state circuit which has either a zero or one or two stablestates. And as in monostable operation of 555 timer we have one stable state, hence wealso call this timer as Monostable Multi-vibrator. Functional diagram of monostable multi-vibrator is given on next page. In the diagram, as we have three 5 Kohm resistors in serieshence the circuit is called 555 Timer (Triple 5 timer). Due to this arrangement we have2Vcc/3 voltage at node A and Vcc/3 voltage at node B.
Initially we have output equal to zero i.e. Q’= 0 & Q=1. As Q=1, transistor gets ON andhence capacitor is discharged and hence S becomes ZERO and R is also ZERO as initialvalue of Trigger is Vcc.
Digital Logic Design Notes from www.exploreroots.com Page 134
Hence in stable state
S=0 R=0 output=0 and capacitor C is discharged
When we give a trigger at the input (i.e. a LOW voltage pulse is given for small time), lower
op-amp gives 1 as voltage at –ve terminal becomes less than Vcc/3. Hence R becomes 1and Q becomes 0 and Q’=1 and output goes HIGH. Now as Q=0, this cuts-off the transistor and hence capacitor is allowed to charge through resistance R. When capacitor voltagebecomes greater than 2Vcc/3, output of upper op-amp becomes 1 and hence S=1, R=0which makes Q=1 and Q’=0. And output is again reset. Hence a trigger at the input makesoutput as 1 for some time W i.e. a rectangular pulse of width W is obtained.
The value of W is slightly more than the time in which capacitor is charged from 0 to2Vcc/3. We know that in one time constant RC, capacitor is charged to 63.2% but we needto charge capacitor to 2Vcc/3 = 66.6%. if we solve the equations then we’ll get
W= 1.1 RC
The following waveforms represent the working of monostable:
Digital Logic Design Notes from www.exploreroots.com Page 135
Astable Operation:
In Astable operation, we have no stable states. Hence we say that timer doesn’t stay in anyof the two states indefinitely i.e. vibrates between the two states. Hence we don’t needtrigger in this case. This is also called Astable Multi-vibrator. This is also called free-running multi-vibrator . When-ever we give power to the timer, we get the rectangular oscillating output signal.
The following diagram would explain the working of the Astable Multi-vibrator:
Working of this circuit is similar to Monostable multi-vibrator. In this circuit voltage of thecapacitance oscillates between Vcc/3 and 2 Vcc/3.
Suppose initially we have Q=0 & Q’=1. As Q is 0, transistor is turned OFF and hence
capacitor starts charging through R1 + R2. When the voltage of capacitor goes greater than2 Vcc/3, output of upper Op-amp gets 1 and hence S=1 & R=0 and due to this Q becomesHIGH and Q’ goes LOW.
Now as we have Q=1 & Q’=0. As Q is 1, transistor is turned ON and hence capacitor startsdischarging through R2. When the voltage of capacitor becomes less than Vcc/3, output of lower Op-amp gets 1 and hence S=0 & R=1 and due to this Q becomes LOW and Q’ goesHIGH.
Now again we have Q=0 & Q’=1 and whole procedure is repeated. Hence we get theoscillating output as illustrated follow:
Digital Logic Design Notes from www.exploreroots.com Page 136
In the figure above W is equal to the time in which capacitor is charged to 2 Vcc/3 fromVcc/3 and P is equal to the time in which capacitor is discharged from 2Vcc/3 to Vcc/3.Hence
W= 0.693 (R1+R2) C
P= 0.693 R2 C
So the time period of output is T= 0.693 (R1+2 R2) C
We can vary the duty cycle of output pulse by changing the value of R1 & R2 and dutycycle is defined as
And frequency of the timer is F= 1/T = 1.44/ (R1+2 R2) C
SCHMITT TRIGGER
As we have generally slow changing DATA signals i.e. DATA signals have slow rising andfalling edges. And use of these signals creates problems in the working of Digital circuits.Hence to avoid these problems we use SCHMITT TRIGGER to sharpen up the edges of DATA. The transfer characteristics of this trigger are as follow:
We have only 2 output voltage levels Vo- & Vo+ and there are 2 input voltage thresholdsV1 & V2. the SCHMITT TRIGGER follows the above characteristics i.e. when ever inputvoltage is increased from 0, we have the output voltage as Vo- and output remains thesame till input voltage is less than V2. Hence when ever there is an increase in the input
voltage, transition would occur only when input voltage becomes greater than V2.
Digital Logic Design Notes from www.exploreroots.com Page 137
When-ever input voltage is decreased from the high value (>V2), we have the output asVo+ and the output remains the same until input voltage becomes less than V 1.
Hence behavior of SCHMITT TRIGGER depends on whether input is increasing or decreasing and trigger is said to give hysteresis of V2 – V1. This is used to eliminate theeffect of noise on the signal. We illustrate this fact using the following example.
Suppose we have the following signal with superimposed noise and we take two cases:with small hysteresis V2 – V1+ and with large hysteresis V2 – V1— and notice the effect of SCHMITT TRIGGER
Small hysteresis V2 – V1+: As voltage is less than V1+, hence initial output is Vo-. When thevoltage increases to greater than V2, output jumps suddenly from Vo- to Vo+. Now outputvoltage remains same till input voltage drops below V1+. When voltage drops below V1+, weget the output as Vo-. After some time input voltage again increases beyond V2 and henceoutput again jumps to Vo+.
Large hysteresis V2 – V1--: As voltage is less than V1- , hence initial output is Vo-. When thevoltage increases to greater than V2, output jumps suddenly from Vo- to Vo+. Now outputvoltage remains same till input voltage drops below V1+. When voltage drops below V1+, weget the output as Vo-.
We represent the outputs of SCHMITT TRIGGER below:
And we can see that we get a clean square wave for large hysteresis while for smallhysteresis we get many transitions in the output but it is still better than the output withoutusing SCHMITT TRIGGER.