Hi,
I have to write a program of EVEN 7-bit ASCII parity encoder
the 8 bit use for encoding purposes
have to convert 8th bit to even parity encoder
1st byte is located at RAM
Program out put shouldn't consist more than 10 bits
Have to use ASCII control character EOT
not sure on how to start
Any help will be great
thanks for your help
will be helpful if can suggest what to look for (any particular topic on this) which will help
thanks
Start by deciding which processor, language, compiler etc you will use. Then count the number of 1 bits in your 7 bits and make the eight bit 1 if the number of 1 bits is 0,2,4, or 6, otherwise zero.
Start by deciding which processor, language, compiler etc you will use. Then count the number of 1 bits in your 7 bits and make the eight bit 1 if the number of 1 bits is 0,2,4, or 6, otherwise zero.
According to Wikipedia:
"In case of even parity, the parity bit is set to 1, if the number of ones in a given set of bits (not including the parity bit) is odd, making the number of ones in the entire set of bits (including the parity bit) even. If the number of ones in a given set of bits is already even, it is set to a 0."
Definition: Even parity: In asynchronous communications, an error-checking technique that sets an extra bit (called a parity bit) to 1 if the number of 1 bits in a one-byte data item adds up to an even number. The parity bit is set to 0 if the number of 1 bits adds up to an odd number. See odd parity and parity checking.
this is the chart I found on Wikipedia
7 bits of data (count of 1 bits) 8 bits including parity
even odd
0000000 0 00000000 00000001
1010001 3 10100011 10100010
1101001 4 11010010 11010011
1111111 7 11111111 11111110
That chart has the most significant bit in the rightmost position. I (and most others) write binary and decimal with the most significant digit (bit) in the leftmost position. So your chart would become,
That chart has the most significant bit in the rightmost position. I (and most others) write binary and decimal with the most significant digit (bit) in the leftmost position. So your chart would become,