Computer-codes.pptx

4,065 views 14 slides Sep 09, 2023
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

What are computer codes, Types of computer codes, BCD, EBCDIC, ASCII, Gray code, Excess-3 code, Unicode. Conversion of a given decimal digit in to its equivalent BCD code, ASCII Conversions, Gray code conversions, Types of Unicode, EBCDIC code.


Slide Content

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 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 2 8 = 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 2 7 = 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 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 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 (10 6 ) with unique codes . Unicode has 3 types of encoding formats. UTF-8 UTF-16 UTF-32