THE INVERTED-TRIANGLE TECHNIQUE OF CONVERTING THE COMPUTER NUMBER SYSTEMS (BINARY, OCTAL AND HEXADECIMAL) TO DECIMAL

Number system is the method of writing numerals to represent values. It is an integral part of computer science. It is therefore, necessary to provide computer scientists with a good understanding of number system concepts. Several methods exist in converting from one number system to another. In this paper, we introduce a new method, called the Inverted-Triangular-Technique for converting other number systems to Decimal. It adopts a graphical presentation that assumes the shape of an inverted triangle. Two models have been presented: one to handle Integer number conversions and the other handles the non-integer conversions. Demonstrations of the models are presented for clarity of understanding. This technique has been tested with numerous examples, and the benefits arising from its uses have been discussed.


INTRODUCTION
The storage of information in a computer memory corresponds to a number of two-state memory elements, each capable of storing one bit (binary digit).However, the data that a computer manipulates is not restricted simply to binary numbers.A computer may process any data which is capable of being converted to binary codes (Shawn 2002.).
Consequently, the study of Computer Science includes the study of how information is organized and stored in the memory of a computer; how data is manipulated to provide information as well as how it can be utilized.Thus, it is very important for Computer Scientists to understand the concept of number systems.The most widely used method for interpreting bit settings as non negative integers is the binary number system.In this system each bit position represents a power of 2. The right most bit position represents 2 0 , which equals 1, the next position to the left represents 2 1 , which equals 2; the next bit position represent 2 2 , which equals 4 and so on.An integer is represented as a sum of powers of 2 (John, 2007.)Number system is the method of writing numerals to represent values.It is a framework where a set of numbers are represented by numerals in a consistent manner (Wikipedia 2007.)One interesting fact remains that we see the number system as a concept that allows the numeral "10" to be interpreted as the decimal numeral for ten (10), binary numeral for two (2), octal numeral for eight (8), hexadecimal numeral for sixteen (16), and so on for other numerals in different bases.We can list as many number bases as one thousand (1000).However, in this paper, we have restricted our discussions to the common ones that are usually encountered in the computing field: Binary, Octal, Hexadecimal and Denary.
The binary number system is a positional numeral system that has two (2) as its base.It requires only two digits of 0 and 1.According to Encyclopedia Britannica (2007), the importance of the Binary system to information theory and computing technology derives mainly from the compact and reliable manner in which 0s and 1s can be represented electronically.The Binary numbers form the native language of computers and it is used internally by modern computers and its associated equipment due to its straight forward implementation in electronic circuitry.
Counting in Binary is similar to other number systems.It proceeds through each symbol in increasing order beginning with a single digit.Using the symbols 0 and 1, the next higher digit to the left is incremented.When the symbols for the first digit are exhausted, the counting starts over again at 0 at this point.Thus, after a digit reaches 1 in binary, an increment resets it to 0, but also causes an increment to the next digit to the left (Erik 1999.)The Octal, Decimal, and Hexadecimal are popular in computing because they can be translated to and from the binary system.Octal is a radix of 8, which is a power of 2 3 (Mabutt, 2006.)This means that it takes exactly three binary digits to represent an octal digit.The Hexadecimal (Hex) number system is base -16 system of numeration.Hex uses a radix of 16, which is a power of 2 4 .To translate a string of binary digits into Hex, we group the binary digits into four at a time from right to left (Maxfield, and Brown 2006.)The Decimal number system is the most commonly used system of numerals by humans.It is based on ten digits.These ten digits can be combined to form larger numbers.It became more popular than the others because of its adaptability to early computing tools such as fingers and toes (Shawn 2002.)

STATEMENT OF PROBLEM
The digit-times-place-value conventional method of number systems conversion has been popular over the years.However, we observed that it usually takes a long time to verify the accuracy or otherwise of the eventual result obtained through its application.This is because a lot of care has to be taken to ensure that exponentiation values are correctly computed.More so, you may require doing a reversal of the process before you can be sure of your result.
Furthermore, the conventional method does not specifically present a formula, which can be used to make the teaching and learning of number systems easier.Rather, it offers rules that can be followed, in the process of translation.These rules may not be easily assimilated.This paper therefore, is aimed at introducing a method which will provide a scientific formula that can be followed in number systems conversion.It is our assertion that pictures speak better than words.Consequently, we seek to devise a graphical presentation that will make the assimilation and verification of computations faster and easier.

METHODOLOGY
We introduce two models for the conversion of number systems from one base to another.The models are designed to handle integer number conversion, and non-integer number conversion.

THE INVERTED-TRIANGULAR TECHNIQUE FOR CONVERTING INTEGER NUMERAL IN ANY BASE TO BASE-10
The model formulated for doing this is presented below: where o X P is the number to be converted; o p represents the base.o k 1 , k 2 , k 3, … , k n represents the digits positions or place values in the number to be converted.o k n is the right most digit of the number.From the model (equation 1), the underlying principle is built on the idea that: i) The left most digit in the given number to be converted is multiplied by the given base and the product is added to the next digit to the right in the innermost parenthesis; and again the sum is further multiplied by the given base.At this point the innermost parenthesis disappears.ii) The result obtained in (i) above is added to the next digit and the sum is multiplied by the.This process continues until the final digit has been reached, at which time the resultant will provide the base-10 equivalent of the original number, see DEMO 1, DEMO 2 and DEMO 3 for integer conversion.
It should be noted that the number of parenthesis present is dependent on the number of digits in the given number base to be converted.Each inner parenthesis disappears as each step is solved.As the conversion process progresses, solving from the leftmost digit to the right most digit the triangle tapers downward until a single equivalent value in base-10 is obtained.This is illustrated in fig. 1

THE INVERTED-TRIANGULAR MODEL FOR CONVERTING NON-INTEGER NUMBERS IN ANY BASE TO BASE-10
The Inverted-Triangular model for converting a noninteger number in any base to base -10 is as shown in equation 2.

APPLICATIONS / DEMONSTRATIONS
This section presents the applications / demonstrations of the Inverted -Triangular Technique for converting both integer and non-integer computer number systems (binary, octal and hexadecimal) to their base-10 equivalents.The demonstration features the Inverted-Triangular Technique vis-à-vis the conventional digit-times-place-values method.

DISCUSSION
From the demonstrations presented in section 4.1 and 4.2 in contrast, the new Inverted-Triangular Technique: (1) Is the faster and easier method of converting any number in any base to its base-10 equivalent compared to the conventional digit-times-place-value method.This is because it has models (formulae) for converting both integer and noninteger numbers from any base to base-10 while the conventional digit-times-place-value method does not.(See equations 1and 2).These models show the mathematical/scientific rule, steps and processes which are involved when doing the conversion, thereby making the process of conversion with the new method easier and faster.Also it deals with only two (2) mathematical operators (Multiplication (*), addition (+)).It does not also involved exponentiation or raise to power.The conventional digit-times-place-value method on the other hand deals with three (3) mathematical operators (multiplication (*), exponentiation or raise to power (^) and addition (+)).(See Fig. 3 The exponentiation in the conventional digittimes-place-value method expands the mathematical processes involved in it, thereby making it uneasy and time consuming when doing conversion with it.It produces large values, which may be difficult to handle. (2) Saves spaces when working both manually and on computer because it does not involve exponentiation or raise to power.On the computer, this memory space trade-off optimizes the memory speed, thereby making the models to execute rapidly and efficiently.On the other hand, the conventional digit-timesplace-value method does not optimize space because it deals with exponentiation. (3) Provides a highly beautiful structural/graphical presentation with its step-by-step solution that looks like an inverted triangle, which the name is coined from, than the conventional digit-timesplace-value method.(4) Looks more scientific in presentation with its step-by-step solution.

CONCLUSION
Conversions of number systems from other number bases to Decimal have always been carried out by scholars using different methods.The method presented in this paper introduces a new approach into the existing methods.When compared with other methods of number systems conversion, the Inverted-Triangular Technique presents a beautiful structure that is highly scientific, and can be easily adopted by numerical scientists.
Department of Computer Science, Cross River University of Technology, Calabar, Nigeria.N. Obidinnu, Department of Computer Science, Cross River University of Technology, Calabar, Nigeria.

Fig. 1 :
Fig. 1: Graphical model solution process of the Inverted-Triangular Technique for the Integer Number System Conversion.
, Fig.4, and Fig.5 in DEMO 1, for an integer binary number conversion; Fig. 6, Fig.7, Fig.8 in DEMO 2, for an integer octal number conversion; Fig.9 and Fig.10 in DEMO 3, for an integer hexadecimal number; conversion; Fig.11 and Fig.12 in DEMO 4, for a non-integer binary number conversion; Fig.13 and Fig.14 in DEMO 5, for a non-integer octal number conversion; Fig.15 and Fig.16 in DEMO 6 for a non-integer hexadecimal number conversion). .
Working from the rightmost digit to the leftmost digit; the rightmost digit is divided by the given base and the dividend is added to the next digit (k n-1 ) to left.ii)Next the sum obtained in (i) is multiplied by the reciprocal of the given base being converted.At this stage, the innermost parenthesis disappears from right to left.It should be observed that, as the conversion progresses step-wisely, each inner parenthesis disappears at the completion of each step.This leads to the tapering of the inverted -triangle to a tip.The tip of inverted triangle gives the base-10 non integer equivalent of the given non-integer base.
Triangular Technique simplest form solution at a glance (single line solution) for octal integer number