You are on page 1of 17

Lecture -

6
Computer
Codes

1
Data
凝Types
Numeric data consists of only numbers, 0, 1, 2, …. , 9

凝 Alphabetic data consists of only letters A, B, C, …. , Z, in both uppercase and lowercase, and blank
character

凝 Alphanumeric data is a string of symbols where a symbol may be one of the letters A, B, C, … , Z, in
either uppercase or lowercase, or one of the digits 0, 1, 2, … , 9, or a special character such as + - *
/ ( = etc.

2
Bit, Byte, and
凝Words
In binary coding, every symbol that appears in the data is represented by a group of bits (Binary Digits)
凝 The group of bits used to represents a symbol is called a byte
凝 As most modern coding schemes use 8 bits to represents a symbol, the term byte is often used to mean
a group of 8 bits

凝 To differentiate between bits and bytes, bit is written with a smal ‘b’ while byte with a capital ‘B’

3
Bit, Byte, and
凝Words
A binary number represented using 8 bits is cal ed a byte
凝 A less common, 4 bits representation is cal ed nibble
凝 1 6 bits is a word, 3 2 bits is a double word, and 6 4 bits is cal ed a quadruple
word


凝 Other
KILO quantifiers:
1K = 2 1 0
凝 1M = 2 2 0
MEGA
1G = 2 3 0
凝 GIGA 1T = 2 4 0
凝 TERA
1P = 2 5 0
凝 PETA

4
Computer
凝Codes
Computer codes are used for internal representation of data in
computers
凝 As computers use binary numbers for internal data representation, computers codes use binary
coding
schemes
凝 Commonly used computer codes are BCD, EBCDIC, ASCI and
Unicode

5
Computer
凝Codes
BCD or Binary Coded Decimal
凝 It is one of the early computer codes
凝 It uses 6 bits to represents a symbol
凝 It can represents 6 4 (2 6 ) different
characters

6
Computer
Codes

7
Computer
凝Codes
Example:
The binary digits used to record the word BASE in BCD

B = 110010
A = 110001
S = 010010
E = 110101

凝 So, 1100 10 1100 01 01 001 0 1101 01 wil record BASE in


BCD

8
Computer
凝Codes
EBCDIC or Extended Binary Coded Decimal Interchange
Code
凝 It uses 8 bits to represents a symbol
凝 It can represents 2 5 6 (2 8 ) different characters

9
Computer
Codes

10
Computer
凝Codes
Example:
The binary digits used to record the work BIT in EBCDIC

B = 11000010
I = 11001001
T = 11100011

凝 So, 11000010 11001001 11100011 wil record BIT in EBCDIC

11
Computer
凝Codes
ASCI or American Standard Code for Information Interchange
凝 It is of type types, ASCII-7 and ASCI - 8
凝 ASCI - 7 uses 7 bits (2 7 ) and ASCI - 8 uses 8 bits (2 8 ) to represents a
symbol
凝 First 1 2 8 characters in both ASCI - 7 and ASCI - 8 are same

12
Computer
Codes

13
Computer
凝Codes
Example:
The binary digits used to record the work BOY in ASCI - 7

B = 1000010
O = 1001111
Y = 1011001

凝 So, 10 001 0 1001111 1011001 wil record BOY in ASCI - 7

14
Computer
凝Codes
Example:
The binary digits used to record the work SKY in ASCI - 8

S = 01010011
K = 01001011
Y = 01011001

凝 So, 01010011 01001011 01011001 wil record SKY in ASCI - 8

15
Computer
凝Codes
Unicode or Universal Code, provides a consistent way to encoding multilingual plain text
凝 Defines codes for characters used in al major languages of the world
凝 Defines codes for special characters, mathematical symbols, technical symbols and diacritics
凝 Capacity to encode as many as million characters
凝 Assigns each character a unique numeric value and name
凝 Reserves a part of the code space for private use
凝 Affords simplicity and consistency for ASCI , even corresponding characters have same
code
凝 Specifies an algorithm for the presentation of text with bi-directional
behavior 凝 Unicode Transformation Format - UTF-8, UTF-16 and
UTF-32 variants 凝 Read more about Unicode at https://unicode-
table.com/en/

16
THANK
YOU
1
8

You might also like