In the first few decades after the advent of the computer, the computer was essentially a huge calculator, numbers were entered and calculation results were output. It was not until the 1970s that scientists realized the need to verify these calculations correctly. As computers become more powerful and software more advanced, multi-tasking and stroke data verification become more difficult. Therefore, the programmer has to consider the behavior of the system over time. Under this opportunity, sequential logic was introduced into computational science, which was an important turning point in the history of computational science.
Although every digital circuit system may contain combinational circuits, most systems in practical applications also include storage elements. We describe such systems as sequential circuits.
Sequential logic is a circuit composed of the most basic logic gate circuit plus feedback logic loop (output to input) or device combination. The most essential difference from combinational logic is that sequential logic has a memory function.
According to the different characteristics of logic functions, digital circuits can be divided into two categories, one is called combinational logic, and the other is called sequential logic. The characteristic of the logic function of the combinational logic circuit is that the output at any time depends only on the input at that time, and has nothing to do with the original state of the circuit. The characteristic of the logic function of the sequential logic circuit is that the output at any moment not only depends on the input signal at the time, but also depends on the original state of the circuit, or in other words, is also related to the previous input.
There are mainly two types of sequential circuits in the field of logic design. The criteria for their classification depend on the timing of the input information we observe and the timing of internal state changes. The behavior of the synchronous sequential circuit can be defined according to its signal information at discrete points in time. The behavior of asynchronous sequential circuits depends on the input signal at any time and the sequence of changes in the input signal in continuous time.
The characteristic of the combinational logic circuit is that the change of input directly reflects the change of output. The state of its output depends only on the current state of the input and has nothing to do with the original state of input and output. The sequential circuit is a kind of output that is not only related to the current input but also is related to the original state of its output state. It is equivalent to adding a feedback input to the input of the combinational logic. There is a storage circuit in its circuit, which can keep the output state. We can use the following figure, the block diagram, to describe the composition of the sequential circuit.
the composition of the sequential circuit
As can be seen from the above figure, its output is a function of the state of the input and output at the previous moment. At this time, it is impossible to use the function expression of the combinational logic circuit to express its output function expression. Here the concept of Present state and Next State is introduced. When the present state represents the current state (usually represented by Qn), and the second state represents the state of the output after the input changes (usually represented by Qn 1), the output state after the input change is expressed as
Qn 1=f(X,Qn)
Among them: X is the input variable.
Sequential logic circuits are widely used. They are divided according to the different logic functions required, and there are many types. In the specific teaching links, three kinds of logic devices that are widely used and have the characteristics of typical sequential logic circuits are mainly selected for a more detailed introduction.
counter logic circuit example
Generally speaking, the counter is mainly composed of flip-flops to count the number of input count pulse CP. The output of the counter is usually a function of the current state. The maximum number of accumulated input pulses of the counter is called the "modulus" of the counter and is represented by M. For example, the M=6 counter is also known as a hexadecimal counter. Therefore, the "modulus" of the counter is actually the number of valid states of the circuit.
There are many types of logic diagram counters of synchronous seven-ary addition counters, with different characteristics. The main classifications are as follows: According to the counting system, it can be divided into the binary counter, decimal counter, and arbitrary system counter. According to the counting increase and decrease, it can be divided into addition counter, subtraction counter, reversible counter. According to whether the flip-flop in the counter is synchronous or not, it can be divided into the asynchronous counter and synchronous counter.
register circuit example
A register is a circuit that stores numbers, calculation results, or instructions. The shift register can store numbers, and under the action of shift pulses, the numbers in the register can be shifted to the left or right as needed. Registers and shift registers are basic logic components commonly used in digital systems and computers, and they are widely used. One flip-flop can store one-bit binary code, and n flip-flops can store n-bit binary code. Therefore, flip-flops are an important part of registers and shift registers. The flip-flops in the register only require that they have the function of setting 0 or 1. Whether it is a flip-flop with a synchronous structure, a master-slave structure, or an edge-triggered flip-flop, it can form a register.
sequential pulse generator circuit example
Sequential pulse refers to the pulse signal arranged in a certain sequence in time in each cycle period. The circuit that generates sequential pulse signals is called a sequential pulse generator. In digital systems, it is often used to control certain devices to perform operations or operations in a predetermined order
The output of the sequential logic circuit at any time not only depends on the input at that time but also is related to the input at each time in the past. Common sequential logic circuits include flip-flops, counters, and registers. Since sequential logic circuits have storage or memory functions, they are more complicated to repair.
Analysis of main failures of digital circuits with sequential logic circuits:
1. Clock: The clock is the synchronization signal of the entire system. When the clock fails, it will cause overall functional failure. Loss of clock pulses will cause the system data bus, address bus, or control bus to become inactive. Changes in the rate, amplitude, width, shape, and phase of the clock pulse may cause malfunctions.
2. Reset: devices containing a microprocessor (MPU), even the smallest system, generally have a reset function. The reset pulse is loaded on the MPU when the system is powered on, or under certain circumstances, the program returns to the initial state (for example, the Watchdog program). When the reset pulse cannot occur, the signal is too narrow, the signal amplitude is incorrect, there is interference in the conversion, or the conversion is too slow, the program may start at the wrong address, resulting in program confusion.
3. Bus: The bus transfers instruction series and control events. Generally, there are address bus, data bus, and control bus. When there is an error in the bus even if there is only one bit, it will seriously affect the system function, and cause wrong addressing, wrong data, or wrong operation. Bus errors may occur in the bus driver or other components that receive data bits.
4. Interruption: Systems with microprocessors (MPU) are generally able to respond to interruption signals or device requests and generate control logic to temporarily interrupt program execution, switch to special programs, serve interrupt devices, and then automatically return to the main program. Interrupt errors are mainly due to the adhesion of interrupt lines (the system is operating very slowly at this time) or interference (the system error responds to interrupt requests).
5. Signal attenuation and distortion: Long parallel buses and control lines may experience crosstalk and transmission line failures, which are manifested as spikes (crosstalk) on adjacent signal lines, or damped oscillations (equivalent to logic Multiple conversions of the level), which may add wrong data or control signals. There are many possible reasons for signal attenuation, such as high humidity environment, long transmission line, high rate conversion, etc. Large electronic interference sources will produce electromagnetic interference (EMI), which can cause signal distortion and cause circuit dysfunction.