Documente Academic
Documente Profesional
Documente Cultură
LECTURE 07
Although the words data and information are often used interchangeably,
there is strict sense consists, data consists of the raw numbers that computer
organize to produce information. Data is meaningless until it is not converted
into information after some processing.
HOW COMPUTER REPRESENT DATA
COMPUTER CODES
Numeric data is not the only form of data that is to be handled by a computer.
We often require to process alphanumeric data also. An alphanumeric data is
string of symbols. Where a symbol may be one of the letters A,B,C,……., Z or one
of the digits 0,1,2,3,4,….,9 or a special character such as +,-,*,/,(),=,space etc. An
alphabetic data consists of the only letters A,B,C,…..,Z and the blank character.
Similarly numeric data consists of only numbers 0,1,2,3,………, 9. However, any
data must be represented internally by the bits 0 & 1.
1
INTRODUCTION TO COMPUTER
LECTURE 07
BCD CODE
The binary coded Decimal (BCD) code is one of the early memory codes. It is
based on the idea of converting each digit of decimal number into its binary
equaling rather than converting the entire decimal value into a pure binary form. Since
8 and 9 require 4 bits all decimal digits are represented in BCD by 4 bits.
For example 4210 is equal to (101010)2 in a pure binary form.
Converting 4210 into BCD, however produces the following result.
4210=0100 0010
4 2
Or 01000010 in BCD
Decimal Digit BCD Equivalent
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
BCD Equivalent of Decimal Digit
The major problem with BCD code is that only 64(26) different characters can be
represented in it. This is not sufficient for providing decimal numbers (10) lower
case letters (26) capital letters (26) and fairly large numbers of others special
characters.
Hence the BCD code was extended from a 6-bit code to 8-bit code. The added 2
bits are used as additional zone bits expending the zone to 4 bits. The resulting
code is called the extended binary code decimal interchange code (EBCDIC). In
this code it is possible to represent 256 (28) different characters instead of 64(26).
2
INTRODUCTION TO COMPUTER
LECTURE 07
Because ECBDIC is an 8 bits code, it can be easily divided into two 4-bit
groups. Each of these 4 bits group can be represented by 1 hexadecimal number.
J 1101 0001 D1
K 1101 0010 D2
L 1101 0011 D3
M 1101 0100 D4
N 1101 0101 D5
O 1101 0110 D6
P 1101 0111 D7
Q 1101 1000 D8
R 1101 1001 D9
S 1110 0010 E2
T 1110 0011 E3
U 1110 0100 E4
V 1110 0101 E5
W 1110 0110 E6
X 1110 0111 E7
Y 1110 1000 E8
Z 1110 1001 E9
0 1111 0000 F0
1 1111 0001 F1
2 1111 0010 F2
3 1111 0011 F3
4 1111 0100 F4
5 1111 0101 F5
6 1111 0110 F6
7 1111 0111 F7
8 1111 1000 F8
9 1111 1001 F9
3
INTRODUCTION TO COMPUTER
LECTURE 07
Another Computer Code that is very widely used is the American Standard
Code for Information Interchange (ASCII). ASCII has been adopted by several
American Computer manufactures as their computers internal code.
ASCII is of two types. ASCII-7 and ASCII-8. ASCII-7 is a 7 bits code that allows
128(27) different characters, The first 3 bits are used as Zone bits and the least 4
bits indicate the digit. Microcomputer using 8-bits or byte use the 7 bit ASCII by
leaving the left most first bit of each byte as a zero.
ASCII-8 is an extended version of ASCII-7. It is an 8 bits code that allows 256(28)
different characters rather than 128. The additional bit is added to the zone bits.
Other than the zone bits ASCII-7 and ASCII-8 are identical.
A 100 0001 41
B 100 0010 42
C 100 0011 43
D 100 0100 44
E 100 1001 45
F 100 0110 46
G 100 0111 47
H 100 1000 48
I 100 1001 49
J 100 1010 4A
K 100 1011 4B
L 100 1100 4C
M 100 1101 4D
N 100 1110 4E
O 100 1111 4F
P 101 0000 50
Q 101 0001 51
4
INTRODUCTION TO COMPUTER
LECTURE 07
R 101 0010 52
S 101 0011 53
T 101 0100 54
U 101 0101 55
V 101 0110 56
W 101 0111 57
X 101 1000 58
Y 101 1001 59
Z 101 1010 5A
A 1010 0001 A1
B 1010 0010 A2
C 1010 0011 A3
D 1010 0100 A4
E 1010 0101 A5
F 1010 0110 A6
G 1010 0111 A7
H 1010 1000 A8
I 1010 1001 A9
J 1010 1010 AA
K 1010 1011 AB
L 1010 1100 AC
M 1010 1101 AD
N 1010 1110 AE
O 1010 1111 AF
P 1011 0000 B0
Q 1011 0001 B1
R 1011 0010 B2
S 1011 0011 B3
5
INTRODUCTION TO COMPUTER
LECTURE 07
T 1011 0100 B4
U 1011 0101 B5
V 1011 0110 B6
W 1011 0111 B7
X 1011 1000 B8
Y 1011 1001 B9
Z 1011 1010 BA