Thursday, 5 May 2016

counters

A counter circuit is usually constructed of a number of flip-flops connected in cascade. Counters are a very widely-used component in digital circuits, and are manufactured as separate integrated circuits and also incorporated as parts of larger integrated circuits.

In this blog we will deal with asynchronous ,synchronous counter and ring counter:
1.Asynchronous counter:
Depending on the number of digits to be counted modulo N counters are configured.

Cycle Q1 Q0 (Q1:Q0)dec
0 0 0 0
1 0 1 1
2 1 0 2
3 1 1 3
4 0 0 0




Number of flip-flops are connected in series such that the clocks of the next flip flop is triggered by the input of previous fllip flop.
design of asynchronous counter:
1.decide the no of flip-flops from the mod number from the basic equation.
modulus n=2^n
where n is the no of flipflops.
2.connect the flip flops serially as a ripple counter
3.fimd the binary number n-1
4.connect all ff outputs that are 1 at n-1 as inputs to a NAND gate.Also feed the clock pulse to the NAND gate
5.connect the NAND gate output to the preset inputs of all the flip-flops for which Q=0 at the count n-1.


  


2.synchronous counters
In synchronous counters, the clock inputs of all the flip-flops are connected together and are triggered by the input pulses. Thus, all the flip-flops change state simultaneously (in parallel). The circuit below is a 4-bit synchronous counter. The J and K inputs of FF0 are connected to HIGH. FF1 has its J and K inputs connected to the output of FF0, and the J and K inputs of FF2 are connected to the output of an AND gate that is fed by the outputs of FF0 and FF1. A simple way of implementing the logic for each bit of an ascending counter (which is what is depicted in the image to the right) is for each bit to toggle when all of the less significant bits are at a logic high state. For example, bit 1 toggles when bit 0 is logic high; bit 2 toggles when both bit 1 and bit 0 are logic high; bit 3 toggles when bit 2, bit 1 and bit 0 are all high; and so on.
Synchronous counters can also be implemented with hardware finite-state machines, which are more complex but allow for smoother, more stable transitions.

 3.ring counters
A ring counter is a circular shift register which is initiated such that only one of its flip-flops is the state one while others are in their zero states.
A ring counter is a Shift Register (a cascade connection of flip-flops) with the output of the last one connected to the input of the first, that is, in a ring. Typically, a pattern consisting of a single bit is circulated so the state repeats every n clock cycles if n flip-flops are used.

Tuesday, 3 May 2016

Sequential circuits-Flip flops




Sequential circuits are circuits whose output at any instant of time depends on all previous inputs.
Flip flops are sequential circuits which are configured using a set of logic gates and they can be used as a memory element. A logic gate by itself has no storage capacity but several logic gates connected together can permit storage of data.
Flip flops are also called as bistable multivibrators.

Flip-flops can be either simple (transparent or opaque) or clocked (synchronous or edge-triggered). Although the term flip-flop has historically referred generically to both simple and clocked circuits, in modern usage it is common to reserve the term flip-flop exclusively for discussing clocked circuits; the simple ones are commonly called latches.
1 latch:


an active high  SR latch

 

timing diagram of a simple SR latch
2.gated latches:
gated  SR latch:

Tt is sometimes useful in logic circuits to have a multivibrator which changes state only when certain conditions are met, regardless of its S and R input states. The conditional input is called the enable, and is symbolized by the letter E. 
 

When the E=0, the outputs of the two AND gates are forced to 0, regardless of the states of either S or R. Consequently, the circuit behaves as though S and R were both 0, latching the Q and not-Q outputs in their last states. Only when the enable input is activated (1) will the latch respond to the S and R inputs

3.edge triggered flip flop:
One method of enabling a multivibrator circuit is called edge triggering, where the circuit’s data inputs have control only during the time that the enable input is transitioning from one state to another.  
edge triggered SR flip flop:

Edge-triggered S-R flip-flop


The basic operation is illustrated below, along with the truth table for this type of flip-flop. The operation and truth table for a negative edge-triggered flip-flop are the same as those for a positive except that the falling edge of the clock pulse is the triggering edge.
S-R truth table
As S = 1, R = 0.  Flip-flop SETS on the rising clock edge.
Note that the S and R inputs can be changed at any time when the clock input is LOW or HIGH (except for a very short interval around the triggering transition of the clock) without affecting the output. This is illustrated in the timing diagram below:

Edge-triggered J-K flip-flop
The J-K flip-flop works very similar to S-R flip-flop.  The only difference is that this flip-flop has NO invalid state.  The outputs toggle (change to the opposite state) when both J and K inputs are HIGH.  The truth table is shown below.
J-K truth table 
Edge-triggered D flip-flop
The operations of a D flip-flop is much more simpler.  It has only one input addition to the clock.  It is very useful when a single data bit (0 or 1) is to be stored.  If there is a HIGH on the D input when a clock pulse is applied, the flip-flop SETs and stores a 1.  If there is a LOW on the D input when a clock pulse is applied, the flip-flop RESETs and stores a 0.  The truth table below summarize the operations of the positive edge-triggered D flip-flop.  As before, the negative edge-triggered flip-flop works the same except that the falling edge of the clock pulse is the triggering edge.
D truth table









Applications of filp-flops:
Flip-flops have wide and extensive application in semiconductor memories,counters,shift and storage registers.
They can also be used for binary addition,serial decode,comparison and timing function. 


Thursday, 28 April 2016

Combinational circuits part 2

Truth table of 3 line to 8 line decoder:


 4.BCD to seven segment decoder:

It consists of a seven segment display consisting of seven light emitting diodes.The segments are denoted by letters a-g .By illuminating various combinations of segments numbers from 0-9 can be depicted.
In electronics there are two important types of 7-segment LED digital display.
  • 1. The Common Cathode Display (CCD) – In the common cathode display, all the cathode connections of the LED’s are joined together to logic “0” or ground. The individual segments are illuminated by application of a “HIGH”, logic “1” signal to the individual Anode terminals.
  • 2. The Common Anode Display (CAD) – In the common anode display, all the anode connections of the LED’s are joined together to logic “1” and the individual segments are illuminated by connecting the individual Cathode terminals to a “LOW”, logic “0” signal.


5.Encoder:

1.BCD adder:
The steps followed in a BCD adder can be considered after considering the steps of BCD addition:
1.firstly the two BCD code groups are added for each decimal digit position using ordinary binary addition.
2.For those positions where the sum is 9 or less,the sum is in proper BCD format and no correction is needed.
3.When the sum of 2 digits is greater than 9 a correction of 0110 should be added to the sum,to produce proper BCD result.this will produce a carry to be added to the next decimal position.

In accordance with above rules the BCD adder performs following actions :

1.BCD adder adds the two numbers inputed and generates the output.If the sum is less than 9 then the output corresponds to the result.
2.If the sum is greater than 9(1001) then 0110 is added to the result and carry bit generated is taken to the next decimal position.





Above diagram showed us the realisation of BCD adder using two 4-bit adders and a correction detector circuit.

Only when the output carry is equal to 1 does the number 0110 be added to the binary sum to generate the new sum and carry.

2.Comparator:


A comparator is a logic circuit used to compare two binary numbers.

the X-nor gate is a basic comprator because its output is a 1 only if its two input bits are equal.

A comparator signifying which of the two numbers is greater is more complex.

if A=A3A2A1A0 and B=B3B2B1B0 be two four bit numbers then the steps followed by the comparator are:
1.Compare the most significant bits A3 and B3 of the two numbers.If A3 is a 1 and B3 is a 0 then A>B
if and only if A and B coincide go to step 2.
2.Compare the bits A2 and B2 of the numbers.if A2=1 and B2=0,A>B; if A2=0 and B2=1,A<B.if both the values coincide then goto step 3.
3.Compare the bits A1 and B1 of the numbers.If A1=1 and B1=0,A>B ;if A1=0 and B1=1,A<B if both the values coincide then goto step 4.
4..Compare the bits A0 and B0 of the numbers.If A0=1 and B0=0,A>B;if A0=0 and B0=1,A<B,if both the values coincide then A=B.


Image result for comparator circuit 

 

Above map shows steps for configuring a 2-bit comparator.


3.Decoder:
A decoder is a logic circuit that converts an N bit binary input code into M output lines such that only one output line is activated for each combination of inputs.
 a 3line to 8-line decoder has 3 inputs and 8 outputs as the name suggests.For active high outputs AND gates are used and for active low outputs NAND gates are used.

Logic diagram of 3line to 8 line decoder:
 

An encoder has a number of input lines only one of which is activated at a given time and produces an N-bit output code depending on which input is activated.
In short it performs the reverse of the operation performed by a decoder.







Octal to binary encoder













Image result for digital encoder


 

truth table is given below:





 6.Multiplexer
This logic circuit selects 1 out of several inputs and gives it as the output.





7.Demultiplexer:A demultiplexer has a single input line and several output lines.Depending on the select signals the output is generated.