Professional Documents
Culture Documents
Digital Electronics Circuit: Assignment - 2
Digital Electronics Circuit: Assignment - 2
ELECTRONICS
CIRCUIT
Assignment - 2
1
2
1. If A3 = 0 and B3 = 1
2. If A3 = B3 and A2 = 0 and B2 = 1
3. If A3 = B3, A2 = B2 and A1 = 0 and B1 = 1
4. If A3 = B3, A2 = B2, A1 = B1 and A0 = 0 and B0 = 1
3
AA, 831331 r: (A3 Ex-Nor 33) A2132′ a (A3 Ex-Nor 133) (A2
Ex-Nor 132) A131′ a (A3 Ex-Nor 33) (A2 ENor132) (Al Ex-
Nor 31) A01301
,13: A3’03 a (A3 Ex-Nor 33) A211:12 a (A3 Ex-Nor 83) (A2
Ex-Nor 132) Ar131 a (A3 Ex-Nor 33) (A2 Ex-Nor32) (Al Ex-
Nor 131) A0N30
A=B: (A3 Ex-Nor B3) (A2 Ex-Nor 82) (Al Ex-Nor BI) (AO Ex-
Nor BO)
Applications of Comparators –
1. Comparators are used in central processing units (CPUs)
and microcontrollers (MCUs).
2. These are used in control applications in which the binary
numbers representing physical variables such as
temperature, position, etc. are compared with a reference
value.
3. Comparators are also used as process controllers and for
Servo motor control.
4. Used in password verification and biometric applications.
5. Null detectors
6. Zero-crossing detectors
7. Relaxation oscillator
8. Level shifter
9. Analog-to-digital converters
5
Unlike a multiplexer that selects one individual data input line and
then sends that data to a single output line or switch, Digital
Encoder more commonly called a Binary Encoder takes ALL its data
inputs one at a time and then converts them into a single encoded
output. So, we can say that a binary encoder, is a multi-input
combinational logic circuit that converts the logic level “1” data at its
inputs into an equivalent binary code at its output.
Generally, digital encoders produce outputs of 2-bit, 3-bit or 4-bit
codes depending upon the number of data input lines. An “n-bit”
binary encoder has 2n input lines and n-bit output lines with common
types that include 4-to-2, 8-to-3 and 16-to-4-line configurations.
The output lines of a digital encoder generate the binary equivalent of
the input line whose value is equal to “1” and are available to encode
either a decimal or hexadecimal input pattern to typically a binary or
“B.C.D” (binary coded decimal) output code.
Priority Encoder
The Priority Encoder solves the problems mentioned above by
allocating a priority level to each input. The priority encoders output
corresponds to the currently active input which has the highest
priority. So, when an input with a higher priority is present, all other
inputs with a lower priority will be ignored.
The priority encoder comes in many different forms with an example
of an 8-input priority encoder along with its truth table shown below.
The truth table for a 8-to-3 bit priority encoder is given as:
D7 D6 D5 D4 D3 D2 D1 D0 Q2 Q1 Q0
0 0 0 0 0 0 0 1 0 0 0
8
0 0 0 0 0 0 1 X 0 0 1
0 0 0 0 0 1 X X 0 1 0
0 0 0 0 1 X X X 0 1 1
0 0 0 1 X X X X 1 0 0
0 0 1 X X X X X 1 0 1
0 1 X X X X X X 1 1 0
1 X X X X X X X 1 1 1
Output Q1
Output Q2
Then the final Boolean expression for the priority encoder including
the zero inputs is defined as:
Keyboard Encoder
Priority encoders can be used to reduce the number of wires needed
in a particular circuits or application that have multiple inputs. For
example, assume that a microcomputer needs to read the 104 keys of
a standard QWERTY keyboard where only one key would be pressed
either “HIGH” or “LOW” at any one time.
One way would be to connect all 104 wires from the individual keys
on the keyboard directly to the computers input but this would be
impractical for a small home PC. Another alternative and better way
would be to interface the keyboard to the PC using a priority encoder.
The 104 individual buttons or keys could be encoded into a standard
ASCII code of only 7-bits (0 to 127 decimal) to represent each key or
character of the keyboard and then input as a much smaller 7-bit
B.C.D code directly to the computer. Keypad encoders such as the
74C923 20-key encoder are available to do just that.
Positional Encoders
Another more common application is in magnetic positional control as
used on ships navigation or for robotic arm positioning etc. Here for
example, the angular or rotary position of a compass is converted into
a digital code by a 74LS148 8-to-3-line priority encoder and input to
11
Binary Output
Compass Direction
Q0 Q1 Q2
North 0 0 0
North-East 0 0 1
East 0 1 0
12
South-East 0 1 1
South 1 0 0
South-West 1 0 1
West 1 1 0
North-West 1 1 1
Interrupt Requests
Other applications especially for Priority Encoders may include
detecting interrupts in microprocessor applications. Here the
microprocessor uses interrupts to allow peripheral devices such as
the disk drive, scanner, mouse, or printer etc, to communicate with it,
but the microprocessor can only “talk” to one peripheral device at a
time so needs some way of knowing when a particular peripheral
device wants to communicate with it.
The processor does this by using “Interrupt Requests” or “IRQ”
signals to assign priority to all the peripheral devices to ensure that
the most important peripheral device is serviced first. The order of
importance of the devices will depend upon their connection to the
priority encoder.
13
Ans.
The parity generating technique is one of the most widely used error
detection techniques for the data transmission. In digital systems,
when binary data is transmitted and processed, data may be
subjected to noise so that such noise can alter 0s (of data bits) to 1s
and 1s to 0s.
The sum of the data bits and parity bits can be even or odd . In even
parity, the added parity bit will make the total number of 1s an even
amount whereas in odd parity the added parity bit will make the total
number of 1s odd amount.
16
To produce two bits sum, one Ex-OR gate is sufficient whereas for
adding three bits two Ex-OR gates are required as shown in below
figure.
Parity Generator
It is combinational circuit that accepts an n-1-bit stream data and
generates the additional bit that is to be transmitted with the bit
stream. This additional or extra bit is termed as a parity bit.
In even parity bit scheme, the parity bit is ‘0’ if there are even
number of 1s in the data stream and the parity bit is ‘1’ if there
are odd number of 1s in the data stream.
In odd parity bit scheme, the parity bit is ‘1’ if there are even number
of 1s in the data stream and the parity bit is ‘0’ if there are odd
number of 1s in the data stream. Let us discuss both even and odd
parity generators.
17
The figure below shows the truth table of even parity generator in
which 1 is placed as parity bit in order to make all 1s as even when
the number of 1s in the truth table is odd.
From the above truth table, the simplified expression of the parity bit
can be written as
To generate the even parity bit for a 4-bit data, three Ex-OR gates are
required to add the 4-bits and their sum will be the parity bit.
In the given truth table below, 1 is placed in the parity bit in order to
make the total number of bits odd when the total number of 1s in the
truth table is even.
20
The truth table of the odd parity generator can be simplified by using
K-map as
The output parity bit expression for this generator circuit is obtained
as
21
P = A ⊕ B Ex-NOR C
Parity Check
It is a logic circuit that checks for possible errors in the transmission.
This circuit can be an even parity checker or odd parity checker
depending on the type of parity generated at the transmission end.
When this circuit is used as even parity checker, the number of input
bits must always be even.
22
When a parity error occurs, the ‘sum even’ output goes low and ‘sum
odd’ output goes high. If this logic circuit is used as an odd parity
checker, the number of input bits should be odd, but if an error occurs
the ‘sum odd’ output goes low and ‘sum even’ output goes high.
The below table shows the truth table for the even parity checker in
which PEC = 1 if the error occurs, i.e., the four bits received have odd
number of 1s and PEC = 0 if no error occurs, i.e., if the 4-bit message
has even number of 1s.
23
The above truth table can be simplified using K-map as shown below.
24
The above logic expression for the even parity checker can be
implemented by using three Ex-OR gates as shown in figure. If the
received message consists of five bits, then one more Ex-OR gate is
required for the even parity checking.
The below figure shows the truth table for odd parity generator
where PEC =1 if the 4-bit message received consists of even number
25
The expression for the PEC in the above truth table can be simplified
by K-map as shown below.
26
The expression for the odd parity checker can be designed by using
three Ex-NOR gates as shown below.
THANK
YOU