Professional Documents
Culture Documents
in 1
11/25/2020 www.sanskriti.edu.in 2
11/25/2020 www.sanskriti.edu.in 3
Digital system codes are
› BCD code
› Excess-3 code
› EBCDIC code
› Error detection code
› UNI CODE
› ASCII code
› Extended ASCII code
› Gray code
11/25/2020 www.sanskriti.edu.in 4
It should have some desirable properties
Ease of coding
To increase efficiency of transmission
Ease in arithmetic operations
Minimum use of hardware
Error detection property
Ability to prevent wrong output during
transitions
11/25/2020 www.sanskriti.edu.in 5
BCD – Binary Coded Decimal
◼ BCD is a convention for mapping binary numbers
to decimal numbers & for Decimal to binary
numbers.
◼ When the decimal numbers are represented in BCD,
each decimal digit is represented by the equivalent
BCD code.
◼ Example :BCD Representation of Decimal 6349
6 3 4 9
11/25/2020 www.sanskriti.edu.in 7
Note: the Digit Bit pattern
following bit 0 0000
patterns are not 1 0001
used: 2 0010
3 0011
1010 4 0100
1011 5 0101
1100 6 0110
1101 7 0111
1110 8 1000
1111 9 1001
11/25/2020 www.sanskriti.edu.in 8
Example:
lets add 56 & 98
56 0101 0110
+ 98 1001 1000
=154 1110 1110 Not in BCD
1 0101 0100
1 5 4
11/25/2020 www.sanskriti.edu.in 9
EXCESS 3 CODE
The excess-3 code is obtained by adding 3 (0011)
to the corresponding BCD equivalent binary
number.
11/25/2020 www.sanskriti.edu.in 10
10
EXCESS 3 CODE
Decimal BCD Excess-3
Number Number Number
0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
11/25/2020 www.sanskriti.edu.in 11
11
Extended BCD Interchange Code
8-bit code
It contains the numbers from 0 to 28-1
Developed by IBM
Rarely used today
IBM mainframes only
11/25/2020 www.sanskriti.edu.in 12
We need a mechanism of correcting the errors
that occur
It is not always possible or may prove to be
expensive
It is necessary to know if an error occurred
If an occurrence of error is known, data may
be retransmitted
Data integrity is improved by encoding
Encoding may be done for error correction.
11/25/2020 www.sanskriti.edu.in 13
Error detection code detect errors during
transmission of data from one location to
another.
Error rate cannot be reduced to zero
To achieve error-detection we use a
parity bit.
11/25/2020 www.sanskriti.edu.in 14
A parity bit is an extra bit included with a
message to the total number of 1’s
transmitted either odd or even.
Parity bit allows us only to detect the presence of
one bit error in a group of bits.
It does not enable us to exactly locate the bit that
changed.
Parity bit scheme can be extended to locate
the faulty bit In a block of information.
11/25/2020 www.sanskriti.edu.in 15
11/25/2020 www.sanskriti.edu.in 16
Odd parity bit generator can be formed by
inverting the output of the Even parity bit
generator.
11/25/2020 www.sanskriti.edu.in 17
11/25/2020 www.sanskriti.edu.in 18
Gray coding is an important code and is used for
its speed, it is also relatively free from errors.
Gray coding avoids this since only one bit changes
between subsequent numbers.
In pure binary coding then counting from 7 (0111)
to 8 (1000) requires 4 bits to be changed
simultaneously.
Gray code is used to represent the digital data
when it is converted from analog data.
11/25/2020 www.sanskriti.edu.in 19
Decimal Binary Gray Code Decimal Binary Gray Code
0 0000 0000 8 1000 1100
1 0001 0001 9 1001 1101
2 0010 0011 10 1010 1111
3 0011 0010 11 1011 1110
4 0100 0110 12 1100 1010
5 0101 0111 13 1101 1011
6 0110 0101 14 1110 1001
7 0111 0100 15 1111 1000
11/25/2020 www.sanskriti.edu.in 20
Scan the Gray code word from left to right
All the bits of the binary code are the same as
those of the Gray code until the first 1 is
encountered, including the first 1
1’s are written until the next 1 is
encountered, in which case a 0 is written.
0’s are written until the next 1 is
encountered, in which case a 1 is written.
Examples
Gray code : 1 1 0 1 1 0
Binary code: 1 0 0 1 0 0
11/25/2020 www.sanskriti.edu.in 21
UNICODE is a 16-bit code for
representing alphanumeric data.
Developed by a consortia(An association or a combination,
as of businesses, financial institutions, or investors, for the purpose of
engaging in a joint venture.)
11/25/2020 www.sanskriti.edu.in 24
Alphabetic codes
11/25/2020 www.sanskriti.edu.in 25
Numeric codes
11/25/2020 www.sanskriti.edu.in 26
Punctuation, etc.
11/25/2020 www.sanskriti.edu.in 27
Let us convert You & I, to decimal, hex and binary
using the ASCII code table :
› Y: 8910 5916 10110012
› o: 11110 6F16 11011112
› u: 11710 7516 11101012
› Space: 3210 2016 01000002
› &: 3810 2616 01001102
› Space: 3210 2016 01000002
› I: 7310 4916 10010012
› ,: 4410 2C16 01011002
11/25/2020 www.sanskriti.edu.in 28
The term extended ASCII (or high ASCII)
describes eight-bit or larger character
encodings that include the standard seven-bit
ASCII characters as well as others.
11/25/2020 www.sanskriti.edu.in 29
Extended ASCII
11/25/2020 www.sanskriti.edu.in 30
11/25/2020 www.sanskriti.edu.in 31