Anda di halaman 1dari 17

INTRODUCTION TO INFORMATION TECHNOLOGY

Chapter Four
Data Representation in Computers

Units of Data Representation: Bit, Byte, Word


The entire circuitry of the computer is designed on the basis of binary system. The Binary
number system is a group of zeros and ones. It is obvious that computer’s net intelligence is
absolutely zero i.e. computer is not capable of understanding anything except zeros and ones.
In computer every instruction is interpreted and executed in the form of binary system. From
the readability point of view it is very difficult to understand the string of bits. It is also very
difficult to write and understand the instruction or program written in binary form. Therefore,
the programs are generally written in high-level language or Assembly language. Later on
these programs are converted into machine language with the help of appropriate translators
such as Compiler, Assembler or Interpreter.

 The basic unit of the memory is a Bit. A Bit is an abbreviation for a Binary digit and can
be either a 0 or a 1.
 Group of continuous 4 bits is termed as Nibble.
 Eight adjacent bits designed to store the binary code of a single character (letter, decimal
digit or other character) is referred as Byte.
 A word is a fixed-sized group of bits that are handled together by the machine. The
number of bits in a word (the word size or word length) is an important characteristic
of computer architecture.
 A Word consists of 32 bits, which is equal to 4 bytes (this depends on the computer i.e.,
a word may contain 8, 16, or 32 bits). Commonly used notation in modern computers is
32 bits.
 Double word is 2 times a word.
 Frequently capacity of memory is represented in terms of K (Kilo) , which is equivalent
to 1024 words of 8 bits each ( 210 bytes ).

1 KILO = 1024 bytes (approx. 103 bytes) These are all the
1 MEGA = 210 K B approximate values
1 GIGA = 210 M B B stands for Byte
1 TERA = 210 G B
 1 PETA = 210 TERA B

Why Binary representation is used in computers?

 A computer’s internal storage techniques are different from the way people represent
information in lives.
 Information inside a digital computer is stored as a collection of binary data (0’s and 1’s)
 It was easier to make hardware which can distinguish between two values than multiple
values.
 Other bases need more circuitry as compared to binary and this reduced reliability.
 This binary system simplifies the design of the circuits, reduces the cost and improves the
reliability.
 Every operation that can be done in decimal system can also be done in binary.

1 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Concept of Number Systems and Binary Arithmetic


Number Systems
Every computer stores numbers, letters, and other special characters in a coded form. Before
going into the details of these codes, it is essential to have a basic understanding of the number
system. So the goal of this chapter is to familiarize you with the basic fundamentals of number
system. Number systems are basically of two types: non positional and positional.

Non-Positional Number Systems


In this system, we have symbols such as I for 1, II for 2, III for 3, IIII for 4 etc. Each symbol
represents the same value regardless of its position in the number and the symbols are simply
added to find out the value of a particular number. Since it is very difficult to perform arithmetic
with such number system, positional number systems were developed as the centuries passed.
Positional Number Systems
In the early days Non-Positional number system was very difficult to use, as it had no symbol for
0. History says that the 0 was invented in India. The positional number systems are Binary,
Octal, Decimal and Hexa-decimal. In positional number system there are only a few symbols
called digits, and these symbols represent different values depending on the position they occupy
in the number. The value of each digit in such a number is determined by three considerations.
 The digit itself.
 The position of the digit in the number, and
 The base or radix of the number system(where base is determined as the total number of
digits available in the number system)
We will introduce here 4 positional number systems
 Decimal Number System
 Binary Number system
 Hexadecimal Number System
 Octal Number System

1. Decimal Number System


The number system that we use in our day-to-day life is called the Decimal number system.
Decimal number system is a base 10 system which means there are 10 digits starting from 0 to
9 to represent any quantity. The position of each digit in a decimal number system is
represented as a power of the base (10).
o Value of the digits depends on the position they hold. For e.g :
4th 3rd 2nd 1st Total Value: 4*100+2*101+0*102+1*103 = 1024
103 102 101 100 Thus any number can be represented by using the available
digits and arranging them in various positions.
1 0 2 4

2 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

2. Binary Number System


The Binary Number system is a base 2 system with only two digits 0 and 1. Each position in
a binary number represents a power of the base (2).

3. Octal Number System


Octal Number System is a base 8 system. So in this system there are only eight symbols or
digits: 0,1,2,3,4,5,6,7. Each position in octal number represents a power of the base 8. Since
there are only 8 digits in the octal number system, 3 bits are sufficient to represent any octal
number in binary.

4. Hexadecimal Number System


Hexadecimal number system is a base 16 system with 16 digits namely
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F; Where A represents decimal 10, B represents decimal 11 , C
represents decimal 12, D represents decimal 13, E represents decimal 14 and F represents
decimal 15.
Comparative Representation of Number Systems

Hexa decimal
Decimal System Binary System Octal System
System
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
: : : :
: : : :

3 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Base Conversion: Converting From One Number System to Another

Converting to Decimal from another Base


(a) Integer Part Conversion
Step 1: Determine the positional value of each digit.
Step 2: Multiply the positional value by the digits in the corresponding columns.
Step 3: Sum the products obtained in step 2. The total is the equivalent value in decimal.

(b) Decimal Part Conversion


For converting a fraction of binary system into decimal the following steps should be followed:
Step 1: Multiply each digit of binary from left to right by base–1, base–2, base–3 and base–4....
respectively.
Step 2: Simplify the arithmetic expression and add them together to find the required fraction of
decimal system.
Step 3: Now by combining both the converted parts we can find the decimal equivalent of the
binary number.

Binary to Decimal
(For conversion of a binary number to a decimal number the base / radix will be 2)
Example 1 Convert binary (1100)2 to decimal form.
Solution
Digit Positional value(Step 1) Step 2
0(right most digit) 20 0*20
0 21 0*21
1 22 1*22
1 23 1*23
Total (Step 3) 4+8=12
Therefore 11002 =1210
Example 2 Convert binary (11101101.10101)2 to decimal form.
Solution
Integer part – 11101101
Fractional part – 10101
Conversion of integer part :
1×27 + 1×26 + 1×25 + 0×24 + 1×23 + 1×22 + 0×21 + 1×20
 1×128 + 1×64 + 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1
 128 + 64 + 32 + 0 + 8 + 4 + 0 + 1
 (237)10
Conversion of fractional part :
Starting from left to right each bit is multiplied by
2–1, 2–2, 2–3, 2–4...... we find
1 0 1 0 1
 ———–––––––––
1×2 + 0×2–2 + 1×2–3 + 0×2–4 + 1×2–5
–1

 .50 + 0 + .125 + 0 + .03125 = (.65625)10


By combining both the resultant values we get the final decimal equivalent value (237.65625)10
4 | | Adigrat University, College of Engineering and Technology, Department of Information Technology
INTRODUCTION TO INFORMATION TECHNOLOGY

Useful Tips
+ve Power of 2 Equivalent value –ve Power of 2 Equivalent values
20 1 2–1 .50
21 2 2–2 .25
22 4 2–3 .125
23 8 2–4 .0625
24 16 2–5 .03125
25 32 2–6 .015625
26 64 2–7 .0078125
27 128 2–8 .00390625
28 256 2–9 .001953125
29 512 2–10 .000976562
210 1024 2–11 .000488281

Note : A binary number having all 1s and without fractional part can be
converted into decimal number system by the following direct conversion
formula : 2n-1, where n is the total number of bits in the binary number.
Example
Convert Binary 11 into its decimal equivalent: (11)2 = (?)10
Here n = 2 2n–1 = 22–1 = (3)10

Octal to Decimal
(For conversion of an octal number to a decimal number the base / radix will be 8.)
Example 1 Convert octal number (172)8 to decimal (?)10
Solution
Conversion of integer part : Starting from right multiply each digit by its positional value , we find
1 7 2
1×82 + 7×81 + 2×80
 1×64 + 7×8 + 2×1
 64 + 56 + 2
 (122)10.The converted decimal equivalent value we find is (172)8 = (122)10
Example 2
Convert (342.671)8 to decimal (?)10 form.
Solution
Integer part – 342
Fractional part – 671
Conversion of integer part Conversion of fractional part
3 4 2 Starting from left to right each digit is multiplied by
3×8 2 + 4×81 + 2×80 8–1, 8–2, 8–3, 8–4...... we find –
 3×64 + 4×8 + 2×1 6 7 1
 192 + 32 + 2 –1
6×8 + 7×8 –2 + 1×8–3
 (226)10 0.75 + 0.1093 + 0.00195 = (0.86125)10

By combining both the converted values we get the final decimal equivalent (226.86125)10

5 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

+ve Power of 8 Equivalent values –ve Power of 8 Equivalent values


80 1 8–1 .125
81 8 8–2 .015625
82 64 8–3 .00195312
83 512 8–4 .0002441406
84 4096 8–5 .00003051757
85 32768 8–6 .00000381469
86 262144 8–7 .00000047683
: : : :
: : : :
Hexadecimal to Decimal
(For the conversion of Hexa - decimal to a decimal number the base/radix will be 16. )

Example 1 Convert hexa-decimal number (3DF)16 to decimal (?)10


Solution
Conversion of integer part :
Starting from right multiply each digit by nth bit × 16n-1, we find
3 D F
3×16 + 13×16 + 15×160
2 1

 3×256 + 13×16 + 15×1


 768 + 208 + 15
 (991)10
The converted decimal equivalent value is – (3DF)16 = (991)10

Example 2 Convert (5DE.1A)16 to decimal (?)10 form.


Solution
Integer part – 5DE
Fractional part – 1A
Conversion of integer part-
Starting from right multiply each digit by nth bit × 16n-1, we find –
5 D E
5×16 + 13×16 + 14×160
2 1

 5×256 + 13×16 + 14×1


 1280 + 208 + 14
 (1502)10
Conversion of fractional part
Starting from left to right each digit is multiplied by 16–1, 16–2, 16–3, 16–4... we find
1 A
1×16 + 10×16–2
–1

 +
 0.0625 + 0.039062 = (0.101562)10
by combining both the values we get the final decimal equivalent. 
  (1502.101562)10

6 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

+ve Power of 16 Equivalent value –ve Power of 16 Equivalent value


160 1 16–1 .0625
161 16 16–2 .0039062
162 256 16–3 .00024414062
163 4096 16–4 .00001525878
164 65536 16–5 .00000095367
165 1048576 16–6 .0000000596
166 16777216 16–7 .00000000372
: : : :
Converting From Decimal to a New Base

(a) Integer part conversion


Steps:
Step 1: Divide the decimal number to be converted by the value of the new base.
Step 2: Record the remainder from step 1 as the rightmost digit (Least Significant Digit) of
the new base number.
Step 3: Divide the quotient of the previous division by the new base.
Step 4: Record the remainder from step 3 as the next digit (to the left) of the new base
number.

Repeat steps 3 and 4 recording remainders from right to left, until the quotient becomes
zero in step 3. Note that the last remainder thus obtained will be the most significant digit (MSD)
of the new base number.

(b) Fractional part conversion


(1) In this method we multiply given fractional part by ‘base’ and write down the Fractional
parts and integer parts of the products in the separate columns.
(2) The successive fractional parts of the products are multiplied by base till the fractional part
of the product becomes 0 or up to the desired accuracy.
(3) The integer part of the product is written in downward direction (  ) to find the binary
equivalent of the decimal fraction.

Example 1

Decimal to Binary Decimal to Octal Decimal to Hexadecimal


2510 =? 2 95210 =? 8 42810 = ?16
Q R Q R Q R
25 952  428 
12 119  0 26 
6  3 1 14  7 0 1  0 1
3 0 7 1 6 `
1 1 1  =1 10 12
=1 A C 16
= 110012 =16708

7 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Example 2: Find the Binary equivalent of (75.68)10 = (?)2


Solution
Integer part conversion
Dividend  divisor = Quotient (Remainder)
75 2 = 37 1 LSD
37 2 = 18 1
18 2 =9 0 
9 2 =4 1  (1001011)2
4 2 =2 0
2 2 =1 0
1 2 =0 1 MSD

Fractional part conversion -


Process Product Decimal part Integer part
0.68 × 2 1.36 .36 1 MSD
0.36 × 2 0.72 .72 0
0.72 × 2 1.44 .44 1  (10101)2
0.44 × 2 0.88 .88 0
0.88 × 2 1.76 .76 1 LSD

Now the combined string of converted integer and fractional part will be
(75.68)10 = (1001011.10101)2
Example 3: Find the Octal equivalent of (634.640625)10 = ( ? )8
Solution
Integer part conversion
(Divisor) Dividend  divisor = Quotient (Remainder)
8 634 8 = 79 2 R1 LSD
8 79 8 = 9 7 R2
8 9 8 = 9 1 R3  (1172)8
8 1 8 = 0 1 R4 MSD

Fractional part conversion


Process Product Decimal part Integer part
0.640625 × 8 5.125 .125 5 MSD
0.125 × 8 1.00 .00 1   (510)8
0.00 × 8 0.00 .00 0 LSD
Now the combined string of converted integer and fractional part will be -
(634.640625)10 = ( 1172.510 )8
Example 4: Find the Hexa-decimal equivalent of (3634.6505)10 = ( ? )16
Solution: Integer part conversion
(Divisor) Dividend  divisor = Quotient (Remainder)
16 3634 16 = 227 2 R1 LSD
16 227 16 = 14 3 R2  (E32)16
16 14 16 = 0 14 = E R3 MSD

8 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Fractional part conversion


Process Product Decimal part Integer part
0.6505 × 16 10.408 .408 10 = A MSD
0.408 × 16 6.528 .528 6 
0.528 × 16 8.448 .448 8  (0.A6872)16
0.448 × 16 7.168 .168 7
0.168 × 16 2.688 .688 2 LSD
Now the combined value of converted integer and fractional part will be -
(3634.6505)10 = (E32.A6872 )16

Converting From A Base Other Than 10(Decimal) To Base Other Than 10


(Decimal)

Step 1: Convert the original number to a decimal number (base 10)


Step 2: Convert the decimal number so obtained to the new base.

Eg: 3456 =? 4
First, Convert 3456 into its equivalent decimal.
=5*60+4*61+3*62 Now, convert 137 10 =? 4
=5+24+108 137 1
=13710 34  8 2
8  2 0
So, 3456 = 20214 2 2

Shortcut Method for Binary to Octal Conversion (Direct method)

(a) Integer part conversion

Step 1: Divide the binary digits into groups of three (starting from the right). If any last group does
not have sufficient bits to make the pair of 3 bits then some 0 bits can be included to the left
to make the group of 3 bits.
Step 2: Convert each group of 3 binary digits into one octal digit. Since decimal digits 0 to 7 are
equal to octal digits 0 to 7, binary to decimal conversion can be used in this step.
(b) Fractional part conversion
Step 1: Here the grouping of 3 bits is done from left to right and if any last group does not have sufficient
number of bits then adequate zeros can be included to the right of the last group.
Step 2: Now each group of bits is converted into its octal equivalent number.
Step 3: After this if integer part is present all the equivalent octal numbers of integer parts and fractional
parts are combined to find the final octal equivalent number.
Step 4: At last the decimal point is fixed at the appropriate position according to the mathematical
conventions.
Example 1: Find the octal equivalent of (10101.01101)2 = (?)8
Solution

0 1 0 1 0 1 0 1 1 0 1 0
·

2 5  · 
3 2  (10101.01101)2 = (25.32)8
R to L grouping L to R

9 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Shortcut Method For Octal To Binary Conversion


Step 1: Convert each octal digit to a 3 digit binary number. (Here octal digits are
considered as decimals.)
Step 2: Combine all the resulting binary groups into a single binary number.

Example 1: Find the binary equivalent of (2172.01)8


Solution
The 3 bits binary combinations of octal equivalent digits are as follows
Octal Binary
2 = 010
1 = 001
7 = 111
0 = 000
By combining all the 3 bits binary combinations we get–
2 1 7 2 . 0 1
010 001 111 010 000 001
 (2172.01)8 = (010001111010.000001)2

Shortcut Method for Binary to Hexadecimal Conversion

(a) Integer part conversion


Step 1: Divide the binary digits into groups of four. (Starting from the right)
Step 2: Convert each group of four digits to one hexadecimal digit. Hexa decimal digits 0
to 9 are equal to decimal digits 0 to 9, and hexa decimal digits A to F are equal to decimal
10 to 15. Hence the binary to decimal conversion procedure can be used, but the decimal
values 10 to 15 must be represented as hexa decimal A to F.
(b) Fractional part conversion
Step 1: The grouping of 4 bits is done from left to right and if any last group does not have the sufficient
number of bits then adequate 0s can be included to the right of the last group.
Step 2: Now each group of bits is converted into its hexa-decimal equivalent number.
Step 3: After this all the equivalent hexa-decimal numbers of integer parts and fractional parts are
combined to find the final hexa-decimal equivalent number.
Step 4:Lastly the decimal point is fixed at the appropriate place according to the mathematical
conventions.
Example 1: Find the hexa-decimal equivalent of (100001011.000011) = (?)16
Solution
0 011 0 0 0 0 1011 · 0000 110 0

1 0 B  
0 C   (10B.0C)16
R to L L to R
grouping
Shortcut Method for Hexadecimal to Binary Conversion

(a) Integer part conversion


Step 1: Convert the decimal equivalent of each hexa digit to a 4 digit binary number.
Step 2: Combine all the resulting binary groups into a single binary number.

10 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

(b) Fractional part conversion


Step 1: The grouping of 4 bits is done from left to right and if any last group does not have the sufficient
number of bits then adequate 0s can be included to the right of the last group.
Step 2: Now each group of bits is converted into its hexa-decimal equivalent number.
Step 3: After this all the equivalent hexa-decimal numbers of integer parts and fractional parts are
combined to find the final hexa-decimal equivalent number.
Step 4: Lastly the decimal point is fixed at the appropriate place according to the mathematical
conventions.

Example 1: Find the binary equivalent of (AC4.16F)16 = (?)2


Solution
The group of 4 binary bits of hexa-decimal equivalent numbers is as follows :
Hexa-decimal Binary
A = 1010
C = 1100
4 = 0100
1 = 0001
6 = 0110
F = 1111
By concatenating (combining) all the 4 bit binary combinations we get
A C 4 . 1 6 F
1010 1100 0100 0001 0110 1111
 (AC4.16F)16 = (101011000100.000101101111)2
Binary Arithmetic
Operations on Binary Numbers

1. Binary Addition
Rule:
0+1=1
1+0=1
0+0=0
1+1=0, with a carry 1 over to the next higher column.
Add the following number
101 + 11
101
+ 11

1000
Complement or 1’s Complement of Binary Numbers
Complement or 1’s Complement of Binary Numbers
Rule:
Complement of 1 = 0
Complement of 0 = 1

E.g.. 1’s complement of 101 = 010

11 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Two’s Complement of a Binary Number

Two’s Complement of a Binary Number


Rule:
2’s Complement = 1’s Complement +1

E.g.. 2’s Complement of 101 = 1’s Complement of 101 + 1


= 010+1= 011

Addition Using Signed Numbers


Negative numbers are represented in its 2’s complement form. 5-bit representation is used for
all example numbers; the first bit (MSB) being the sign bit.

Two Positive Numbers


Eg: (+9) + (+4)

+9 0 1001
+4 + 0 0 1 0 0
----------------
0 1 1 0 1 = +13

Sign bits

Positive Number and Smaller Negative Numbers

Eg: (+9) + (-4)

+9 0 1001
-4 + 1 1 1 0 0 (-4 is in its 2’s complement representation)
--------------------
1 0 0101 =+5

This extra carry will be dis-regarded


Positive Number and a Larger Negative Number

Eg: (-9) + (+4)

-9 1 0111 (-9 is in its 2’s complement representation)


+4 + 0 0100
--------------------
1 1011 = -5 (answer is in 2’s complement form)

12 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Two Negative Numbers

Eg: (-9) + (-4)

-9 1 0111 (-9 is in its 2’s complement representation)


-4 + 1 1100 (-4 is in its 2’s complement representation)
-----------------
1 1 0011 = -13 (in its 2’s complement form)

This extra carry will be dis-regarded

Same Numbers with Opposite Signs


Eg: (-9) + (+9)

-9 1 0111 (-9 is in its 2’s complement representation)


+9 + 0 1001
----------------
1 0 0000 =0

This extra carry will be dis-regarded

2. Binary Subtraction
Rule:
1-1=0
1-0=1
0-0=0
0-1=1, a borrow 1 from the next higher column.
Eg: 101-11
101
- 11
010
Binary Subtraction in the 2’s Complement System
Eg: (+9) - (+4)
+9 01001
+4 -00100
Here, +4 is to be changed to its 2’s complement form. i.e, 11100. And now add this number with
+9 (01001) .

+9 0 1001
-4 + 1 1100
-----------------
1 0 0101 =+5

This extra carry will be dis-regarded


13 | | Adigrat University, College of Engineering and Technology, Department of Information Technology
INTRODUCTION TO INFORMATION TECHNOLOGY

Any subtraction operation, then, actually becomes one of the addition when 2’s complement system is
used. This feature of 2’s complement system allows addition and subtraction to be performed by the same
circuitry- made it the most widely used method.
3. Multiplication of Binary Numbers
Eg: (910 ) * (1110 )
910 = 1 0 0 1 multiplicand
1110 = 1 0 1 1 multiplier
----------
1001
1001
0000
1001
-------------------
1100011 = 9910
4. Division of Binary Numbers
Eg: (910 ) ÷ (310 ) 910 = 1 0 0 1 dividend
310 = 0 0 1 1 divisor

0011 = 310

11 1001
011
------------
0011
0011
------------
0000
Computer Codes

Computer handles different types of data namely numeric data, alphanumeric data, alphabetic
data etc. Computer system use a binary system for data representation; Two digits 0 and 1, refer
to the presence and absence of electric current or pulse of light. All data and programs that go
into the computer are represented in terms of these numbers.
Computer system encodes the data by means of binary or digital coding schemes to
represent letters, numbers and special characters. One of the early coding schemes is BCD. Some
of the commonly used schemes are EBCDIC, ASCII, and Unicode.
BCD (Binary Coded Decimal)
BCD is one of the early memory codes. In BCD each digit of a decimal number is
converted into its binary equivalent rather than converting the entire decimal value into binary
form. And each decimal digit uses 4 bits for this conversion.

Eg: 4210 is not equal to 1010102 in BCD


4210 is equal to 0100 00102 in BCD (Here 410 = 0100 and 210 = 0010)
910 = 1001 in BCD
110 = 0001 in BCD
1010 = 0001 0000 in BCD
1510= 0001 0101 in BCD

14 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY
BCD Coding Scheme for All
Since 4 bits is insufficient to represent Numeric and Alphabetic Characters
characters, 6 bits representation was
introduced in BCD coding. 6 bit is enough to
represent 10 decimal digits, 26 alphabetic
letters and 28 other special characters. Also
using 6 bits we can represent 26 (=64)
different characters.
6 bit BCD code can be easily divided
into 3 bit groups and each group can be
represented by 1 octal digit. Thus octal number
system is used as a shortcut notation for memory
dump by computers that use BCD code for internal
representation characters.
IBM and BCD
Some variation of BCD was used in most
early IBM computers, including the IBM
1620, IBM 1400 series and non-Decimal
Architecture members of the IBM 700/7000
series. With the introduction of System/360,
IBM replaced BCD with 8-bit EBCDIC. BCD
is still heavily used in IBM processors and
databases, such as IBM DB2.
Example 1
Write a BCD code for the word CASE
Solution
C A S E
11 0011 11 0001 01 0010 11 0101
 The BCD code for CASE is
– 110011 110001 010010 110101

EBCDIC (Extended Binary Coded


Decimal Interchange Code)

Using 6 bits BCD can represent only 64


characters. To represent lowercase alphabets EBCDIC
EBCDIC Coding
Coding Scheme
Scheme for
for All
All
(26), uppercase alphabets (26), decimal numbers Numeric and Alphabetic Characters
Numeric and Alphabetic Characters
(10) and special characters (28+) BCD coding is
not sufficient and was extended from 6 bit to 8
bit. And the new coding scheme is EBCDIC.

EBCDIC using 8 bits can represent 28 (=256)


different characters. EBCDIC 8 bit coding can
be divided into 2 groups of 4 bits. Each group
can be represented using 1 hexa decimal digit.
This scheme is developed by IBM and hence
mostly used in IBM model computer and
mainframe.

15 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

This code can represent the following type of coded information. (i) Printable (ii) non printable
(iii) lowercase letters - a, b, c ...... z (iii) upper case letters eg. A, B, C ...... Z (iv) numeric values 0, 1, 2
........ 9 (v) some special characters such as + , –, $ etc.

Example 1 Find the EBCDIC code for PEN


Solution By using the EBCDIC table
P E N
1101 0111 1100 0101 1101 0101
 The EBCDIC code for PEN is 1101 0111 1100 0101 1101 0101

Example 2 Find the EBCDIC code for MAISM


Solution By using the EBCDIC table
M A I S M
1101 0100 1100 0001 1100 1001 1110 0010 1101 0100
D 4 C 1 C 9 E 2 D 4
 The EBCDIC code for MAISM is
1101 0100 1100 0001 1100 1001 1110 0010 1101 0100
 D4C1C9E2D4 in Hexa-decimal system

ASCII (American Standard Code for Information Interchange)

This binary scheme originally used 7 bits to from a character and so known as ASCII- 7 coding
scheme. ASCII 7 can represent only 27 (=128) different characters.

(American Standard Code for Information


Interchange) Pronounced “ask-ee,” it is the ASCII-7 Coding Scheme for All
built-in binary code for representing characters Numeric and Alphabetic Characters
in all computers except IBM mainframes, which
use the EBCDIC coding system. ASCII is the
binary code used in most of the microcomputers.

ASCII was originally developed for


communications and uses only seven bits per
character(character and so known as ASCII- 7
coding scheme.), providing 128 combinations
that include upper and lower case alphabetic
letters, the numeric digits and special symbols
such as the $ and %. In this the first 32
characters are set aside for communications and
printer control. ASCII encoding scheme uses
hexadecimal for its shortcut notation.

16 | | Adigrat University, College of Engineering and Technology, Department of Information Technology


INTRODUCTION TO INFORMATION TECHNOLOGY

Example 1 Find the ASCII-7 code for ROYAL


Solution By using ASCII-7 table :
R O Y A L
101 0010 100 1111 101 1001 100 0001 100 1100
 The ASCII-7 code for ROYAL is - 1010010 1001111 1011001 1000001 1001100

Example 2 Find the ASCII-7 code for NOSE


Solution By using ASCII-7 table :
N O S E
100 1110 100 1111 101 0011 100 0101
 The ASCII-7 code for NOSE is - 1001110 1001111 1010011 1000101

ASCII-8
To provide more possible combinations with which to
form other characters and symbols. Extended ASCII
ASCII-8 Coding Scheme for All
or ASCII-8 was introduced. ASCII-8 use 8 bits to Numeric and Alphabetic
form a character and can represent 28 (=256) different Characters
characters.

Example1 Find the ASCII-8 code for TOOL.


Solution By using ASCII-8 table :
T O O L
1011 0100 1010 1111 1010 1111 1010 1100

 The ASCII-8 code for TOOL is
- 10110100 10101111 10101111 10101100

Example 2 Find the ASCII-8 code for RAJA

Solution By using ASCII-8 table :


R A J A
1011 0010 1010 0001 1010 1010 1010 0001

 The ASCII-8 code for RAJA is
- 10110010 10100001 10101010 10100001

17 | | Adigrat University, College of Engineering and Technology, Department of Information Technology

Anda mungkin juga menyukai