DEPARTMENT OF COMPUTER SCIENCE &
ENGG.
Presented By: Praveen Tabbannavar
Lecturer/CSE
B.L.D.E.A’S S.S.M. POLYTECHNIC
VIJAYAPUR
B.L.D.E.A’S S.S.M
POLYTECHNIC VIJAYAPUR
Introduction to Number System
Computer Codes
Digital computers make use of specialized computer codes or
digital codes in order to represent binary numbers, decimal
numbers, English alphabet, special symbols and
instructions.
There are various types of computer codes:
1. BCD
2. EBCDIC
3. ASCII code
4. Gray code
5. Excess-3 code
6. Unicode
BCD
• BCD stands for Binary Coded Decimal. This code allows
us to represent decimal digits up to 0 to 9 using a 4-bit
binary code. It can also be referred to as 8421 code. BCD
is simple to represent. It is a special code which represents
single decimal digit.
• This code provides an interface to binary/digital computer
systems. It is also used in digital devices like 7-segment
display, digital clocks, thermometers etc.
• There can be only 10 BCD codes.
BCD Codes for decimal digits
Decimal
digit
BCD code 8421
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
EBCDIC
• EBCDIC stands for Extended Binary Coded Decimal
Interchange Code.
• IBM invented this code to extend the binary coded
decimal. This code makes use of 8 bits and represents 28=
256 characters. It is an 8 bit code.
• It is used in IBM mainframe computers and mid range
computer systems.
ASCII Code
• ASCII Stands for American Standard Code for Information
Interchange. As the computer understands only numerical
values, So all characters must have numerical equivalent
called alphanumeric code.
• ASCII is the international standard for representing
characters, numbers and symbols. The idea is to represent
numbers as text.
• ASCII is the most common character encoding format for
text data in computers. This standard is used to represent
27 = 128 characters. It is an 7 bit code.
ASCII Code
• A-Z is represented from 65-90, a-z is represented from 97-
122.
• Ex- ‘Cs’ is represented as
Letter Decimal Binary
C 67 1000011
s 115 1110011
Gray Code
• Gray code is invented by a scientist named Frank Gray. It
is a non weighted code which means that weights are not
assigned to bits.
• It is also called as unit distance code because it exhibits a
single bit change from one gray code bit pattern to the next
code bit.
• It is not an arithmetic code. It is also called as cyclic code
or reflective code.
• Gray code is usually helpful in shaft position encoders. It
reduces the power of switching.
• Gray code is usually helpful in shaft position encoders. It
reduces the power of switching.
• This code reduces the number of errors.
Gray code
Decimal Number Binary Number Gray code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Excess-3 code
• This is also called as XS-3 code. It is unweighted 4 bit
code used to express decimal numbers.
• Excess-3 code can be obtained by adding 3 to each decimal
digit in a decimal number and converting the sum to a 4 bit
binary number.
• This code exhibit self-complementing property which is
useful in arithmetic operations.
• Ex- 5 0101
+ 3 0011
= 8  1000
Excess-3 code
Decimal BCD 8421 Excess-3
BCD + 0011
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
Unicode
• The different computer coding schemes don’t have enough
number of bits to represent all characters and language
specific symbols of multiple languages. Therefore,
Unicode standard as designed to overcome this problem.
• Unicode is a universal character encoding standard that
defines binary codes in bytes, words and double words for
characters used in different languages.
• It provides an efficient way to encode Multilanguage plain
text.
Unicode
• Unicode standard assigns a distinct number for each and
every character. It also assigns codes for special characters,
mathematical & technical symbols.
• Special feature of Unicode is that it encodes up to 1 million
characters (106) with unique codes.
• Unicode has 3 types of encoding formats.
 UTF-8
 UTF-16
 UTF-32
Computer-codes.pptx

Computer-codes.pptx

  • 1.
    DEPARTMENT OF COMPUTERSCIENCE & ENGG. Presented By: Praveen Tabbannavar Lecturer/CSE B.L.D.E.A’S S.S.M. POLYTECHNIC VIJAYAPUR B.L.D.E.A’S S.S.M POLYTECHNIC VIJAYAPUR Introduction to Number System
  • 2.
    Computer Codes Digital computersmake use of specialized computer codes or digital codes in order to represent binary numbers, decimal numbers, English alphabet, special symbols and instructions. There are various types of computer codes: 1. BCD 2. EBCDIC 3. ASCII code 4. Gray code 5. Excess-3 code 6. Unicode
  • 3.
    BCD • BCD standsfor Binary Coded Decimal. This code allows us to represent decimal digits up to 0 to 9 using a 4-bit binary code. It can also be referred to as 8421 code. BCD is simple to represent. It is a special code which represents single decimal digit. • This code provides an interface to binary/digital computer systems. It is also used in digital devices like 7-segment display, digital clocks, thermometers etc. • There can be only 10 BCD codes.
  • 4.
    BCD Codes fordecimal digits Decimal digit BCD code 8421 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001
  • 5.
    EBCDIC • EBCDIC standsfor Extended Binary Coded Decimal Interchange Code. • IBM invented this code to extend the binary coded decimal. This code makes use of 8 bits and represents 28= 256 characters. It is an 8 bit code. • It is used in IBM mainframe computers and mid range computer systems.
  • 6.
    ASCII Code • ASCIIStands for American Standard Code for Information Interchange. As the computer understands only numerical values, So all characters must have numerical equivalent called alphanumeric code. • ASCII is the international standard for representing characters, numbers and symbols. The idea is to represent numbers as text. • ASCII is the most common character encoding format for text data in computers. This standard is used to represent 27 = 128 characters. It is an 7 bit code.
  • 7.
    ASCII Code • A-Zis represented from 65-90, a-z is represented from 97- 122. • Ex- ‘Cs’ is represented as Letter Decimal Binary C 67 1000011 s 115 1110011
  • 8.
    Gray Code • Graycode is invented by a scientist named Frank Gray. It is a non weighted code which means that weights are not assigned to bits. • It is also called as unit distance code because it exhibits a single bit change from one gray code bit pattern to the next code bit. • It is not an arithmetic code. It is also called as cyclic code or reflective code. • Gray code is usually helpful in shaft position encoders. It reduces the power of switching. • Gray code is usually helpful in shaft position encoders. It reduces the power of switching. • This code reduces the number of errors.
  • 9.
    Gray code Decimal NumberBinary Number Gray code 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101 10 1010 1111 11 1011 1110 12 1100 1010 13 1101 1011 14 1110 1001 15 1111 1000
  • 10.
    Excess-3 code • Thisis also called as XS-3 code. It is unweighted 4 bit code used to express decimal numbers. • Excess-3 code can be obtained by adding 3 to each decimal digit in a decimal number and converting the sum to a 4 bit binary number. • This code exhibit self-complementing property which is useful in arithmetic operations. • Ex- 5 0101 + 3 0011 = 8  1000
  • 11.
    Excess-3 code Decimal BCD8421 Excess-3 BCD + 0011 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
  • 12.
    Unicode • The differentcomputer coding schemes don’t have enough number of bits to represent all characters and language specific symbols of multiple languages. Therefore, Unicode standard as designed to overcome this problem. • Unicode is a universal character encoding standard that defines binary codes in bytes, words and double words for characters used in different languages. • It provides an efficient way to encode Multilanguage plain text.
  • 13.
    Unicode • Unicode standardassigns a distinct number for each and every character. It also assigns codes for special characters, mathematical & technical symbols. • Special feature of Unicode is that it encodes up to 1 million characters (106) with unique codes. • Unicode has 3 types of encoding formats.  UTF-8  UTF-16  UTF-32