The document summarizes various data representation techniques including Gray code, Excess-3 code, self-complementary code, weighted code, EBCDIC, and error detection codes. Gray code ensures that two successive numbers differ in only one bit. Excess-3 code represents each codeword as its decimal value plus 3 in binary. Self-complementary code allows a number to be obtained by complementing another number that adds up to 15. Weighted codes assign specific weights to each digit position. EBCDIC is an 8-bit character encoding used on IBM mainframe computers. Error detection codes add redundancy bits to facilitate error detection during data transmission.
3. #GRAY CODE
• Also known as Reflected Binary Code(RBC)
• Ordering of numeral binary system such that two
successive differ in only bit.
• Unweighted code
• Named after Bell Labs physicist Frank Gray
Steps to convert Binary to Gray Code
To convert a binary number d1 d2 …… dn-1 dn
1. Start from the dn place
2. If dn-1 is 1, replace dn by 1-dn i.e complement it. If 0, no
changes
3. Then proceed to dn-1 and continue upto d1
4. For Example:
1101 into Gray Code
1101 1101 1111 1011
(i) (ii) (iii)
1111 into Gray Code
1111 1110 1100 1000
(i) (ii) (iii)
5. APPLICATION OF GRAY CODE
• Most dominating application of Grey Code is in embedded system itself and
specifically in counting.
• In Grey code counting, it can be noticed that the number has fixed single bit change between
them. Logically one needs a pattern to program (Code) which can be manipulated to obtain the
desired results and this is best possible with grey code.
6. • Binary code is converted into Gray Code to reduce switching operations.
• Plays an important role in Error correction in digital communication such as digital
terrestrial televisions and some cable TV systems
• If there is any error in code, we can at least be assured that there will be only one bit
position change.
• Used in labelling the axes of K-Map ( Boolean circuit minimization)
7. #EXCESS-3 CODE
• Each codeword is equivalent to its decimal value plus 3 in binary.
• The codewords for 0–4 are complements of the codewords 5–9.
8. Basic use of Excess-3 code is that you can easily compute subtractions involving
9; all you have to do is invert the bits.
For Example:
• Excess-3 code for 5 is 1000.
• Suppose you have to find out 9 - 5. The answer should be 4.
• Execute the subtraction in Excess-3 code, all you need to do is invert the bits of
the Excess-3 code for 5.
• The answer will be 0111 which is the Excess-3 code of 4
9. #SELF-COMPLEMENTARY CODE
• If two numbers a and b add up to 15, then the binary representations
of a and b will be complements of each other.
• One can be obtained by complementing the other
• 9’s complement of code is equal to it's 1’s complement.
• Excess-3, 84-2-1and 2421 are the examples.
• Such codes have the property that the 9’s complement of a decimal number is
obtained directly by changing 1’s to 0’s and 0’s to 1’s.
10.
11. #WEIGHTED CODE
• Weighted codes are those whose each position of the number represents a
specific weight.
• Here , the individual numbers have their respective weights(ie. Values)
• Examples: 8421, 2421,84-2-1 are all weighted codes.
12. #EBCDIC(EXTENDED BCD INTERCHANGE CODE
• 8-bit character encoding
• Used mainly in IBM Mainframe and mid range IBM computers.
• EBCDIC is a file encoding (rather than a format) that maps binary data to
readable text
• This is similar to ASCII or UTF-8, etc
• EBCDIC used to be IBM’s standard.
• Defines a mapping between the numbers the computer keeps internally and text
characters.
• To transmit text files between systems using EBCDIC and ASCII, you need
something that will translate the text file. This could be hardware, or it could be
software.
13. Decimal ASCII Decimal EBCDIC
048 0 240 0
049 1 241 1
050 2 242 2
051 3 243 3
052 4 244 4
053 5 245 5
054 6 246 6
055 7 247 7
056 8 248 8
057 9 249 9
065 A 193 A
066 B 194 B
067 C 195 C
068 D 196 D
069 E 197 E
070 F 198 F
14. #ERROR DETECTION CODES
• Binary code that detects the digital error during transmission of data
• Checks read or transmitted data for errors and corrects them as soon as they are found
• Frequency of errors is checked
• If the error occurs fewer times at random, transmission is repeated. Otherwise, the system malfunction is
checked.
• Implemented in the field of data storage and network transmission hardware (Implemented either at Data
link layer or Transport Layer of OSI Model)
15. Basic approach used for error detection is the use of redundancy bits, where additional bits are added to
facilitate detection of errors.
Some popular techniques for error detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
Simple Parity Check:
• Parity bit is that extra bit included with binary message to make the total number of 1’s either even or odd.
Even Parity:
Blocks of data from the source are subjected to a check bit or parity bit generator form, where a parity of :
• 1 is added to the block if it contains odd number of 1’s, and
• 0 is added if it contains even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even parity checking.
16. In data communication, error due to noise or any disruption causes the bit to flip i.e. either 1 to 0 or 0 to 1
Steps:
• At Sending end, message is applied to parity generator.
• Message + parity bit is transmitted to destination.
• At receiving end, all bits are applied to parity checker.