Unit 3 Material Merged
Unit 3 Material Merged
Unit-3
DIGITAL ELECTRONICS
Overview of Number Systems, Logic gates including Universal Gates, BCD codes, Excess-3 code,
Gray code, Hamming code. Boolean Algebra, Basic Theorems and properties of Boolean Algebra,
Truth Tables and Functionality of Logic Gates – NOT, OR, AND, NOR, NAND, XOR and XNOR.
Simple combinational circuits–Half and Full Adders. Introduction to sequential circuits, Flip flops,
Registers and counters (Elementary Treatment only)
A
R
Overview of Number Systems
1. Explain the difference between binary, decimal, hexadecimal, and octal number systems.
LA
Provide an example for each.
Definition: In digital electronics, the number system is used for representing the information. The
number system has different bases and the most common of them are the decimal, binary, octal,
and hexadecimal.
'S
The base or radix of the number system is the total number of the digit used in the number system.
Suppose if the number system representing the digit from 0 – 9 then the base of the system is the
10.
AN
A
The base of binary number system is 2 because it has only two digit 0 and 1.
R
The digital electronic equipment's works on the binary number system and hence the decimal
number system is converted into binary system.
LA
The table is shown below the decimal, binary, octal, and hexadecimal numbers from 0 to 15 and
their equivalent binary number.
3. Octal Numbers
The base of a number system is equal to the number of digits used, i.e., for decimal number
system the base is ten while for the binary system the base is two.
'S
The octal system has the base of eight as it uses eight digits 0, 1, 2, 3, 4, 5, 6, 7.
AN
4. Hexadecimal Numbers
These numbers are used extensively in microprocessor work. The hexadecimal number system
has a base of 16, and hence it consists of the following sixteen number of digits.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
N
G
VI
Logic gates
9. State the functionality of the logic gates with truth tables.
What is a logic gate?
A logic gate is a device that acts as a building block for digital circuits. They perform basic logical
functions that are fundamental to digital circuits. Most electronic devices we use today will have
some form of logic gates in them.
A
In a circuit, logic gates work based on a combination of digital signals coming from its inputs.
Most logic gates have two inputs and one output, and they are based on Boolean algebra. At any
given moment, every terminal is in one of the two binary conditions: true or false. False represents
R
0, and true represents 1.
LA
Depending on the type of logic gate being used and the combination of inputs, the binary output
will differ. A logic gate can be thought of like a light switch, where in one position the output is
off (0), and in another, it is on (1). Logic gates are commonly used in integrated circuits (IC).
Basic logic gates
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR and XNOR.
'S
AND Gate
AN
The AND gate is named so because, if 0 is false and 1 is true, the gate acts in the same way as the
logical "and" operator.
The following illustration and table show the circuit symbol and logic combinations for an AND
gate. (In the symbol, the input terminals are on the left, and the output terminal is on the right.)
N
The output is "true" when both inputs are "true." Otherwise, the output is "false."
In other words, the output is 1 only when both inputs are 1.
G
VI
OR gate
The OR gate gets its name from behaving like the logical inclusive "or." The output is true if one
or both of the inputs are true. If both inputs are false, then the output is false. In other words, for
the output to be 1, at least one input must be 1.
A
The XOR (exclusive-OR) gate acts in the same way as the logical "either/or." The output is true if
either, but not both, of the inputs are true. The output is false if both inputs are "false" or if both
R
inputs are true. Similarly, the output is 1 if the inputs are different but 0 if the inputs are the same.
LA
'S
NOT gate
AN
A logical inverter, sometimes called a NOT gate to differentiate it from other types of electronic
inverter devices, has only one input. A NOT gate reverses the logic state. If the input is 1, then the
output is 0. If the input is 0, then the output is 1.
N
G
The XNOR (exclusive-NOR) gate is a combination of an XOR gate followed by an inverter. Its
output is true if the inputs are the same and false if the inputs are different.
NAND Gate:
The NAND gate represents the complement of the AND operation.
Its name is an abbreviation of NOT AND.
The graphic symbol for the NAND gate consists of an AND symbol with a bubble on the output,
denoting that a complement operation is performed on the output of the AND gate.
The truth table and the graphic symbol of NAND gate is shown in the figure.
A
The truth table clearly shows that the NAND operation is the complement of the AND.
R
LA
'S
AN
NOR Gate:
The NOR gate represents the complement of the OR operation.
Its name is an abbreviation of NOT OR.
N
The graphic symbol for the NOR gate consists of an OR symbol with a bubble on the output,
denoting that a complement operation is performed on the output of the OR gate.
G
The truth table and the graphic symbol of NOR gate is shown in the figure.
The truth table clearly shows that the NOR operation is the complement of the OR.
VI
Universal Gates:
2. Explain the concept of a universal gate. How can NAND gates alone be used to implement
other logic gates? (Understand)
A universal gate is a gate which can implement any Boolean function without need to use any
other gate type.
A
The NAND and NOR gates are universal gates.
In practice, this is advantageous since NAND and NOR gates are economical and easier to
R
fabricate and are the basic gates used in all IC digital logic families.
In fact, an AND gate is typically implemented as a NAND gate followed by an inverter.
LA
Likewise, an OR gate is typically implemented as a NOR gate followed by an inverter.
NAND Gate is a Universal Gate:
To prove that any Boolean function can be implemented using only NAND gates, we will show
'S
that the AND, OR, and NOT operations can be performed using only these gates.
Implementing an Inverter Using only NAND Gate The figure shows two ways in which a NAND
gate can be used as an inverter (NOT gate).
AN
1. All NAND input pins connect to the input signal A gives an output A’.
N
G
2. One NAND input pin is connected to the input signal A while all other input pins are
connected to logic 1. The output will be A’.
VI
A
R
LA
Thus, the NAND gate is a universal gate since it can implement the AND, OR and NOT
functions.
'S
NOR Gate is a Universal Gate:
To prove that any Boolean function can be implemented using only NOR gates, we will
AN
show that the AND, OR, and NOT operations can be performed using only these gates.
Implementing an Inverter Using only NOR Gate
The figure shows two ways in which a NOR gate can be used as an inverter (NOT gate).
N
1. All NOR input pins connect to the input signal A gives an output A’.
G
VI
2. One NOR input pin is connected to the input signal A while all other input pins are
connected to logic 0. The output will be A’.
A
Thus, the NOR gate is a universal gate since it can implement the AND, OR and NOT
functions.
R
LA
'S
AN
N
G
VI
3. Discuss about BCD code, and how is it used to represent decimal numbers? Provide an example
conversion. (Evaluate)
BCD Codes
Binary Coded Decimal, or BCD, is another process for converting decimal numbers into their
binary equivalents.
• It is a form of binary encoding where each digit in a decimal number is represented in the form
of bits.
A
• This encoding can be done in either 4-bit or 8-bit (usually 4-bit is preferred).
R
• It is a fast and efficient system that converts the decimal numbers into binary numbers as
compared to the existing binary system.
LA
• These are generally used in digital displays where is the manipulation of data is quite a task.
• The BCD equivalent of a decimal number is written by replacing each decimal digit in the
integer and fractional parts with its four bit binary equivalent.
• The BCD code is more precisely known as 8421 BCD code , with 8,4,2 and 1 representing the
'S
weights of different bits in the four-bit groups, Starting from MSB and proceeding towards
LSB.
AN
• This feature makes it a weighted code , which means that each bit in the four bit group
representing a given decimal digit has an assigned weight.
N
G
VI
Excess-3 code
4. Explain excess-3 code. How is it related to BCD? Provide an example of excess-3
code conversion
Excess-3, also called XS3, is a non-weighted code used to express decimal number-s. It is
another important binary code. It is particularly significant for arithmetic operations as it
overcomes shortcoming encountered while using 8421 BCD code to add two decimal
digits whose sum exceeds 9.
A
Representation of Excess-3 Code
Excess-3 codes are unweighted and can be obtained by adding 3 to each decimal digit then
R
it can be represented by using 4 bit binary number for each digit. An Excess-3 equivalent
of a given binary binary number is obtained using the following steps:
LA
• Find the decimal equivalent of the given binary number.
• Add +3 to each digit of decimal number.
• Convert the newly obtained decimal number back to binary number to get required excess-
3 equivalent.
'S
You can add 0011 to each four-bit group in binary coded decimal number (BCD) to get
desired excess-3 equivalent.
AN
5 7
G
Self-complementary property
• Excess-3 code is non-weighted and self complementary code. A self complementary binary
codes are always compliment themselves.
• The complement of a binary number can be obtained from that number by replacing 0’s
with 1’s and 1’s with 0’s.
• The sum of binary number and its complement is always equal to decimal 9. In other words,
the 1’s complement of an excess-3 code is the excess-3 code for the 9’s complement of the
A
corresponding decimal number.
• For example, the excess-3 code for decimal number 5 is 1000 and 1’s complement of 1000
R
is 0111, which is excess-3 code for decimal number 4, and it is 9’s complement of number
5.
LA
Gray code
5. What is Gray code? Provide a comparison with binary code
'S
Gray Code is the minimum-change code category of coding in which, the two consecutive
values changes by only a single bit. More specifically we can say, it is a binary number
system where while moving from one step to the next, only a single bit shows variation.
AN
It is also termed as reflected binary code or cyclic code. It is an unweighted code, as here
like other number systems, no particular weight is provided to various bit positions.
Basically, binary code is changed to gray equivalent in order to lessen the switching
operations. As only a single bit is changed at a particular time duration this leads to a
N
values:
Consider decimal value 7 and 8, to understand the switching of bits.
VI
We know in binary, 7 is written as 0111 while 8 is written as 1000. So, we can see that
Thus we can conclude that in a binary system, all 4 bits are getting changed simultaneously.
Hence we can say multiple bits are changing at the same time.
A
R
LA
'S
AN
N
G
VI
A
3. Repeat the same process for all the bits in the sequence till LSB.
R
Hamming Code
LA
6. Briefly explain the purpose of Hamming code.
• When data is transmitted over a computer network, it can be susceptible to various forms
of interference and network issues, which can cause errors in the received data. Error-
correcting codes are a sequence of numbers generated by specific algorithms for detecting
'S
and removing errors in data that have been transmitted over noisy channels.
• Hamming code is a type of error-correcting code used in digital electronics and information
AN
theory to detect and correct errors that can occur during data transmission or storage.
Hamming codes, developed by Richard W. Hamming in the 1950’s, provide a way to add
redundant bits to data so that errors can be detected and in some cases, corrected.
• In the coding method, the source encodes the message by inserting redundant bits within
the message. These redundant bits are extra bits that are generated and inserted at specific
N
positions in the message itself to enable error detection and correction. When the
destination receives this message, it performs recalculations to detect errors and find the
G
Burst error
A burst error means that 2 or more bits in the data unit have changed.
A
R
To detect or correct errors, we need to send extra (redundant) bits with data.
LA
'S
AN
Boolean Algebra
• Boolean Algebra is a branch of mathematics. It is entirely different from ordinary algebra.
G
Boolean algebra is also called switching algebra. Boolean algebra is especially defined for
switching circuits.
VI
• These switching circuits are also called logic circuits or gate circuits or digital circuits.
• Boolean algebra is used for analysing, designing and synthesizing the digital circuits.
• Boolean algebra is used not only in representing the simple logic expressions but also
complex logic expressions.
• Boolean algebra consists of two elements such as 0 and 1.
• In addition to this it consists of two binary operations such as AND and OR and one unary
operator like NOT gate.
• Boolean algebra consists of a set of rules and laws which are used to reduce the logical
expressions for getting minimum numbers of literals.
A
According to distributive law, if we perform the OR operation of two or more variables and then
perform the AND operation of the result with a single variable, the result will be similar to
R
performing the AND operation of that single variable with each two or more variable and then
perform the OR operation of that product. For three variables, the distributive law is written as:
LA
• A(B + C) = AB + AC
• A + (B.C) = (A + B)(A + C)
Associative Law:
'S
The associative law states that the operation can be performed in any order when the variable’s
priority is the same. As ‘multiplication’ and ‘division’ have the same priority. For three variables,
the associative law is written as:
AN
• A + (B + C) = (A + B) + C
• A.(B.C) = (A.B).C
Commutative Law:
N
This law states that no matter in which order we use the variables. It means the order of variables
doesn’t matter. For two variables, the commutative law is written as:
G
• A+B=B+A
• A.B = B.A
VI
Absorption Law:
This law allows us to absorb similar variables. The absorption law is written as:
• B + (B.A) = B
• B.(B + A) = B
• A + A’.B = A + B
• A.(A’ + B) = A.B
AND Law:
These laws use the AND operation. Therefore, they are known as AND laws. The AND law is
written as:
• A.0 = 0
• A.1 = A
• A.A = A
A
• A.A’ = 0
Boolean Algebra Properties
R
These are the following properties of Boolean algebra:
1. Annulment property: When the variable is AND with 0, it will give the result 0, and when the
LA
variable is OR with 1, it will give the result 1, i.e.,
• B.0 = 0
• B+1=1
'S
2. Identity property: When the variable is AND with 1 and OR with 0, the variable remains the
same, i.e.,
AN
• B.1 = B
• B+0=B
3. Idempotent property: When the variable is AND and OR with itself, the variable remains the
same or unchanged, i.e.,
N
• B.B = B
• B+B=B
G
4. Complement property: When the variable is AND and OR with its complement, it will give the
result 0 and 1 respectively.
VI
• B.B’ = 0
• B + B’ = 1
5. Double negation property: This law states that, when the variable comes with two negations, the
symbol gets removed and the original variable is obtained.
• ((B’))’ = B
OR Law:
These laws use the OR operation. Therefore, they as known as OR laws. The OR law is written as:
• A+0=A
• A+1=A
• A+A=A
• A + A’ = 1
A
Boolean Algebra Theorems
R
The two theorems in Boolean algebra which are extremely used are De Morgan’s first law and De
Morgan’s second law. These two theorems are used to reduce the given Boolean expression in
simplified form. These theorem helps to relate the AND, OR, and NOT operators. These two De
LA
Morgan’s laws are used to change the Boolean expression from one form to another form.
1. De Morgan’s First Law:
De Morgan’s first law states that the complement of the product of the variables is equal to the
sum of their individual complements of a variable, i.e.
'S
• (A.B)’ = A’ + B’
AN
0 0 1 1 1 1
G
0 1 1 0 1 1
1 0 0 1 1 1
VI
1 1 0 0 0 0
A
1 1 0 0 0 0
R
LA
'S
AN
N
G
A combinational circuit is the digital logic circuit in which the output depends on the combination
of inputs at that point of time with total disregard to the past state of the inputs. The digital logic
gate is the building block of combinational circuits. The function implemented by combinational
circuit is depend upon the Boolean expressions.
A combinational circuit consists of input variables, logic gates, and output variables. The logic
gates accept signals from inputs and output signals are generated according to the logic circuits
employed in it. Binary information from the given data transforms to desired output data in this
process. Both input and output are obviously the binary signals, i.e., both the input and output
signals are of two possible states, logic 1 and logic 0.
A
Half and Full Adders
10.Explain the purpose of a half adder. Provide a truth table and a schematic diagram.
R
Half-Adder: A half-adder is a combinational circuit that can be used to add two binary bits. It has
two inputs that represent the two bits to be added and two outputs, with one producing the SUM
LA
output and the other producing the CARRY.
'S
AN
The truth table of a half-adder, showing all possible input combinations and the corresponding
outputs are shown below.
N
G
VI
The first one representing the SUM output is that of an EX-OR gate, the second one representing
the CARRY output is that of an AND gate. The logic diagram of the half adder is,
A
block diagram of full adder is given by,
R
LA
'S
The full adder circuit overcomes the limitation of the half-adder, which can be used to add two bits
only. As there are three input variables, eight different input combinations are possible. The truth
AN
The Boolean expressions for the SUM and CARRY outputs are given by the equations,
Sum, S = A’B’Cin+ A’BC’in + AB’C’in + ABCin
Carry, Cout = AB+ ACin + BCin .
The logic diagram for the above functions is shown as,
A
R
LA
Introduction to sequential circuits
Sequential logic circuit comprises both logic gates and the state of storage elements such
as flip-flops. As a consequence, the output of a sequential circuit depends not only on
present value of inputs but also on the past state of inputs.
'S
AN
N
G
VI
A
R
Flip flops
LA
'S
A flip flop in digital electronics is a circuit with two stable states that can be used to store binary
data. The stored data can be changed by applying varying inputs. Flip-flops and latches are
fundamental building blocks of digital electronics systems used in computers, communications,
AN
and many other types of systems. Both are used as data storage elements.
It is the basic storage element in sequential logic.
N
G
VI
A
NO Flip-flop Latch
R
Flip-flop is a bistable device i.e., it has two stable Latch is also a bistable device whose
LA
1
states that are represented as 0 and 1. states are also represented as 0 and 1.
It checks the inputs but changes the output only at It checks the inputs continuously and
2 times defined by the clock signal or any other responds to the changes in inputs
control signal. immediately.
'S
3 It is a edge triggered device. It is a level triggered device.
AN
7 a, Flip-flop always have a clock signal Latches doesn’t have a clock signal
8 Flip-flop can be build from Latches Latches can be build from gates
A
4. T Flip-Flop
R
1. SR Flip Flop
This is the most common flip-flop among all. This simple flip-flop circuit has a set input (S) and
LA
a reset input (R). In this system, when you Set “S” as active, the output “Q” would be high, and
“Q‘” would be low. Once the outputs are established, the wiring of the circuit is maintained until
“S” or “R” go high, or power is turned off.
As shown above, it is the simplest and easiest to understand. The two outputs, as shown above, are
the inverse of each other. The truth table of SR Flip-Flop is highlighted below.
'S
S R Q Q’
AN
0 0 0 1
0 1 0 1
N
1 0 1 0
1 1 ∞ ∞
G
VI
2. JK Flip-Flop
Due to the undefined state in the SR flip-flops, another flip-flop is required in electronics. The
JK flip-flop is an improvement on the SR flip-flop where S=R=1 is not a problem.
The input condition of J=K=1 gives an output inverting the output state. However, the outputs
are the same when one tests the circuit practically.
In simple words, If J and K data input are different (i.e. high and low), then the output Q takes
the value of J at the next clock edge. If J and K are both low, then no change occurs. If J and K
are both high at the clock edge, then the output will toggle from one state to the other. JK Flip-
Flops can function as Set or Reset Flip-flops.
J K Q Q’
0 0 0 0
0 1 0 0
1 0 0 1
A
1 1 0 1
R
0 0 1 1
0 1 1 0
LA
1 0 1 1
1 1 1 0
'S
4. D Flip-Flop
14. Construct the D flip-flop with the help of truth table and excitation table.
AN
D flip-flop is a better alternative that is very popular with digital electronics. They are commonly
used for counters and shift registers and input synchronization.
In the D flip-flops, the output can only be changed at the clock edge, and if the input changes at
other times, the output will be unaffected.
N
Clock D Q Q’
G
↓»0 0 0 1
VI
↑»1 0 0 1
↓»0 1 0 1
↑»1 1 1 0
The change of state of the output is dependent on the rising edge of the clock. The output (Q) is
the same as the input and can only change at the rising edge of the clock.
4. T Flip-Flop
A T flip-flop is like a JK flip-flop. These are basically single-input versions of JK flip-flops. This
modified form of the JK is obtained by connecting inputs J and K together. It has only one input
along with the clock input.
These flip-flops are called T flip-flops because of their ability to complement their state i.e.
Toggle, hence they are named Toggle flip-flops.
T Q Q (t+1)
A
0 0 0
1 0 1
R
0 1 1
LA
1 1 0
Applications
These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
'S
• Counters
• Frequency Dividers
AN
• Shift Registers
• Storage Registers
Register
G
• Flipflop is a 1- bit memory cell which can be used for storing the digital data.
• To increase the storage capacity in terms of number of bits, we have to use a group of
VI
flipflop.
• Such a group of flip-flop is known as Register.
• Then n-bit register will consist of n number of flip-flop and it is capable of storing an n-
bit word.
• A register is a digital circuit with two basic functions: data storage and data movement.
The storage capability of a register makes it an important type of memory device.
Shift Registers
16. List the basic types of shift registers in terms of data movement with diagrams.
17. What is the function of shift register? With the help of simple diagram explain its
working.
• The information stored within the registers can be transferred with the help of shift
registers.
A
• Shift Register is a group of flip flops used to store multiple bits of data. The bits stored in
such registers can be made to move within the registers and in/out of the registers by
applying clock pulses.
R
• The registers which will shift the bits to left are called “Shift left registers”.
LA
• The registers which will shift the bits to right are called “Shift right registers”.
'S
AN
N
G
• The binary data loaded in serial, one bit at a time and the parallel data is available at the
output side.
Parallel-in to Serial-out (PISO):
• Parallel binary data is loaded into the register and the data shifted out of the serially at
every clock signal.
Parallel-in to Parallel-out (PIPO):
A
• Parallel binary data is loaded into the register and the data shifted out of the parallel at
every clock signal.
R
Counters
18. Explain the role of a counter in digital circuits.
LA
• A Counter is a device which stores (and sometimes displays) the number of times a
particular event or process has occurred, often in relationship to a clock signal.
• Counters are used in digital electronics for counting purpose, they can count specific event
happening in the circuit.
'S
• In digital electronics, a counter is a device that counts the number of events or pulses
occurring in a given time period. Counters are used in many applications such as frequency
measurement, clock generation, and digital signal processing.
AN
Synchronous Counters: Synchronous counters are designed to operate with a common clock
signal that controls the timing of each flip-flop in the counter. All flip-flops change states
simultaneously in response to the clock signal. There are different types of synchronous
counters:
N
• Binary Counters: These are the most common type of counters, where the state of
each flip-flop represents a binary digit. For an n-bit binary counter, there are n flip-
G
follows a decimal pattern, going from 0 to 9 before resetting. It uses additional logic
to decode the binary states into a 4-bit BCD (Binary Coded Decimal)
representation.
• Up/Down Counters: These counters can count both upwards and downwards.
They have an additional control input that determines the direction of counting.
Asynchronous Counters (Ripple Counters): Asynchronous counters, also known as ripple
counters, don't rely on a common clock signal for all flip-flops. The clock signal ripples through
the flip-flops, causing a delay in the count propagation. As a result, these counters are generally
slower than synchronous counters. Types of asynchronous counters include:
1. Binary Ripple Counter: In a binary ripple counter, each flip-flop triggers the next
one, causing a ripple effect. The least significant bit (LSB) flip-flop is triggered by
the clock signal, and the subsequent flip-flops are triggered by the output of the
preceding one.
2. Decade Ripple Counter: Similar to binary ripple counters, but designed to count
in a decimal sequence (0 to 9) before resetting.
Johnson Counter (Twisted Ring Counter): The Johnson counter is a type of shift register where
the output of the last flip-flop is fed back to the input of the first flip-flop. It produces a sequence
A
of states as the bits are shifted left or right. Johnson counters are used for applications such as
frequency division and sequence generation.
R
Modulo-N Counters: Modulo-N counters are designed to count up to a specific value (N) before
resetting. They are often used in applications where a specific counting range is required.
LA
Ring Counter: A ring counter is a type of counter in which only one flip-flop is in the '1' state,
and this '1' state circulates through the flip-flops in a ring fashion. It is used for applications like
time delay generation.
'S
Differentiate between combinational and sequential circuits. (SHORT ANSWER)
AN
N
G
VI
Hamming code is a set of error-correction codes that can be used to detect and
correct the errors that can occur when the data is moved or stored from the sender to the
receiver. It is a technique developed by R.W. Hamming for error correction.
Redundant bits are extra binary bits that are generated and added to the information-
carrying bits of data transfer to ensure that no bits were lost during the data transfer. The
number of redundant bits can be calculated using the following formula:
2^r ≥ m + r + 1
Suppose the number of data bits is 7, then the number of redundant bits can be calculated
using: = 2^4 ≥ 7 + 4 + 1 .Thus, the number of redundant bits= 4
Algorithm of Hamming Code
Hamming Code is simply the use of extra parity bits to allow the identification of an error.
• Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
• All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8,
etc).
• All the other bit positions are marked as data bits.
• Each data bit is included in a unique set of parity bits, as determined its bit
position in binary form.
• a. Parity bit 1 covers all the bits positions whose binary representation includes a
1 in the least significant position (1, 3, 5, 7, 9, 11, etc). b. Parity bit 2 covers all
the bits positions whose binary representation includes a 1 in the second position
from the least significant bit (2, 3, 6, 7, 10, 11, etc). c. Parity bit 4 covers all the
bits positions whose binary representation includes a 1 in the third position from
the least significant bit (4–7, 12–15, 20–23, etc). d. Parity bit 8 covers all the
bits positions whose binary representation includes a 1 in the fourth position
from the least significant bit bits (8–15, 24–31, 40–47, etc). e. In general, each
parity bit covers all bits where the bitwise AND of the parity position and the bit
position is non-zero.
• Since we check for even parity set a parity bit to 1 if the total number of ones in
the positions it checks is odd.
• Set a parity bit to 0 if the total number of ones in the positions it checks is even.
• Suppose the data to be transmitted is 1011001 from sender to receiver, the bits
will be placed as follows:
• To find the redundant bit R2, we check for even parity. Since the total number of
1’s in all the bit positions corresponding to R2 is odd the value of R2(parity bit’s
value)=1
• R4 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the third position from the least significant bit. R4:
bits 4, 5, 6, 7
1. To find the redundant bit R4, we check for even parity. Since the total number
of 1’s in all the bit positions corresponding to R4 is odd the value of R4(parity
bit’s value) = 1
2. R8 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the fourth position from the least significant bit.
R8: bit 8,9,10,11
• To find the redundant bit R8, we check for even parity. Since the total number of
1’s in all the bit positions corresponding to R8 is an even number the value of
R8(parity bit’s value)=0. Thus, the data transferred is:
5. Derive and explain the truth table of XNOR gate with circuit diagram.
An XNOR gate, in a digital logic circuit, operates by producing an output that's true
or '1' only when the number of true inputs is even. In a two-input gate, the output is
true if both inputs are the same (either both true or both false).
Example circuit diagram for XNOR gate:
This circuit detects if a signal is going from LOW to HIGH or from HIGH to LOW.
The Light-Emitting Diode (LED) on the output turns on for a short amount of time when an
edge is detected.
For fast-switching signals, you’d need lower values for R1 and C1, and the LED would be
ON for such a short time that it wouldn’t make sense. But instead, it would make sense to for
example read the output into a microcontroller, or use a counter to count the edges.