2 Numeration Systems
2 Numeration Systems
In early days, human begins counted on fingers. When ten fingers were not adequate,
stones, pebbles, or sticks were used to indicate values. This method of counting uses an
additive approach or the non-positional number system. In this system, we have symbols
such as I for 1, II for 2, III for 3, IIII for 4, IIIII for 5, 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 a number system, positional systems were developed.
The base of a number system or radix defines the range of values that a digit may have.
In the binary system or base 2, there can be only two values for each digit of a number,
5
either a "0" or a "1". In the octal system or base 8, there can be eight choices for each
digit of a number:
"0", "1", "2", "3", "4", "5", "6", "7".
In the decimal system or base 10, there are ten different values for each digit of a number:
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9".
In the hexadecimal system, 16 numerals are used:
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", and "F".
Where “A” stands for 10, “B” for 11 and so on.
6
In general, conversion between numbers with different radices (bases) cannot be done by
simple substitutions. Such conversions would involve arithmetic operations.
Conversion from other bases to radix 10
Let us work out procedures for converting a number in any radix to radix 10, and vice-
versa. The decimal equivalent value of a number in any radix is given by the formula
where r is the radix of the number and there are p digits to the left of the radix point and n
digits to the right. Decimal value of the number is determined by converting each digit of
the number to its radix-10 equivalent and expanding.
The easiest way to convert fixed point numbers to any base is to convert each part
separately. We begin by separating the number into its integer and fractional part. The
integer part is converted using the remainder method, by using a successive division of
the number by the base until a zero is obtained. At each division, the reminder is kept and
then the new number in the base r is obtained by reading the remainder from the lat
remainder upwards.
Solution:
7
Example 2. Convert the decimal number 41 into a binary number.
Here are a few examples of signed binary numbers and their corresponding sign-
magnitude representations:
In the 1960's and 1970's, each computer manufacturer developed its own floating point
system, leading to a lot of inconsistency as to how the same program behaved on
different machines. Through the efforts of many computer scientists, a binary system was
developed in the early eighties. This standard has become known as the IEEE floating
point standard. There are two main representation schemes: 32-bit single-precision and
64-bit double-precision. There is a third IEEE standard - IEEE Quad precision. The
IEEE Quad precision floating point standard representation requires a 128 bit word,
which may be represented as numbered from 0 to 127, left to right. The first bit is the
sign bit, S, the next fifteen bits are the exponent bits, 'E', and the final 128 bits are the
fraction 'F':
10
2.7.1. IEEE 32-bit single-precision numbers
In 32-bit single-precision floating-point representation:
The most significant bit is the sign bit (S), with 0 for positive numbers and 1 for
negative numbers.
The following 8 bits represent exponent (E).
The remaining 23 bits represents fraction (F).
With an 8-bit E, ranging from 0 to 255, the excess-127 scheme could provide actual
exponent of -127 to 128. In this example, E-127=129-127=210.
Hence, the number represented is -1.375×2^2=-5.510.
For example, the decimal number 46 can be expressed in IEEE single precision floating
point number as follows:
(46)10= 1011102 = 1.01110e+5
The fraction or mantissa F= 01011100 0000000 00000000
The exponent E= 00000 101.
11
The biased exponent = 00000101 + 01111111 = 10000100.
The number is positive, therefore the sign bit is = 0:
Thus, the number is given as:
01000010001011100 0000000 00000000
That is,
De-Normalized Form
Normalized form has a serious problem, with an implicit leading 1 for the fraction, it
cannot represent the number zero! De-normalized form was devised to represent zero and
other numbers.
For E=0, the numbers are in the de-normalized form. An implicit leading 0 (instead of 1)
is used for the fraction; and the actual exponent is always -126. Hence, the number zero
can be represented with E=0and F=0 (because 0.0×2-126=0).
n = j, then x = 2j
From this we can conclude that if we are given (x) elements of information to code into
binary coded format, the number of bits (n) needed can be found as follows:
2n>x
or n > log2x
> 3.32 log10x
13
Since bits are not defined as fractional parts, we take n = 6. In other words a minimum
six-bit code would be required to code 36 alphanumeric elements of information. In this
section we consider a few commonly used codes.
14
commands are used in digital systems. Codes that include alphabetic characters are
commonly referred to as Alphanumeric Codes. However, we require adequate number of
bits to encode all the characters.
ASCII code
The American Standard Code for Information Interchange (ASCII) code is the most
widely used alphanumeric code. ASCII codes are used to represent alphanumeric data in
computers, communications equipment and other related devices. The code was first
published as a standard in 1967. It is seven—bit code that represents 128 (2 7 ) characters
assigned to numbers, letters, punctuation marks, and the most special characters. It was
proposed by the American National Standards Institute (ANSI). Table.2.3 shows the full
list of ASCII code which includes all characters and special symbols represented by this
coding system.
The Extended Binary Coded Decimal Interchange Code (EBCDIC) also known as
Extended ASCII Character Set consists of 128 additional characters, that is, 256
characters in total. The range from 128 through 255 represents additional special,
mathematical, graphic, and foreign characters. EBCDIC was developed by IBM.
15
Unicode
As briefly mentioned in the earlier sections, encodings such as ASCII, EBCDIC and their
variants do not have a sufficient number of characters to be able to encode alphanumeric
data of all forms, scripts and languages. As a result, these encodings do not permit
multilingual computer processing. In addition, these encodings suffer from
incompatibility. Two different encodings may use the same number for two different
characters or different numbers for the same characters. Unicode, developed jointly by
the Unicode Consortium and the International Organization for Standardization (ISO), is
the most complete character encoding scheme that allows text of all forms and languages
to be encoded for use by computers. The recent version of Unicode uses 32-bit encoding.
This gives 4,294,967,296 ( about 4.3 billion) possible characters.
16
2.8.5. Error Detection and Correction Codes
When data is transmitted in digital form from one place to another through a transmission
channel/medium, some data bits may be lost or modified. This loss of data integrity
occurs due to a variety of electrical phenomena in the transmission channel.
Ideally, we have to have a mechanism of correcting the errors that occur. If this is not
possible or proves to be expensive, we would be the need to know if an error occurred. If
an occurrence of error is known, appropriate action, like retransmitting the data, can be
taken. One of the methods of improving data integrity is to encode the data in a suitable
manner. This encoding may be done for error correction or merely for error detection.
17
designation of a code word may be determined by actual number of 1's in the data
(including the added parity bit) to which the parity bit is added.
For example, the S in ASCII code is
(S) = (1010011)ASCII S, when coded for odd parity, would be shown as
(S) = (11010011)ASCII with odd parity
In this encoded 'S' the number of 1's is five, which is odd. When S is encoded for even
parity
(S) = (01010011)ASCII with even parity.
In this case the coded word has even number (four) of ones. Thus the parity encoding
scheme is a simple one and requires only one extra bit. If the system is using even parity
and we find odd number of ones in the received data word we know that an error has
occurred. However, this scheme is meaningful only for single errors. If two bits in a data
word were received incorrectly the parity bit scheme will not detect the faults.
Repetition Code
The repetition code makes use of repetitive transmission of each data bit in the bit stream.
In the case of threefold repetition, ‘1’ and ‘0’ would be transmitted as ‘111’ and ‘000’
respectively. If, in the received data bit stream, bits are examined in groups of three bits,
the occurrence of an error can be detected. In the case of single-bit errors, ‘1’ would be
received as 011 or 101 or 110 instead of 111, and a ‘0’ would be received as 100 or 010
or 001 instead of 000. In both cases, the code becomes self-correcting if the bit in the
majority is taken as the correct bit.
18