22. Status Register
• A status register, flag register, or condition code register
(CCR) is a collection of status flag bits for a processor.
• An example is the FLAGS register of the x86 architecture or
flags in a program status word (PSW) register.
• The status register is a hardware register that contains
information about the state of the processor.
• Individual bits are implicitly or explicitly read and/or
written by the machine code instructions executing on the
processor.
• The status register lets an instruction take action on the
outcome of a previous instruction.
• Typically, flags in the status register are modified as effects
of arithmetic and bit manipulation operations.
25. Error Correction codes
• Hamming code is a liner code that is useful for error detection up to
two immediate bit errors.
• In Hamming code, the source encodes the message by adding
redundant bits in the message. These redundant bits are mostly
inserted and generated at certain positions in the message to
accomplish error detection and correction process.
• Hamming code method is effective on networks where the data
streams are given for the single-bit errors.
• Hamming code not only provides the detection of a bit error but
also helps you to indent bit containing error so that it can be
corrected.
• The ease of use of hamming codes makes it best them suitable for
use in computer memory and single-error correction.
26. How to Encode a message in
Hamming Code
The process used by the sender to encode the message includes the
following three steps:
1. Calculation of total numbers of redundant bits.
2. Checking the position of the redundant bits.
3. Lastly, calculating the values of these redundant bits.
When the above redundant bits are embedded within the message, it is
sent to the user.
Step 1) Calculation of the total number of redundant bits.
Let assume that the message contains:
n– number of data bits
p – number of redundant bits which are added to it so that np
can indicate at least (n + p + 1) different states.
Here, (n + p) depicts the location of an error in each of (n + p)
bit positions and one extra state indicates no error. As p bits can indicate
2p states, 2p has to at least equal to (n + p + 1).
27. Cont…
Step 2) Placing the redundant bits in their correct position.
The p redundant bits should be placed at bit positions of
powers of 2. For example, 1, 2, 4, 8, 16, etc. They are referred
to as p1 (at position 1), p2 (at position 2), p3 (at position 4), etc.
Step 3) Calculation of the values of the redundant bit.
• The redundant bits should be parity bits makes the number
of 1s either even or odd.
• The two types of parity are ?
• Total numbers of bits in the message is made even is called
even parity.
• The total number of bits in the message is made odd is
called odd parity.
28. Cont….
• Here, all the redundant bit, p1, is must calculated as the
parity. It should cover all the bit positions whose binary
representation should include a 1 in the 1st position
excluding the position of p1.
• P1 is the parity bit for every data bits in positions whose
binary representation includes a 1 in the less important
position not including 1 Like (3, 5, 7, 9, …. )
• P2 is the parity bit for every data bits in positions whose
binary representation include 1 in the position 2 from right,
not including 2 Like (3, 6, 7, 10, 11,…)
• P3 is the parity bit for every bit in positions whose binary
representation includes a 1 in the position 3 from right not
include 4 Like (5-7, 12-15,… )
29. Cont….
Decrypting a Message in Hamming code
• Receiver gets incoming messages which require to
performs recalculations to find and correct errors.
The recalculation process done in the following steps:
• Counting the number of redundant bits.
• Correctly positioning of all the redundant bits.
• Parity check
Step 1) Counting the number of redundant bits
• You can use the same formula for encoding, the number of
redundant bits
2p ? n + p + 1
• Here, the number of data bits and p is the number of
redundant bits.
30. Cont….
Step 2) Correctly positing all the redundant bits
Here, p is a redundant bit which is located at bit
positions of powers of 2, For example, 1, 2, 4, 8, etc.
Step 3) Parity check
Parity bits need to calculated based on data bits and
the redundant bits.
p1 = parity(1, 3, 5, 7, 9, 11…)
p2 = parity(2, 3, 6, 7, 10, 11… )
p3 = parity(4-7, 12-15, 20-23… )
31. Conversion from RS FF into JK FF
• Step 1 : For conversion of SR Flip flop to JK Flip flop at first we
have to make combine truth table for SR flip flop and JK Flip
Flop. In bellow see the combine truth table of SR flip flop and
JK Flip Flop.