Page 12 - DCAP104_EXPOSURE_TO_COMPUTER_DISCPLINES
P. 12
Unit 1: Data Information
1.2.2 Alphanumeric Representation Notes
But what about alphabets and special characters like +, - etc.? How do we represent these in
computer? A set containing alphabets (in both cases), the decimal digits (1 0 in number) and
special characters (roughly 10-15 in numbers) consist of at least 70-80 elements. One such Code
generated for this set and is popularly used is ASCII (American National Standard Code for
Information Interchange). This code uses 7 bits to represent 128 characters. Now an extended ASCII
is used having 8-bit character representation code on Microcomputers. Similarly binary codes
can be formulated for any set of discrete elements e.g., colours, the spectrum, the musical notes,
chessboard positions etc. In addition these binary codes are also used to formulate instructions,
which are advanced form of data representation.
The binary numeral system, or base-2 number system, represents numeric
values using two symbols, 0 and 1. More specifically, the usual base-2 system
is a positional notation with a radix of 2.
1.2.3 Computational Data Representation
Till now we have discussed about various number systems and BCD and alphanumeric
representation but how do these codes actually use to represent data for scientific calculations?
The computer is a discrete digital device and store information in flip-flops, which are two state
devices, in binary form. Basic requirements of the computational data representation in binary
form are:
• Representation of sign;
• Representation of Magnitude;
• If the number is fractional then binary or decimal point, and exponent.
The solution to sign representation is easy, because sign can be either positive or negative,
therefore, one bit can be used to represent sign. By default it should be the left most bit. Thus, a
number of n bits can be represented as n + l bit number, where n + l bit is the sign bit and rest
th
n bits represent its magnitude.
A (n + 1) bit number: The decimal position can be represented by a position between the flip-flops
(storage cells in computer). But, how can one determine this decimal position? Well to simplify
the representation aspect two methods were suggested: (i) Fixed point representation where the
decimal position is I assumed either at the beginning or at the end of a number; and (ii) Floating
point representation where a second register is used to keep the value of exponent that determines
the position of the binary or decimal point in the number.
But before discussing these two representations let us first discuss the term “complement” of a
number. These complements may be used to represent negative numbers in digital computers.
Complement: There are two types of complements for a number of base r, these are called r’s
complement and (r - 1)’s complement. For example, for decimal numbers the base is 10, therefore,
complements will be 10’s complement and (10 - 1) = 9’s complements. For binary numbers we
talk about 2’s and 1’s complements.
LOVELY PROFESSIONAL UNIVERSITY 5