Sequential Circuits

Flip-Flops and Introductory Sequential Logic
We now turn to digital circuits which have states which change in time, usually according to an external clock. The flip-flop is an important element of such circuits. It has the interesting property of memory: It can be set to a state which is retained until explicitly reset.
Simple Latches
The following 3 figures are equivalent representations of a simple circuit. In general these are called flip-flops. Specifically, these examples are called SR (\set-reset") flip-flops, or SR latches.



Figure 1: Two equivalent versions of an SR flip-flop (or \SR latch").






Figure 2: Yet another equivalent SR flip-flop, as used in Lab 3.
The truth table for the SR latch is given below.


The state described by the last row is clearly problematic, since Q and Q should not be the same value. Thus, the S = R = 1 inputs should be avoided.
From the truth table, we can develop a sequence such as the following:
1. R = 0, S = 1 )Q = 1 (set)
2. R = 0, S = 0 )Q = 1 (Q = 1 state retained: \memory")
3. R = 1, S = 0 )Q = 0 (reset)
4. R = 0, S = 0 )Q = 0 (Q = 0 state retained)
In alternative language, the first operation “writes" a true state into one bit of memory.
It can subsequently be “read" until it is erased by the reset operation of the third line.

Latch Example: Debounced Switch

A useful example of the simple SR flip-flop is the debounced switch, like the ones on the lab prototyping boards. The point is that any simple mechanical switch will bounce as it makes contact. Hence, an attempt to provide a simple transition from digital HIGH to LOW with a mechanical switch may result in an unintended series of transitions between the two states as the switch damps to its nal position. So, for example, a digital counter connected to Q would count every bounce, rather than the single push of the button which was intended.

The debounced con guration and corresponding truth table are given below. When the switch is moved from A to B, for example, the output Q goes LOW. A bounce would result in A = B = 1, which is the \retain previous" state of the flip-flop. Hence, the bounces do not appear at the output Q.
Figure 3: A debounced switch



Clocked Flip-flops
We will soon get used to the idea of a clock as an essential element of digital circuitry. When we speak of a clock signal, we mean a sequence of evenly spaced digital high and low signals proceeding at a fixed frequency. That is, the clock is a continuous sequence of square wave pulses. There are a number of reasons for the importance of the clock. Clearly it is essential for doing any kind of counting or timing operation. But, it’s most important role is in providing synchronization to the digital circuit. Each clock pulse may represent the transition to a new digital state of a so-called “state machine" (simple processor) we will soon encounter. Or a clock pulse may correspond to the movement of a bit of data from one location in memory to another. A digital circuit coordinates these various functions by the synchronization provided by a single clock signal which is shared throughout the circuit. A more sophisticated example of this concept is the clock of a computer, which we have come to associate with processing speed (e.g. 330 MHz for typical current generation commercial processors.)
We can include a clock signal to our simple SR flip-flop, as shown in Fig. 4. The truth table, given below, follows directly from our previous SR flip-flop, except now we include a label for the nth clock pulse for the inputs and the output. This is because the inputs have no effect unless they coincide with a clock pulse. (Note that a specified clock pulse conventionally refers to a HIGH level.) As indicated in the truth table, the inputs Sn = Rn = 0 represent the flip-flop memory state. Significantly, one notes that the interval between clock pulses also corresponds to the “retain previous state" of the flip-flop. Hence the information encoded by the one bit of flip-flop memory can only be modified in synchronization with the clock.



Figure 4: A clocked SR flip-flop.
We are now set to make a subtle transition for our next version of the clocked flip-flop. The flip-flop memory is being used to retain the state between clock pulses. In fact, the state set up by the S and R inputs can be represented by a single input we call \data", or D. This is shown in. Note that we have explicitly eliminated the bad S = R = 1 state with this configuration.
We can override this data input and clock synchronization scheme by including the “jam set" (S) and ”am reset" (R) inputs shown in Fig. 15. These function just as before with the uncloaked SR flip-flop. Note that these \jam" inputs go by various names. So sometimes the set is called “preset" and reset is called “clear", for example.
 

Figure 5: A \D-type transparent" flip-flop with jam set and reset.

Edge Triggered Flip-Flops
We need to make one final modification to our clocked flip-flop. Note that in the timing diagram of Fig that there is quite a bit of apparent ambiguity regarding exactly when the D input gets latched into Q. If a transition in D occurs sometime during a clock HIGH, for example, what will occur? The answer will depend upon the characteristics of the particular electronics being used. This lack of clarity is often unacceptable. As a point of terminology,18 the clocked flip-flop of Fig. 5 is called a transparent D-type flip-flop or latch. (An example in TTL is the 7475 IC.)
The solution to this is the edge-triggered flip-flop. We will discuss how this works for one example in class. It is also discussed some in the text. Triggering on a clock rising or falling edge is similar in all respects to what we have discussed, except that it requires 2-3 coupled SR-type flip-flops, rather than just one clocked SR flip-flop. The most common type is the positive-edge triggered D-type flip-flop. This latches the D input upon the clock transition from LOW to HIGH. An example of this in TTL is the 7474 IC. It is also common to employ a negative-edge triggered D-type flip-flop, which latches the D input upon the clock transition from HIGH to LOW.
The symbols used for these three D-type flip-flops are depicted in Fig. 7. Note that the small triangle at the clock input depicts positive-edge triggering, and with an inversion symbol represents negative-edge triggered. The JK type of flip-flop is a slightly fancier version of the D-type which we will discuss briefly later. Not shown in the figure are the jam set and reset inputs, which are typically included in the flip-flop IC packages. In timing diagrams, the clocks or edge-triggered devices are indicated by arrows, as shown in Fig 8.



Figure 7: Symbols for D-type and JK flip-flops. Left to right: transparent D-type, positive-
edge triggered D-type, negative-edge triggered D-type, and positive-edge triggered JK-type.


Figure 8: Clocks in timing diagrams for positive-edge triggered (left) and negative-edge
triggered (right) devices.

For edge-triggered devices, the ambiguity regarding latch timing is reduced significantly.
But at high clock frequency it will become an issue again. Typically, the requirements are
as follows:
·         The data input must be held for a time tsetup before the clock edge. Typically,  tsetup =20 ns or less.
·         For some ICs, the data must be held for a short time thold after the clock edge. Typically thold = 3 ns, but is zero for most newer ICs.
·         The output Q appears after a short propagation delay tprop of the signal through the gates of the IC. Typically, tprop = 10 ns.

From these considerations we see that for clocks of frequency much less than 1/(10ns)=100 MHz, these issues will be unimportant, and we can effectively consider the transitions

to occur instantaneously in our timing diagrams.

Karnaugh Maps

Karnaugh Maps


A Karnaugh map (K-map for short) is a useful tool used in the simplification of combinational boolean equations and the creation of sequential logic circuits. Karnaugh maps were created by Maurice Karnaugh in 1953. The size of a Karnaugh map can be very large, however a size of four columns by four rows is easier to understand than any larger maps.
The philosophy behind these drawings is that differences of only one bit for the logic of a boolean equation are adjacent to each other. This is just an organizational method for a boolean logic truth table, but it can give you the ability to help simplify logical equations. This has proven to be especially useful for digital circuit designers, as it can suggest components which can be eliminated or a way to simplify circuit designs. This reduces both the cost and complexity of these designs, and even an automated method for developing these circuits assuming that you can come up with a logical truth table in the first place.
What is going to be demonstrated here is how to manually evaluate Karnaugh Maps. For very complex circuit designs that involve dozens or even hundreds of variables, there is software available that automates this process.
Structure and Creation

The structure of a Karnaugh map is grid shaped. The two most typical sizes used for instruction or for small projects is the three variable (a 2x4 grid or 4x2 depending on the user) and the four variable map (4x4 grid).

K-maps can only be created if a truth table is present; it works differently for sequential logic, which will be discussed later. A finished K-map can make a truth table, or a boolean equation vice versa. Once a truth table is acquired, a Karnaugh map can be created. The top left corner(or sometimes just the top and the left) of a K-map shows the variables used for that side.The picture of the K-map example shows the variables associated to that side. The top is A and B and the numbers below them is the state A and B are for that column (i.e. The column 10 is when A is true(high) and B is false(low)). From the truth table we put its output in the corresponding squares (i.e. If on the truth table when ABCD is 1011 and the output was 1, then on the four variable map, a 1 would go in the fourth column, second row). The following example shows how to translate a truth table to a K-map and then turn the K-map into a boolean equation.
Order of input values
On a K-map, the order in which the input values combinations are placed is of utmost importance. By looking at the example image above, it can be noticed that it doesn't use the normal, or numeric, ordering of values (00, 01, 10, 11), but instead uses (00, 01, 11, 10). Although there are usually many orderings that can be used, not all possible orderings are usable for a K-map. A formal description for valid K-map orderings would be defined by the following rules:
1.   The input values combinations at two adjacent rows or columns must differ in exactly one bit.
2.   The map is cyclic: the first and last rows are considered to be adjacent, and the first and last columns are also adjacent.
3.   Each possible combination of bits must appear exactly once in the map.
For two-variable maps, fulfilling this rules is trivial: one of the variables is assigned to rows, the other one to columns, and a 2x2 map can be drawn where both possible sequences (0,1 and 1,0) are valid. It's valid even to use (0,1) for one variable and (1,0) for the other. On three or four variables, either the columns or rows (or both, for 4 variables) need to hold two variables. The sequence used in the examples above (00, 01, 11, 10) works well, and is the most used; an alternative to this could be (00, 10, 11, 01). If a K-map is ever needed for a 5 or even more inputs circuit, then longer sequences need to be made up that fulfill the rules above. For three variables (8 combinations), the (000, 001, 011, 010, 110, 111, 101, 100) sequence is often used. This is enough for maps of up to 6 inputs, or 64 combinations; bigger circuits are very rarely mapped by hand, most often using specialized software to build the map and even to retrieve information from it; but, if the need arises, an appropriate combinations sequence can be made by constructing an n-bit Gray Code.
As could be noticed from later sections, optimization of circuits through K-maps relies completely in the above rules or properties of such maps, so using wrong combination sequences may lead to circuits that are not optimal, or even to circuits that do not produce the expected output.

Basic Logic Gates

Basic Operators:-
In Digital logic there are three basic operators, the AND, the OR and the NOT. These three operators are the very basis for a digital circuit. In fact, almost everything your computer does can be described in terms of these three operations. Fortunately, these operations are not difficult to understand, as their meanings resemble the meanings of the words as used in every day language.
AND
The symbol for the AND operation and the mathematical expression using AND is as shown in the below .
Y=A.B 


The out for the AND gate is 1 only if both the inputs are (A&B) are 1. Otherwise, the value is 0. 

OR

The symbol for the OR operation and mathematical expression using OR looks like this.


The value of an OR expression is 1 when at least of of the input value is 1, and 0 otherwise. That is, the above expression equals 1 if either A or B is 1. The truth table for the OR operation is as follows.

NOT

NOT is the simplest operation. AND and OR are binary operations, since they require two values as input. NOT is a unary operation, and looks like this.

The value of a NOT expression is the opposite value of the input value.

NAND and NOR
If the AND, OR and NOT operators are combined, then the NOR and NAND can be created:
A NAND B is  . This is the inverted output of the AND gate
A NAND B looks like this.This is the inverted output of the AND gate

A NOR B looks like this.  This is just the inverted output of an OR gate.


 XOR and XNOR
Two other important gates are the exclusive-OR and exclusive -NOR operators, XOR and XNOR. This is sometimes denoted by a plus sign in a circle

A XOR B is .     This is true only if exactly one of the inputs is one.
A XNOR B is .  This is the inverted output of an XOR gate: it is only true if both input are the same.

XOR represents a modulo-2 addition, which means that if you add 1 to 1, you wrap around back to 0. This is very useful function in digital electronics, but it is not an important concept in Boolean algebra.
Formal Mathematical Operators
In the field of logic, which is part of discrete mathematics, there is an alternative notation to the addition/multiplication.Unfortunately, computer science, engineering and mathematics seem unable to establish a consensus, so we are stuck with both forms of notation. Other books, and especially those that deal more with pure logic or discrete mathematics may have various notations, so if other books are consulted, then the other notation needs to be known. As this is an engineering book, we will not use this notation.
Boolean Algebra Laws
Boolean Algebra, like regular algebra, has certain rules. These rules are Associativity, Distributivity, Commutativity and De Morgan's Laws. Associativity, Commutativity and Distributivity only apply to the AND and OR operators. Some of these laws may seem trivial because you are so used to them. However, when Boolean algebra was created with its different rules, every axiom we take for granted in "normal" algebra no longer was guaranteed to apply. These laws have been proved to hold under Boolean algebra

 

Associativity

Associativity is the property of algebra that the order of evaluation of the terms is immaterial.



Distributivity

Distibutivity is the property that an operator can be applied to each of the terms within the brackets.



Commutativity

Commutativity is the property that order of application of an operator is immaterial.
De Morgan's Law
De Morgan's Law is a consequence of the fact that the NOT or negation operator is not distributive.
De Morgan's laws (named after Augustus De Morgan, 1806–1871) tell us that a NAND gate gives the same output as an OR gate with inputs complemented and a NOR gate gives the same output as an AND gate with outputs complemented. These complemented-input gates are also known as bubbled gates because of the way that they are indicated on a symbol, i.e., by including a small 'bubble' on each input, in the same fashion that circles are drawn on the outputs of the NOT, NAND and NOR gates.
De Morgan's laws are the most useful while simplifying a boolean expression. An easy way to remember these laws is "Change the sign, break the line

History Of VLSI Coding

Verilog was the primary fashionable hardware description language to be fabricated. it had been created by Prabhu Goel and Phil Moorby throughout the winter of 1983/1984.