Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

EC T45 – DIGITAL CIRCUITS

NUMBER SYSTEM: Binary Number Representations – Signed Numbers and Complements, Unsigned, Fixed point
and Floating point numbers. Addition and Subtraction with 1’s and 2’s complements. CODES: Binary code for
decimal numbers – Gray code – Codes for detecting and correcting errors: Even and Odd parity codes, Hamming
Codes, Checksum codes, m-out-of-n codes.

UNIT 1
NUMBER SYSTEMS
Introduction to Digital System
 In digital system, the data is usually in binary states (0 and 1) and is processed and stored
electronically to prevent errors due to noise and interfering signals.
 The term digital in digital circuits is derived from the way circuit perform operations by
counting digits.
 A digital circuit operates with binary numbers, i.e only in two states. The output of the
circuit is either low (0) or high (1) in a positive logic system.
 In general 0 represents zero volts and 1 represents five volts. If the situation is reverse, it is
known as negative logic system.
 Digital circuits find application in computers, telephony, data processing, radar navigation,
military systems, etc.
 The advantages of digital systems are as follows:
 Digital systems are generally easier to design.
 Digital information storage is easy.
 Accuracy and precision are greater as compared to the analog system.
 Digital circuits are less affected by noise.
 More digital circuitry can be fabricated on IC chips.

Number Systems
 Number system is a basis for counting various items. On hearing the word number all of us
immediately think of the familiar decimal number system with its 10 digits, i.e. 0, 1,
2,3,4,5,6,7,8 and 9.

 Modern computers communicate and operate with binary numbers which use only the
digits 0 and 1.

Decimal Number System


 The Decimal number system has 10 symbols, so the radix or base of this number system is
10. The ten symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
 The position of each digit in a decimal number indicates with the magnitude of the
quantity represented and can be assigned a weight.
 Hence, it is called as Positional weight number system. The general format of decimal
number system is as follows:

[Format of decimal number system]


 The decimal number can be represented as (128)10 or simply as 128.

Convert (0.513)10 to an octal number.


Fractional Part = (0.513)10
0.513 × 8 = 4.104  4
0.104 × 8 = 0.832  0
0.832 × 8 = 6.656  6
0.656 × 8 = 5.248  5

(0.513)10 = (0.4065)8

Convert the following decimal number to binary. 673.23

2 673
2 336 1
2 168 0
2 84 0
2 42 0
2 21 0
2 10 1
2 5 0
2 2 1
1 0

Fractional part – (0.23)


0.23 × 2 = 0.460
0.46 × 2 = 0.92 0
0.92 × 2 = 1.84 1
0.84 × 2 = 1.68 1
(0.23)10 = (0.0011)2

(673.23)10 = (1010100001.0011)2

Convert (2598.675)10 into hexadecimal.


.675 x 16 = 10.8
16 2598 .800 x 16 = 12.8
16 162 6
.800 x 16 = 12.8
10 2
(2598.675)10 = (A26.ACC)16

Binary Number System


 The binary number system is simple because it consists of only two digits, i.e. 0 and 1.
 Just as decimal system with base-ten system, the binary system with its two digits is a
base-two system. The position of 0 or 1 in a binary number indicates its weight within the
number.
 In a binary number, the weight of each successively higher position to the left is an
increasing power of two.
 In digital system, each of binary digits is called a bit and a group of 4 and 8 are called a
nibble and byte respectively.

Convert (111.101)2 to decimal.


(111.101) = (1 x 22) + (1 x 21) + (1 x 20) + (1 x 2-1) + (0 x 2-2) + (1 x 2-3)
= 4 + 2 + 1 + 0.5 + 0 + 0.125
= 7.625
(111.101) = (7.6256)

Convert (10101111001.0111)2 into octal.


10101111001.0111 = 10 101 111 001 . 011 100
=2 5 7 1 . 3 4
(10101111001.0111) = (2571.34)

Convert (01011111011.011111)2 into hexadecimal.


(01011111011.011111)2 = 010 1111 1011 . 0111 11
= 2 F B . 7 C
(01011111011.011111)2 = (2FB.7C)

Octal Number System


 The octal number system uses the digits 0,1, 2, 3, 4, 5, 6 and 7. The base or radix of this
system is eight. Each significant position in an octal number has positional weight.
 The least significant position has weight of 80 , i.e 1; the higher significant position are
given weights in ascending powers of eight, i.e. 81, 82, 83, etc.

Convert (743)8 to decimal. (Nov/ Dec 2014)


To convert the value (743)8to decimal using positional method,
(743)8 = ( 7 × 82 ) + ( 4 × 81 ) + ( 3 × 80 )
= 448 + 32 + 3
= (483)10
(743)8 = (483)10

Convert (367.52)8 into binary.


(367.52)8 = 3 6 7 . 5 2
= 011 110 111 . 101 010
(367.52)8 = (011110111.101010)

Convert (756.603)8 to hexadecimal.


(756.603)8 = 7 5 6 . 6 0 3
= 111 101 110 . 110 000 011
= 0001 1110 1110 . 1100 0001 1000
= 1 E E . C 1 8
(756.603)8 = (1EE.C18)

Hexadecimal Number System


 The Hexadecimal number system has a radix of 16 and uses 16 symbols, namely 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, A, B, C, D, E and F.

 The symbols A, B, C, D, E and F represents 10, 11, 12, 13, 14 and 15. Each significant
position in an octal number has positional weight.
 The least significant position has weight of 160 , i.e 1; the higher significant position are
given weights in ascending powers of eight, i.e. 161, 162, 163, etc.

Convert (3A9E.B0D)16 into binary.


(3A9E.B0D)16 = 3 A 9 E . B 0 D
= 0011 1010 1001 1110 . 1011 0000 1101
(3A9E.B0D)16 = (0011 1010 1001 1110 . 1011 0000 1101 )

Convert (A0F9.0EB)16 to decimal.


(A0F9.0EB)16 = (10 x 163) + (0 x 162) + (9 x 161) + (0 x 16-1) + (14 x 16-2) + (11 x 16-3)
= 40960 + 0 + 240 + 9 + 0 + 0.0546 + 0.0026
(A0F9.0EB)16 = (41209.0572)

Convert (B9F.AE)16 to octal.


(B9F.AE)16 = 1011 1001 1111 . 1010 1110
= 101 110 011 111 . 101 011 100
= 5 6 3 7 . 5 3 4
(B9F.AE)16 = (5637.534)8
Possible Conversions in Number system

[Possible Conversions in Number system]

Binary Number Representation


Signed and Unsigned Numbers

 Signed numbers are represented with a separate sign bit along with the magnitude. In an 8-
bit number, the MSB is the sign bit and the remaining 7 bit corresponds to the magnitude.
 The magnitude part contains true binary equivalent of the number for positive numbers,
while 2’s complement form of the number for negative numbers.
 In sign – magnitude form, additional bit called the sign bit is placed in front of the number.
If the sign bit is 0, the number is positive. If it is a 1, the number is negative.
 Consider an example 0101001. In this number the LSB (Least Significant Bit) is 0. So it
will be negative number. Therefore the number can be represented as (-41).
 Consider an example 1001001. In this number the LSB (Least Significant Bit) is 1. So it
will be positive number. Therefore the number can be represented as (+41).
 The unsigned numbers are positive numbers. It can be represented either as a 8 bit number
or with additional bits considering as 0’s.
 Format to represent unsigned number is xxxxx --> 000xxxxx,Copy the original integer
into the LSBs, and put 0's elsewhere.
Complements

 Complements are used in digital computer for simplifying the subtraction operations and
for logical manipulations.
 There are two types of complements for each base r number system. When the value of the
base r is substituted in the name.

 Generally r base number system, the complements are classified as follows.


 Radix Complement (or) rs complement
 Diminished Radix Complement or (r - 1)’s complements
 For binary number system (r = 2), the complements are
 2’s Complements
 1’s Complements
 For decimal number system (r = 10), the complements are
 10’s Complements
 9’s Complements

Find the 9’s and 10’s Complements for the given decimal number (467)
Solution
To find the 10’s complement of 467, first we have to find the 9’s complement of 467. The 9’s
complement of a number can be found by subtracting each bit by 9.
9’s complement of 467 = 999
-467
= 532
10’s Complement of a number can be found by adding 1 to the 9’s complement of that number.
10’s Complement of 467 = 532
+ 1
10’s Complements of 467 = 533

Complement the decimal value (5976) using 9’s and 10’s complement methods.
Decimal Value = 5976
9’s Complement Method:
9999
Decimal value = 5976
9’s Complement no. = 4023

10’s Complement Method:


9999
Decimal value = 5976
9’s Complement no. = 4023
+ 1
10’s Complement no. = 4024

Find the 1’s and 2’s Complements for the given binary number 10101
To find the 2’s complement of 10101, first we have to find the 1’s complement of 10101. The 1’s
complement of a number can be found by changing 0 to 1 and 1 to 0.

1’s complement of 10101 = 01010


2’s Complement of a number can be found by adding 1 to the 1’s complement of that number.
2’s Complement of 10101 = 01011
+ 1
10’s Complements of 467 = 01100

Fixed and Floating Point Representation


 In a decimal system, very large and very small numbers are expressed in scientific
notation as follows: 4.69×1023 and 1.601×10-19.
 Binary numbers can also be expressed by the floating point representation.
 The floating point representation of a number consists of two parts: the first part represents
a signed, fixed point number called the mantissa (m); the second part designates the
position of the decimal (or binary) point and it is called the exponent (e).
 The fixed point mantissa may be a fraction or an integer. The number of bits required to
express the exponent and mantissa is determined by the accuracy desired from the
computing system as well as its capability to handle such numbers.
 For example, the decimal number +6132.789is represented in floating point as follows:

Sign Sign
0 0.6132789 0 04

Mantissa exponent
 The mantissa has a 0 in the leftmost position to denote a plus. Here the mantissa is
considered to be a fixed point fraction.
 This representation is equivalent to the number expressed as fraction 10 times by an
exponent that is 0.632789 × 10+04. The mantissa is also called the fractional part,
Sign Sign
0 36754 1 03
 When the number is represented in a register in its binary coded-form, the actual value of
the register becomes 0 011 110 111 101 100 and 1 000 011.
 Most computers and all electronic calculators have a built-in capacity to perform floating
point arithmetic operations.

Difference between Fixed and Floating Point Number Representation


S.No Fixed point numbers Floating point numbers
1. In fixed point arithmetic, you peak an In floating point arithmetic, you peak an
error margin on your absolute error, error margin on your relative error,
imagine you want all your calculation to imagine you want all your calculation to be
be correct to their 3rd decimal, 0.001 correct with less than %1 error with respect
error margin. to the original number
2. A fixed point number has a specific A floating point number does not reserve a
number of bits reserved for the integer specific number of bits for the integer part
part and a specific number of bits or the fractional part. Instead it reserves a
reserved for the fractional part certain number of bits for the number and a
certain number of bits to say where within
that number the decimal place sits
3. Fixed point format was in Floating point number that took up 10
decimal IIIII.FFFFF then the largest digits with 2 digits reserved for the
number represented as 99999.99999 and exponent might represent a largest value
the smallest would be 00000.00001. of 9.9999999e+50 and a smallest value
of 0.0000001e-49

Addition
 Many modern digital computers employ the binary (base-2) number system to represent
numbers, and carry out the arithmetic operations using binary arithmetic.
 In performing decimal arithmetic it is necessary to memorize the tables giving the results
of the elementary arithmetic operations for pairs of decimal digits.
 Similarly, for binary arithmetic the tables for the elementary operations for the binary
digits are necessary. The binary addition table is as follows:
0+0=0 0+1=1
1+0=1 1 + 1 = 0 (with carry 1)
Add the two numbers (1011101) and (100111)
1 0 1 1 1 0 1
+ 1 0 0 1 1 1
1 0 1 0 1 0 0

BCD addition
 Add two 4 bit BCD numbers using ordinary binary addition. If 4 bit sum is
equal to or less than the sum is a valid BCD number and no correction is
needed.

 If the 4 bit sum is greater than 9or if a carry is generated from the sum(step1)
the sum is invalid BCD number Then, the digit 6(0110)should be added to the
sum to produce the valid BCD symbols. Examples are given below.
1001+0100
9 1001
4 0100

13 1101 Sum> 9 with carry, Invalid BCD number (>9)

0110 Add 6

0001 0011 Valid BCD

6+3
6 0110 Sum equals 9 or less with carry 0
3 0011
9 1001 Valid BCD for 9
6+8

6 0110
8 1000
14 1110 Invalid BCD number (>9) 1110

0110 Add 6

0001 0100 BCD for 14

Subtraction with 1’s and 2’s complement


The binary subtraction table is as follows:
0–0=0
0 – 1 = 0 (with borrow 1)
1–0=1
1–1=0

Subtract (101101) from (100111)


1 0 1 1 0 1
1 0 0 1 1 1 (-)
0 0 0 1 1 0
Given the two binary numbers X=1010100 and Y=1000011, perform the subtraction.
(i) X-Y (ii) Y-X using 2’s complements.
Given
X = 1010100
Y = 1000011
(i) X – Y
2’s Complement
Y= 1000011
1’s Complement of Y = 0111100
If carry exist in 2’s complement method, it has to be discarded.
+ 1 Thus the solution is 0010001
2’s Complement of Y = 0111101 (ii) Y – X
X = 1010100 2’s Complement
2’s Complement of Y = 0111101
10010001
X= 1010100
1’s Complement of X = 0101011
+ 1
2’s Complement of X = 0101100
Y = 1000011
2’s Complement of X = 0101100
1101111
If there is no carry exist in 2’s complement method. Thus the solution is 2’s complement of
solution (0010000 + 1) = 0010001.

Summary of Addition and Subtraction rules for Binary numbers

Code
 Code is a symbolic representation of discrete information, which may be present in the
form of numbers, letters or physical quantities. The symbols used are the binary digits 0
and 1 which are arranged according to the rules of codes.
 These codes are used communicate information to a digital computer and to retrieve
message from it. A code is used to enable an operator to feed data into a computer
directly, in the form of decimal numbers, alphabets and special characters.
 The computer converts the data into binary codes and after computation, transforms the
data into its original format.
 When number, letters, or words are represented by a special group of symbols, this is
called encoding, and the group of symbols is called a code.
 Codes can be broadly classified as
 Weighted Binary Codes
 Non-Weighted codes
 Error-detecting Codes
 Error-Correcting Codes
 Alphanumeric Codes

Weighted Binary Codes:


 Weighted Binary Codes obey their positional weighting principles. Each position of a
number represents a specific weight in this code the bits are multiplied by the weights
indicated; the sum of the weighted bits gives the equivalent decimal number.

Binary Coded Decimal (BCD):


 The binary coded decimal (BCD) is a type of binary code used to represent a given
decimal number in an equivalent binary form. BCD-to-decimal and decimal-to-BCD
conversions are very easy and straightforward.
 It is also far less cumbersome an exercise to represent a given decimal number in an
equivalent BCD code than to represent it in the equivalent straight binary form.
 The BCD equivalent of a decimal number is written by replacing each decimal digit in the
integer and fractional parts with its four-bit binary equivalent. As an example, the BCD
equivalent of (23.15)10 is written as (0010 0011.0001 0101) BCD.
 The BCD code described above is more precisely known as the 8421 BCD code, with 8,
4, 2 and 1 representing the weights of different bits in the four-bit groups, starting from
MSB and proceeding towards LSB.
 This feature makes it a weighted code, which means that each bit in the four-bit group
representing a given decimal digit has an assigned its four-bit binary equivalent.
 Weight other weighted BCD codes include the 4221 BCD and 5421 BCD codes. Again,
4, 2, 2 and1 in the 4221 BCD code and 5, 4, 2 and 1 in the 5421 BCD code represent
weights of the relevant bits.

Non-Weighted Code
Excess-3 Code
 The excess-3 code is another important BCD code. It is particularly significant for
arithmetic operations as it overcomes the shortcomings encountered while using the 8421
BCD code to add two decimal digits whose sum exceeds 9.
 The excess-3 code has no such limitation, and it considerably simplifies arithmetic
operations. The excess-3 code for a given decimal number is determined by adding ‘3’ to
each decimal digit in the given number and then replacing each digit of the newly found
decimal number by its four-bit binary equivalent.
 It may be mentioned here that, if the addition of ‘3’ to a digit produces a carry, as is the
case with the digits 7, 8 and 9, that carry should not be taken forward.

 The result of addition should be taken as a single entity and subsequently replaced with
its excess-3 code equivalent.
 Also, it is normal practice to represent a given decimal digit or number using the
maximum number of digits that the digital system is capable of handling.
 Corresponding to a given excess-3 code, the equivalent decimal number can be
determined by first splitting the number into four-bit groups, starting from the radix point,
and then subtracting 0011 from each four-bit group.
 The new number is the 8421 BCD equivalent of the givenexcess-3 code, which can
subsequently be converted into the equivalent decimal number.
 Another significant feature that makes this code attractive for performing arithmetic
operations is that the complement of the excess-3 code of a given decimal number yields
the excess-3 code for 9’scomplement of the decimal number.
 As adding 9’s complement of a decimal number B to a decimal number A achieves A –
B, the excess-3 code can be used effectively for both addition and subtraction of decimal
numbers.
Binary Codes for Decimal Numbers
Gray Code
 The Gray code is an un-weighted binary code in which two successive values differ only
by 1 bit.
 Owing to this feature, the maximum error that can creep into a system using the binary
Gray code to encode data is much less than the worst-case error encountered in the case
of straight binary encoding.
 That is, the last and the first entry also differ by only1 bit. This is known as the cyclic
property of the Gray code.

 Although there can be more than one Gray code for a given word length, the term was
first applied to a specific binary code for non-negative integers and called the binary-
reflected Gray code or simply the Gray code.
 The gray code belongs to a class of codes called minimum change codes, in which only
one bit in the code group changes when moving from one step to the next.
 The gray code is a reflective digital code which has a special property of containing two
adjacent code numbers that differ by only one bit. Therefore it is also called as uni-
distance code, where the bit differs by 1 bit.
Gray Code–Binary Conversion:
 A given Gray code number can be converted into its binary equivalent by going through
the following steps:
 Begin with the most significant bit (MSB). The MSB of the binary number is the same as
the MSB of the Gray code number.
 The bit next to the MSB (the second MSB) in the binary number is obtained by adding the
MSB in the binary number to the second MSB in the Gray code number and disregarding
the carry, if any.
 The third MSB in the binary number is obtained by adding the second MSB in the binary
number to the third MSB in the Gray code number. Again, carry, if any, is to be ignored.
The process continues until we obtain the LSB of the binary number.
Convert (110111)G to binary code
Gray code = 1 1 0 1 1 1

1 0 0 1 0 1
(110111)G = (100101)2

Binary–Gray Code Conversion:


 A given binary number can be converted into its Gray code equivalent by going through
the following steps:
 Begin with the most significant bit (MSB) of the binary number. The MSB of the Gray
code equivalent is the same as the MSB of the given binary number.
 The second most significant bit, adjacent to the MSB, in the Gray code number is
obtained by adding the MSB and the second MSB of the binary number and ignoring the
carry, if any. That is, if the MSB and the bit adjacent to it are both ‘1’, then the
corresponding Gray code bit would be a‘0’.
 The third most significant bit, adjacent to the second MSB, in the Gray code number is
obtained by adding the second MSB and the third MSB in the binary number and
ignoring the carry, if any.
 The process continues until we obtain the LSB of the Gray code number by the addition
of the LSB and the next higher adjacent bit of the binary number.

Error Detection and Correction Codes


 The great practical significance in a digital computer or a digital communication set-up,
the issue is error detection and correction.
 Errors creep into the bit stream owing to noise or other impairments during the course of
its transmission from the transmitter to the receiver.
 Any such error, if not detected and subsequently corrected, can be disastrous, as digital
systems are sensitive to errors and tend to malfunction if the bit error rate is more than a
certain threshold level.
 Error detection and correction, involves the addition of extra bits, called check bits, to the
information-carrying bit stream to give the resulting bit sequence a unique characteristic
that helps in detection and localization of errors.
 These additional bits are also called redundant bits as they do not carry any information.
While the addition of redundant bits helps in achieving the goal of making transmission
of information from one place to another error free or reliable, it also makes it inefficient.
Even and Odd Parity Code
 A parity bit is an extra bit added to a string of data bits in order to detect any error that
might have crept into it while it was being stored or processed and moved from one place
to another in a digital system.
 We have an even parity, where the added bit is such that the total number of l’s in the data
bit string becomes even, and an odd parity, where the added bit makes the total number of
l’s in the data bit string odd.
 This added bit could be a ‘0’ or a ‘1’. As an example, if we have to add an even parity bit
to01000001 (the eight-bit ASCII code for ‘A’), it will be a ‘0’ and the number will
become 001000001.
 If we have to add an odd parity bit to the same number, it will be a ‘l’ and the number will
become101000001. The odd parity bit is a complement of the even parity bit.
 The most common convention is to use even parity, that is, the total number of 1s in the
bit stream, including the parity bit, is even.
 The parity check can be made at different points to look for any possible single-bit error,
as it would disturb the parity. This simple parity code suffers from two limitations.
Firstly, it cannot detect the error if the number of bits having undergone a change is even.

 Although the number of bits in error being equal to or greater than 4 is a very rare
occurrence, the addition of a single parity cannot be used to detect two-bit errors, which is
a distinct possibility in data storage media such as magnetic tapes.
 Secondly, the single-bit parity code cannot be used to localize or identify the error bit
even if one bit is in error. There are several codes that provide self-single-bit error
detection and correction mechanisms.
Checksum Codes
 Check-sums and cyclic redundancy checks are used to detect error in the
transmission of block of data.
 Check-sum is formed by adding all the data bytes in the block, ignoring any
carries. It is the arithmetic sum of all data bytes. The resulting sum is stored
after the data block.
 When the data is read, it is re -added and the sum is compared with the
recorded check-sum. There is no error in the data transmission if both the sum
matches; otherwise data has to be re-transmitted.

Hamming Codes
 If we have a sufficient number of redundant bits, and if these bits can be arranged such
that different error bits produce different error results, then it should be possible not only
to detect the error bit but also to identify its location.
 In fact, the addition of redundant bits alters the ‘distance’ code parameter, which has
come to be known as the Hamming distance. The Hamming distance is nothing but the
number of bit disagreements between two code words.
 For example, the addition of single-bit parity results in a code with a Hamming distance
of at least 2.
 The smallest Hamming distance in the case of a threefold repetition code would be 3.
Hamming noticed that an increase in distance enhanced the code’s ability to detect and
correct errors.
 Hamming’s code was therefore an attempt at increasing the Hamming distance and at the
same time having as high an information throughput rate as possible.

The message bit to be transmitted is 0110. Find the Hamming code for the given message.
B3B2B1B0 = 0110
h1 = B 3 B 2 B 0 = 0 1 0 = 1
h2 = B 3 B 1 B 0 = 0 1 0 = 1
h4 = B 2 B 1 B 0 = 1 1 0 = 0
h3 = B 3 = 0
h5 = B 2 = 1
h6 = B 1 = 1
h7 = B 0 = 0
The hamming code h1h2h3h4h5h6h7 = 1 1 0 0 1 1 0

A 7-bit Hamming code is received as 0101101 what is its correct code.


h1 h2 h3 h4 h5 h6 h7
0 1 0 1 1 0 1
Now, to find the error.
C1 = h1 h3 h5 h7 = 0 0 1 1=0
C2 = h2 h3 h6 h7 = 1 0 0 1=0
C4 = h4 h5 h6 h7 = 1 1 0 1=1
Thus, C4 C2 C1 = 1 0 0.
Therefore, bit 4 is in error and the corrected code word can be obtained by complementing
the fourth bit in the received code word as 0100101.

m – out of - n codes
 m-out-of-n code words with m number of 1‘s in it and remaining all 0‘s. It
is useful to detect unidirectional multiple errors.
 In a unidirectional error, all of the erroneous bits change in the same direction
(0s change to 1s, 1s change to 0s).
 The total number of valid code words in m-out-of-n code can be given by the
binomial co-efficientwhich has the value

 Thus a 2-out-of-4 code has 6 valid code words, and 3-out-of-6 code has
20 valid code words.

OtherCodes.
Alphanumeric Codes:
 Alphanumeric codes, also called character codes, are binary codes used to represent
alphanumeric data.
 The codes write alphanumeric data, including letters of the alphabet, numbers,
mathematical symbols and punctuation marks, in a form that is understandable and
process-able by a computer.
 These codes enable us to interface input–output devices such as keyboards, printers,
VDUs, etc., with the computer.
 One of the better-known alphanumeric codes in the early days of evolution of computers,
when punched cards used to be the medium of inputting and outputting data, is the 12-bit
Hollerith code.
 The Hollerith code was used in those days to encode alphanumeric data on punched
cards. The code has, however, been rendered obsolete, with the punched card medium
having completely vanished from the scene.
 Two widely used alphanumeric codes include the ASCII and the EBCDIC codes. While
the former is popular with microcomputers and is used on nearly all personal computers
and workstations, the latter is mainly used with larger systems.
 Traditional character encodings such as ASCII, EBCDIC and their variants have a
limitation interms of the number of characters they can encode.
 In fact, no single encoding contains enough characters so as to cover all the languages of
the European Union.
 As a result, these encodings do not permit multilingual computer processing. Unicode,
developed jointly by the Unicode Consortium and the International Standards
Organization (ISO), is the most complete character encoding scheme that allows text of
all forms and languages to be encoded for use by computers. Different codes are
described in the following.

ASCII code:
 The ASCII (American Standard Code for Information Interchange) is strictly a seven-bit
code based on the English alphabet.
 ASCII codes are used to represent alphanumeric data in computers, communications
equipment and other related devices.

 Since it is a seven-bit code, it can at the most represent 128 characters. It currently defines
95 printable characters including 26 upper-case letters (A to Z),26 lower-case letters (a to
z), 10 numerals (0 to 9) and 33 special characters including mathematical symbols,
punctuation marks and space character.
 In addition, it defines codes for 33 non printing, mostly obsolete control characters that
affect how text is processed.
 With the exception of ‘carriage return’ and/or ‘line feed’, all other characters have been
rendered obsolete by modern mark-up languages and communication protocols, the shift
from text-based devices to graphical devices and the elimination of tele-printers, punch
cards and paper tapes.
 An eight-bit version of the ASCII code, known as US ASCII-8or ASCII-8, has also been
developed.
 The eight-bit version can represent a maximum of 256 characters. That is, numerals 0 to 9
are represented by binary sequences from 0011 0000 to 0011 1001 respectively.
 Also, lower-case and upper-case letters differ in bit pattern by a single bit. While upper-
case letters ‘A’ to ‘O’ are represented by 01000001 to 0100 1111, lower-case letters ‘a’ to
‘o’ are represented by 0110 0001 to 0110 1111.
 Similarly, while upper-case letters ‘P’ to ‘Z’ are represented by 0101 0000 to 0101 1010,
lower-case letters ‘p’to ‘z’ are represented by 0111 0000 to 0111 1010.

 With widespread use of computer technology, many variants of the ASCII code have
evolved over the years to facilitate the expression of non-English languages that use a
Roman-based alphabet.
 In some of these variants, all ASCII printable characters are identical to their seven-bit
ASCII code representations.
EBCDIC code:
 The EBCDIC (Extended Binary Coded Decimal Interchange Code), is another widely used
alphanumeric code, mainly popular with larger systems. The code was created by IBM to
extend the binary coded decimal that existed at that time.
 All IBM mainframe computer peripherals and operating systems use EBCDIC code, and
their operating systems provide ASCII and Unicode modes to allow translation between
different encodings. It may be mentioned here that EBCDIC offers no technical advantage
over the ASCII code.

 Its importance in the earlier days lay in the fact that it made it relatively easier to enter data
into larger machines with punch cards.
 Since, punch cards are not used on mainframes anymore; the code is used in contemporary
mainframe machines solely for backwards compatibility.
 It is an eight-bit code and thus can accommodate up to 256 characters. A single byte in
EBCDIC is divided into two four-bit groups called nibbles.
 The first four-bit group, called the ‘zone’, represents the category of the character, while
the second group, called the ‘digit’, identifies the specific character.

You might also like