Logic circuits are broadly divided into two, namely combinational logic circuits and sequential logic circuits. Combinational logic circuits are circuits whose output conditions are influenced by input conditions.
The physical structure of a combinational circuit is as shown in the following figure:
Figure 3.1
While the Sequential logic circuit is a circuit whose output condition is influenced by the input condition and the previous output condition or it can also be said that the circuit works based on time sequence. The main characteristic of the sequential logic circuit is the presence of a feedback path in the circuit.
1. Combinational Logic Circuits
The combinational logic circuits that will be discussed are Encoders, Decoders, Multiplexers, and Demultiplexers.
1.1. Encoder
An encoder is a combinational logic circuit that functions to change or encode a discrete input signal into a binary code output.
Encoders are composed of logic gates that produce binary output as a response to two or more input variables. The output is expressed in Boolean algebra, depending on the combination of gates used. An encoder must meet the design requirement m < 2 n . The variable m is the input combination and n is the number of output bits of an encoder. One input combination can only represent one output combination. Consider the following example of an encoder output function table:
Table 3.1. Output function of 8ke3 encoder
From the table above, the following output function can be created:
Y0 = I1 + I3 + I5 + I7
Y1 = I2 + I3 + I6 + I7
Y2 = I4 + I5 + I6 + I7
From the table above, the following output function can be created:
From this equation, the gate circuit can be made as in the following image:
Figure 3.2
Figure 3.3
1.2. Decoder
The decoder circuit has the opposite properties to the encoder, namely changing binary code into discrete signals. A decoder must meet the design requirements m < 2n. The variable m is the output combination and n is the number of input bits. One input combination can only represent one output combination. Consider the following example of a decoder output function table:
Table 3.2. 2ke4 decoder output functions
From the table above, the following output function can be created:
From this equation, the gate circuit can be made as in the following image:
Figure 3.4
Creating an Encoder and decoder can be done in two ways, namely first, using basic gates arranged to form an Encoder or decoder function, second, using an Encoder or decoder IC that is widely available on the market. Decoder ICs are applied to seven segments, memory addressing, and so on.
2. Sequential Logic Circuits
Flip-flop is the main circuit in sequential logic. Counter, Register, Memory, and other sequential circuits are arranged using flip-flop as the main component. Flip-flop is a circuit that has a memory function. This means that this circuit is able to store data according to the combination of inputs given to it. There are several types of flip-flops that will be discussed, namely RS flip-flop, JK flip-flop, D flip-flop, and T flip-flop. The main characteristic of a flip-flop is that the output Q and Q^
is always opposite / stable (if Q = 0 then Q = 1, If = 1 then Q = 0). Because of the condition of these two stable states, the flip-flop circuit is also called a bistable circuit.
2.1. RS flip-flop
This flip-flop consists of two inputs, namely S (set) and R (reset). And its two outputs are Q and Q . The Set condition is the condition when Q is logical 1. While the Reset condition is the condition when Q is logical 0. Look at the following picture:
Figure 3.5
To analyze it, assume or take the previous output as an example.
Table 3.3
Further development, flipflop must be installed synchronously with other units and in accordance with its clock. Note the image of RS flipflop with clock.
Figure 3.6
2.2. JK Flip-flop
JK flip-flop is a refinement of RS flip-flop especially to overcome the forbidden conditions as explained above. In the input condition J = 1 and K = 1 will make the output condition opposite to the previous output condition. While for the output based on other input conditions all are the same as RS Flipflop.
Figure 3.7
Table 3.4
2.3. D Flip-Flop
Flip-flop D is a RS flip-flop that forces to have one input with R always opposite to S, so that the same SR input condition will never occur. Look at the following D flip-flop image.
Figure 3.8
Table 3.5
2.4. T Flip-flop
T flipflop or toggle flipflop is a JK flipflop whose two inputs (J and K) are combined into one so that there is only one way in. The characteristic of this flipflop is that the output condition will always be toggled or opposite to the previous condition if given a logic 1 input. Meanwhile, the output condition will remain or be the same as the previous output condition if given a logic 0 input.
Figure 3.9
Table 3.6
2.5. Register
A register is a logic circuit used to store data. In other words, a register is a circuit consisting of one or more flipflops combined into one. Flipflops are also called 1-bit registers. So to store 4 bits of data, the register must consist of 4 flipflops. To store data in a register, it can be done in two ways:
1. Stored in parallel (Parallel In):
In this method all parts of the register or each flipflop are filled (triggered) at the same time.
2. Stored in series (Serial In):
In this method, data is entered bit by bit starting from the flipflop at the end (either from the left or from the right), and shifted until all are filled. If the data is shifted from right to left it is called a "Shift Left Register", conversely if the data is shifted from left to right it is called a "Shift Right Register". Registers are not only used as data storage, but are also often used as Counters (see module 2.2.6) and number operations / ALU (see module 3).
As with data storage, data output can also be done in two ways:
- Issued parallel (Parallel Out)
- Issued in series (Serial Out) Parallel In Parallel Out (PIPO).
Look at the following picture:
Figure 3.10
A, B, C, and D are input signals. When the clock (trigger) is activated (Logic 1), then the existing data will be output simultaneously to Q3, Q2, Q1, and Q0. When the clock is not triggered again (Logic 0), then whatever the input, the output Q will remain the same.
Serial InSerial Out (SISO) Look at the following picture:
Figure 3.11
When the clock signal is first given, data from Si goes to flipflop A, at the second clock, data from flipflop A goes to flipflop B, and so on, until it comes out to So. So in the SISO register to read the data for the first time, the number of clocks needed is the same as the number of flipflops in the register (in this case four).
Parallel In -- Serial Out (PISO)
Figure 3.12
Serial InParallel Out (SIPO)
Figure 3.13
Combinational Digital Logic Circuits
Before going further, this chapter will discuss the basics of digital logic which is the basic element of computer construction. The discussion begins with a combinational logic circuit whose output depends only on the current input, then continues with a sequential logic circuit whose output depends on the current input and the previous output. By understanding the principles of digital logic, digital logic circuits can be designed like those in computers.
1 Combinational Logic Unit
A combinational logic unit (CLU) is a unit that translates a sequence of inputs into a sequence of outputs using certain functions. The outputs produced are only a function of the inputs, and as the input values change, the output values adjust accordingly. The general form of a combinational logic unit is shown in Figure 2.1. A sequence of inputs corresponding to a function i0?in
is fed to the CLU, which produces a sequence of outputs f0?fm
. There is no feedback from the outputs to the inputs in a combinational logic circuit.
The input and output for ULK normally have 2 values: high and low. If the signal (value) is a value taken from a finite set of members, the circuit is called digital. Digital electronic circuits accept input and output in the value 0 or 1. The value 0 which means 0 volts is called a low value and the value 1 which usually refers to 5 volts is called a high value. This agreement does not apply in all circumstances.
Figure 2.1: Combinational logic unit, viewed from the outside.
Although most digital computers are binary computers, there are also circuits that use multi-values. Paths that sendAlthough most digital computers are binary computers, there are also circuits that use multi-values. Paths that send data with multi-values are more efficient than using only 2 values. Multi-value digital circuits are different from analog circuits because multi-value digital circuits have finite value variations while analog signals have continuous values. In theory, the use of multi-value digital circuits is advantageous. However, in practice it is difficult to create a multi-value circuit that is reliable in distinguishing more than 2 kinds of values. Therefore, multi-value logic is currently used in a limited way.
In this book, we will only discuss binary digital circuits, which have exactly 2 types of values allowed for input and output. Thus, only binary signals are used in the following discussion. multi-valued data becomes more efficient than using only 2 values. Multi-valued digital circuits are different from analog circuits because multi-valued digital circuits have finite value variations while analog signals have continuous values. In theory, the use of multi-valued digital circuits is advantageous. However, in practice, it is difficult to create a multi-valued circuit that is reliable in distinguishing more than 2 types of values. Therefore, multi-valued logic is currently used in a limited way.
In this book, we will only discuss binary digital circuits, which have exactly 2 types of values allowed for input and output. Thus, only binary signals are used in the following discussion.