You are on page 1of 15

2-Bit Magnitude Comparator

A comparator used to compare two binary numbers each of two bits is


called a 2-bit Magnitude comparator. It consists of four inputs and three
outputs to generate less than, equal to, and greater than between two
binary numbers.

The truth table for a 2-bit comparator is given below.

The simplified expression for outputs A>B, A=B and A<b can be obtained by using 4- variable K-map as

Truth Table of Output A>B


Truth Table of Output A=B

Truth Table of Output A<B

From the above k-map simplification, each output can be expressed as


By using above obtained Boolean equation for each output, the logic diagram can be
implemented by using four NOT gates, seven AND gates, two OR gates and two Ex-NOR
gates.

The figure below shows the logic diagram of a 2-bit comparator using basic logic gates
An encoder is a digital circuit which converts given numbers or
symbols into binary coded format

It has a maximum of 2^n input lines and ‘n’ output lines, hence it encodes the
information from 2^n inputs into an n-bit code.

The logic symbol of an encoder is as shown in figure


Hazards are the unwanted switching transient that may
appear at the output of the digital circuit. Such hazards
may result in a malfunction in the output of the circuit.
The propagation delay associated with the logic gates in
the circuit is the main cause of hazard. Hazards occur in
combinational circuits, which will cause faulty operation.
Hazards will also occur in asynchronous sequential
circuits where logic gates are used, affecting the stable
state.
There are two main types of hazard: Static Hazard and
Dynamic Hazard.
Static and Dynamic Hazard
When the input to the logic circuit changes, the output
has to remain at a particular logic, but instead it may
change its value momentarily. If this happens in the logic
circuit, then there exists a static hazard.
The static hazard can be classified as a static-0 hazard
and static-1 hazard. Instead of remaining at logic 1, the
output goes to logic 0 momentarily, then it is a static-1
hazard. Similarly, if the output monetarily goes to logic
1, instead of remaining at 0, it is a static-0 hazard.
A hazard is said to be dynamic if the output changes
two or more times when it should change from 1 to 0 or
from 0 to 1.

How to eliminate Hazards in


digital circuit?
If a hazard exists in a logic circuit, it is to be eliminated
to produce an error-free output. Let us consider a
boolean expression F = AB’ + BC. The K-map can be
implemented for the given expression, from which the
logic circuit is drawn as below.

The logic circuit has an inverter and an AND gate, so the delay in the output D is more than
that of the output E. So there exists a hazard in the circuit.

With the help of K-map, hazards can be detected in a


digital logic circuit. In the k-map, if two adjacent 1’s are
not enclosed, then there exists a hazard. To eliminate a
hazard, those minterms must be enclosed by introducing
another minterm, as shown below.

For the obtained


expression, the hazard free circuit can be drawn as
below.
The “JK flip flop,” also known as the Jack Kilby flip flop, is a
sequential logic circuit designed by Jack Kilby during his
tenure at Texas Instruments in the 1950s. This flip flop serves
the purpose of storing and manipulating binary information
within digital systems.
JK flip flop operates on sequential logic principle, where the
output is dependent not only on the current inputs but also on
the previous state. There are two inputs in JK Flip Flop Set
and Reset denoted by J and K. It also has two outputs Output
and complement of Output denoted by Q and Q̅ .
As per the characteristic
equation, the output Q n+1 is ‘1’ for 4 different input
combinations. ( 4 minterms). Using the K-map, the
algebraic expression can be simplified further.
As
per the K-map, after the simplification the output of the
flip-flop or the characteristic equation

JK Flip-Flop Excitation Table


The excitation table of the flip-flop shows the required excitation to the flip-flop, or the
required input to the flip-flop, to go from the given state to the next particular state. The
excitation table of the JK flip-flop is shown below. In the table, ‘X’ represents that the value
of input variable can be either ‘0’ or ‘1’.
In D flip flop, the single input "D" is referred to as the "Data"
input. When the data input is set to 1, the flip flop would be
set, and when it is set to 0, the flip flop would change and
become reset.
Characteristic Equation of D Flip
Flop
The characteristics equation of D flip flop consist of a
Boolean expression that explains the relationship
between the input and output of the flip flop. The
characteristic equation for a D flip flop is as follows.

You might also like