realistic approach of strange number system from unary to [email protected], 2....
TRANSCRIPT
Realistic Approach of Strange Number System from Unary to Decimal Debasis Das1 and U. A. Lanjewar2
1Assistant Professor, MCA, VMV Commerce, JMT Arts & JJP Science College, Nagpur, India 2 Professor, MCA, VMV Commerce, JMT Arts & JJP Science College, Nagpur, India
[email protected], [email protected]
Abstract
Numbers play an important role in Mathematics, also
in Computer Science. A number is a symbol or group of
symbols, or a word in a natural language that
represents a numeral, which is different from numbers
just as words differ from the things they refer to. A set
of numbers in a framework that are represented by
numerals in a consistent manner is called number
system. In computing the study of number systems is
useful to all, as a fact that various number systems are
used in computer fields. Some are familiar number
system (decimal (base 10), binary (base-2), octal (base-
8) and hexadecimal (base-16)) and others are strange
number system (SNS). Strange number system is
investigated for efficiently describing and implementing
in digital systems. In computing the study of strange
number system (SNS) will useful to all researchers.
Their awareness and detailed explanation is necessary
for understanding various digital aspects. In this paper
we have elaborate the concepts of strange number
system (SNS), needs, number representation, arithmetic
operations and inter conversion with different bases,
represented in tabulated form. This paper will also
helpful for knowledge seekers to easy understanding
and practicing of number systems as well as to
memories them.
Keywords- Strange Number System, trinary,
quaternary, quinary, senary, septenary and nonary
1. Introduction A number is a count or measurement that is really an
idea in our minds. A digit is a single symbol used to
make numbers. The concept of number is the most
basic and fundamental in the world of science and
mathematics. The first digit in any numbering system is
always a zero. For example, a base 2 (binary) number
contains 2 digits: 0 and 1, a base 3 (ternary) numbers
contains 3 digits: 0, 1 and 2, a base 4 (quaternary)
number contains 4 digits: 0 through 3 and so fourth.
Remember, a base 10 (decimal) number does not
contain the digit 10, similarly base 16 number does not
contain a digit 16.
A number system is a writing system for
expressing numbers that is a mathematical notation for
representing number of a given set, using graphemes or
symbols or words in a consistent manner. The number
sense is not the ability to count, but the ability to
recognize that something has changes in a small
collection. Data is usually combination of Numbers,
Characters and special characters.
The unary system is normally only useful for small
numbers, although it plays an important role in
theoretical computer science. Many ancient cultures
from early on calculated with numerals based on ten:
Egyptian hieroglyphs, in evidence since around 3000
BC, used a purely decimal system. Then the binary
system (base 2), was propagated in the 17th century by
Gottfried Leibniz. The first ternary machine was built
by Thomas Fowler in 1840. In 1958, a much more
complicated machine was built, called “Setun” in
Russia by Nikolai P. Brousentsov and his colleagues at
Moscow State University (Brousentsov et al, 1997). In
1973, Gideon Frieder and his colleagues at the State
University of New York designed a Base-3 machine
they called TERNAC, and went ahead to create a
software emulator for it, (Hayes, 2001) [1].
Although many students know the traditional number
system such as decimal, binary, octal and hexadecimal
and are very comfortable with performing operations
using this system, it is important for students to
understand that these four common number systems are
not the only system. By studying other number systems
such as trinary (base-3), quaternary (base-4), quinary
(base-5), senary (base-6), septenary (base-7) and
nonary (base-9), students will gain a better
understanding of how number systems work in general.
When discussing how a computer stores information,
the binary number system becomes very important
since this is the system that computers use. It is
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
235
ISSN:2229-6093
important that students understand that computers store
and transmit data using electrical pulses, and these
pulses can take two forms - "on" (1) or "off" (0).
This paper will stimulate the reader’s interest to the
strange number system beyond traditional number
system. In this particular paper, we are taking under the
consideration a tabulated format for few strange
number systems. It covers each system’s number
representation, their uses, their arithmetic and inter-
conversion of numbers from one system to another.
2. Need of the Strange Number System (SNS) In digital world when we deal with computer and
information technology, normally we require a working
knowledge of traditional number system, i.e. binary,
octal, decimal and hexadecimal. Apart from these basic
number systems, the strange number system also plays
a significant role in computing. The strange number
system poses some extra features which distinguish
them from the other existing number systems and make
them worth an extra look, some of these features
include:
Greater speed of arithmetic operations realization
Greater density of memorized information
Better usage of transmission paths
Decreasing of interconnections complexity and
interconnections area
Decreasing of pin number of integrated circuits
and printed boards
3. Types of Number System The number systems are basically categorized in two
types, non-positional number system and positional
number system.
3.1 Non-Positional Number System
In early days, human beings counted with 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. The unary number system is under this
category.
3.2 Positional Number System
The general idea behind positional numbering systems
is that a numeric value is represented through
increasing powers of a radix (or base). This is often
referred to as a weighted numbering system because
each position is weighted by a power of the radix.
In a 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 of the number system.
The binary, ternary, quaternary, quinary, senary,
septenary, octal, nonary and decimal number systems
are the example of positional number systems.
4. Number Representation of Strange
Number System In general in a number system with a base or radix n,
the digits used are from 0 to n-1 and the number can be
represented as:
x = anbn + an - 1b
n - 1 + ... + a1b
1 + a0b
0, where
x = Number, b=Base, a= any digit in that base
Any real number x can be represented in a positional
number system of base "b" by the expression
x = anbn + an - 1b
n - 1 + ... + a0b
0 + a-1b
-1 + ... + a-(n-1)b
-(n-1)
+ a-nb-n
.
For example number 128 can be represented in various
number systems as follows:
Table 1 Number Representation of Strange Number System
Number
System
Bas
e Symbol Number Representation
Unary 1 | ----- -----
Ternary 3 0,1,2 (201.02)3
2×32 + 0×31 + 1×30 +
0×3-1 + 2×3-2
Quaternary 4 0,1,..,3 (302.03)4
3×42 + 0×41 + 2×40 +
0×4-1 + 3×4-2
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
236
ISSN:2229-6093
Quinary 5 0,1,..,4 (403.04)5 4×52 + 0×51 + 3×50 +
0×5-1 + 4×5-2
Senary 6 0,1,..,5 (504.05)6
5×62 + 0×61 + 4×60 +
0×6-1 + 5×6-2
Septenary 7 0,1,..,6 (605.06)7 6×72 + 0×71 + 5×70 +
0×7-1 + 6×7-2
Nonary 9 0,1,..,8 (807.08)9 8×92 + 0×91 + 7×90 +
0×9-1 + 8×9-2
5. Overview of Strange Number System Number systems provide the basics for all operations in
information processing systems. In this section strange
number systems and their applications in the area of
different fields have been discussed.
5.1 Unary Number System
The unary number system is the bijective base-1
numeral system. Compared to standard positional
numeral systems, the unary system is inconvenient and
is not used in practice for large calculations. It is the
simplest numeral system to represent natural numbers:
in order to represent a number N, an arbitrarily chosen
symbol representing 1 is repeated N times. For
example, using the symbol | (a tally mark), the number
6 is represented as ||||||. There is no explicit symbol
representing zero in unary as there is in other traditional
bases, so unary is a bijective numeration system with a
single digit.
Addition and subtraction are particularly simple in the
unary system, as they involve little more than string
concatenation. However, multiplication and division
are more cumbersome.
The standard method of counting on one's fingers is
effectively in a unary system. Unary is most useful in
counting or tallying ongoing results, such as score’s in
a game of sport, since no intermediate result is in a
need to be erased or discarded. The unary system was
used in ancient mathematics such as, the Moscow
Mathematical Papyrus, dating from circa 1800 BC.
The example of a unary counting system was clustered
in the Chinese, Japanese and Korean number system. In
Brazil but also France, a variation of this system is
commonly used.
5.2 Ternary Number System
The number system with base three is known as the
ternary number system. Only three symbols are used to
represent numbers in this system and these are 0, 1 and
2. It is also a positional number system that each bit
position corresponds to a power of 3. Moreover, it has
two parts the Integral part or integers and the fractional
part or fractions, set a part by radix point. For example
(1202.021)3
In ternary number system the leftmost bit is known as
most significant bit (MSB) and the right most bit is
known as least significant bit (LSB). The following
expression shows the position and the power of the
base 3:
…...333
23
13
0.3
-13
-23
-3…..
As for rational numbers, ternary number system offers
a convenient way to represent one third; but a major
drawback is that, ternary number system does not offer
a finite representation for the most basic fraction: one
half (and thus, neither for one quarter, one sixth, one
eighth, one tenth, etc.), because 2 is not a prime factor
of the base .
Perhaps the most important and immediate use of
ternary technology is in the new and emerging field of
Quantum Computing, a technology which has been
described as “a promising and flourishing research
area‟ (Khan, 2004). Ternary logic also serves as a
stepping stone on the way to Multi-Valued-Logic
(MVL) which is currently being probed for its
application in artificial intelligence.
5.3 Quaternary Number System
The number system with base four is known as the
quaternary number system. Only four symbols are used
to represent numbers in this system and these are 0, 1, 2
and 3. It is also a positional number system that each
bit position corresponds to a power of 4. Moreover, it
has two parts the Integral part or integers and the
fractional part or fractions, set a part by radix point. For
example (202.321)4
In quaternary number system the leftmost bit is known
as most significant bit (MSB) and the right most bit is
known as least significant bit (LSB). The following
expression shows the position and the power of the
base 4 [2]:
…...434
24
14
0.4
-14
-24
-3…..
A carry-free arithmetic operation can be performed on
quaternary numbers. The implementation of quaternary
addition and multiplication results in a fix delay
independent of the number of digits. Operations on a
large number of digits such as 64, 128, or more, can be
implemented with constant delay and less complexity.
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
237
ISSN:2229-6093
Quaternary numbers are used in the representation of
2D Hilbert curves, while many of the Chumashan
languages originally used a base 4 counting system, in
which the names were structured according to multiples
of 4 and 16. Quaternary line codes have been used for
transmission, from the invention of the telegraph to the
2B1Q code used in modern ISDN circuits.
5.4 Quinary Number System
The number system with base five is known as the
quinary number system. Only five symbols are used to
represent numbers in this system and these are 0, 1, 2, 3
and 4. It is also a positional number system that each
bit position corresponds to a power of 5. As five is a
prime number, only the reciprocals of the powers of
five terminate, so its location between two composite
numbers (4 and 6) does not help make its radix
economy better.
Moreover, it has two parts the Integral part or integers
and the fractional part or fractions, set a part by radix
point. For example (503.341)5
In quinary number system the leftmost bit is known as
most significant bit (MSB) and the right most bit is
known as least significant bit (LSB). The following
expression shows the position and the power of the
base 5:
…...535
25
15
0.5
-15
-25
-3…..
The main usage of base 5 is as a biquinary system,
which is decimal using five as a sub-base. Many
languages use quinary number systems, including
Gumatj, Nunggubuyu, Kuurn Kopan Noot and
Saraveca. Roman numerals are a biquinary system.
5.5 Senary Number System
The number system with base six is known as the
senary number system. In this system six symbols are
used to represent numbers and these are 0, 1, 2, 3, 4 and
5. It is also a positional number system that each bit
position corresponds to a power of 6. Moreover, it has
two parts the Integral part or integers and the fractional
part or fractions, set a part by radix point. For example
(423.523)6
In senary number system the leftmost bit is known as
most significant bit (MSB) and the right most bit is
known as least significant bit (LSB). The following
expression shows the position and the power of the
base 6 [2]:
…...636
26
16
0.6
-16
-26
-3…..
The arithmetic operations like addition, subtraction,
multiplication and division operations of decimal
numbers can be also performed on senary numbers.
Senary may be considered useful in the study of prime
numbers since all primes, when expressed in base-six,
other than 2 and 3 have 1 or 5 as the final digit.
5.6 Septenary Number System
The number system with base seven is known as the
septenary number system. In this system seven symbols
are used to represent numbers and these are 0, 1, 2, 3, 4,
5 and 6. It is also a positional number system that each
bit position corresponds to a power of 7. Hence, any
septenary number can not have any digit greater than 6.
Moreover, it has two parts the Integral part or integers
and the fractional part or fractions, set a part by radix
point. For example (463.513)7
In septenary number system the leftmost bit is known
as most significant bit (MSB) and the right most bit is
known as least significant bit (LSB). The following
expression shows the position and the power of the
base 7:
…...737
27
17
0.7
-17
-27
-3…..
The arithmetic operations like addition, subtraction,
multiplication and division operations of decimal
numbers can be also performed on senary numbers.
5.7 Nonary Number System
The number system with base nine is known as the
nonary number system. In this system nine symbols are
used to represent numbers and these are 0, 1, 2, 3, 4, 5,
6, 7 and 8 but not the digit 9. Nonary notation can be
used as a concise representation of ternary data. It is
also a positional number system that each bit position
corresponds to a power of 9.
Moreover, it has two parts, the Integral part or integers
and the fractional part or fractions, set a part by radix
point. For example (983.673)9
In nonary number system the leftmost bit is known as
most significant bit (MSB) and the right most bit is
known as least significant bit (LSB). The following
expression shows the position and the power of the
base 9:
…...939
29
19
0.9
-19
-29
-3…..
Except for three, no primes in nonary end in 0, 3 or 6,
since any nonary number ending in 0, 3 or 6 is divisible
by three. A nonary number is divisible by two, four or
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
238
ISSN:2229-6093
eight, if the sum of its digits is also divisible by two,
four or eight respectively.
6. Operations and Conversion of Strange
Number System Decimal arithmetic is the oldest and most common
branch of mathematics, used by almost everyone, from
simple day-to-day counting to advanced science and
business calculations. Arithmetic is at the heart of the
digital computer, and the majority of arithmetic
performed by computers is binary arithmetic, that is,
arithmetic on base two numbers. The arithmetic
operations such as addition, subtraction, multiplication
and division on strange numbers also play a significant
role in computing. Table II shows some basic
arithmetic operations performed on strange numbers.
Addition is the basic operation of arithmetic. In its
simplest form, addition combines two numbers into a
single number called the sum of the numbers. The
procedure to adding more than two numbers is called
summation.
Subtraction is one of the four basic binary arithmetic
operations. It is the inverse of addition. Subtraction
finds the difference between two numbers, the minuend
minus the subtrahend. If the minuend is larger than the
subtrahend, the difference is positive; if the minuend is
smaller than the subtrahend, the difference is negative;
if they are equal, the difference is zero.
Multiplication is the one of the basic operation of
arithmetic. Multiplication also combines two numbers
into a single number called the product. The two
original numbers are called the multiplier and the
multiplicand.
Division is essentially the opposite of multiplication.
Division finds the quotient of two numbers when the
dividend divided by the divisor. Any dividend divided
by zero is undefined. For positive numbers, if the
dividend is larger than the divisor, the quotient is
greater than one; otherwise it is less than one.
Table 2 Arithmetic Operations of Strange Number System
2.1 Addition and Subtraction
Arithmetic
Number
System
Addition Subtraction
Ternary
Quaternary
Quinary
(11)3 + (02)3 = (20)3
(36)4 + (06)4 = (120)4
(42)5 + (16)5 = (113)5
(11)3 - (02)3 = (02)3
(36)4 - (06)4 = (30)4
(42)5 - (16)5 = (21)5
Senary
Septenary
Nonary
(52)6 + (24)6 = (120)6
(26)7 + (13)7 = (42)7
(38)9 + (05)9 = (44)9
(52)6 - (24)6 = (24)6
(26)7 - (13)7 = (13)7
(38)9 - (05)9 = (33)9
2.2 Multiplication and Division
Arithmetic
Number
System
Multiplication Division
Ternary
Quaternary
Quinary
Senary
Septenary
Nonary
(11)3 * (02)3 = (22)3
(36)4 * (06)4 = (1230)4
(42)5 * (16)5 = (1432)5
(52)6 * (24)6 = (2212)6
(26)7 * (13)7 = (404)7
(38)9 * (05)9 = (214)9
(11)3 / (02)3 = (02)3
(36)4 / (06)4 = (03)4
(42)5 / (16)5 = (02)5
(52)6 / (24)6 = (02)6
(26)7 / (13)7 = (02)7
(38)9 / (05)9 = (07`)9
This section describes the conversion of numbers from
one number system to another. Radix Divide and
Multiply Method is generally used for conversion.
There is a general procedure for the operation of
converting a decimal number to a number in base r. If
the number includes a radix point, it is necessary to
separate the number into an integer part and a fraction
part, since each part must be converted differently. The
conversion of a decimal integer to a number in base r is
done by dividing the number and all successive
quotients by r and accumulating the remainders. The
conversion of a decimal fraction is done by repeated
multiplication by r and the integers are accumulated
instead of remainders.
When converting numbers from one base to another,
there is five different types of conversions that the
students will need to remember:
Any Base to Decimal and vice versa
Any Base to Binary and vice versa
Mixed Conversions (e.g. base 3 to base 5)
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
239
ISSN:2229-6093
When performing these conversions, it becomes
important for all to indicate the base that the
number is written in, as it will become very easy to
confuse how the number is being represented.
Table III shows the inter-conversions between
various numbers.
Table 3 Base Inter Conversion of Strange Number
system
Base Inter Conversion
Step-1
Part-A Decimal to any base [binary, … , nonary]
Integer: repeated division by base (method)
Fraction: repeated multiplication by base (method)
Part-B Any base [binary, … , nonary] to decimal
Integer: sum of [(+ve weights)×(integer)]
Fraction: sum of [(-ve weights) ×(fraction)]
Step-2
Part-A Binary to any base [quaternary, octal...]
To quaternary: replace group of 2-binary bits by
quaternary digit
To octal: replace group of 3-binary bits by octal
digit
Part-B Any base [quaternary, octal...] to binary
From quaternary: replace each quaternary digit
by 2-bit binary
From octal: replace each octal digit by 3-bit binary
Step-3
(--)3,4,5,6,7,9, ... to (--)3,4,5,6,7,9, ...
Direct conversion not applicable
First (--)3,4,5,6,7,9,...to (--)10 Then (--)10 to (--)3,4,5,6,7,9, ...
7. Conclusion
Here we have elaborated the concepts of strange
number system (SNS) and proposed an easy, short
and simple approach to fulfill the needs, number
representation, arithmetic operations and inter
conversion with different bases, represented in
tabulated form used in the digital world specially
computer science and technology. As we have seen
that, not only traditional numbers are used in digital
world, but there are some strange numbers, which
are also very common and frequently used in most
of the digital technologies and devices. Due to the
benefits of strange number representation, which
include greater speed of arithmetic operations
realization, greater density of memorized
information, better usage of transmission paths and
decreasing of pin number of integrated circuits, this
paper concludes that strange number system even
though they are not yet more commercially
available, remain a viable field for research, and
have a promising future as a replacement for
traditional number system. This study will be very
helpful for researchers and knowledge seekers to
easy understanding and practicing of number
systems as well as to memories them for those who
are in the field of computer science and technology.
Acknowledgement
Handful of thanks to Dr. U A Lanjewar, Professor
VMV Commerce, JMT Arts & JJP Science
College, Wardhaman Nagar, Nagpur for his
guidance, support and valuable instructions.
References
1. Afolayan A. Obiniyi, Ezugwu E. Absalom,
Kwanashie Adako, “Arithmetic Logic Design
with Color-Coded Ternary for Ternary
Computing”, IJCA Volume 26– No.11, July
2011 .
2. Shahid Latif, Junaid Qayyum, Muhammad Lal,
Faheem Khan, “Novel Approach to the
Learning of Various Number Systems”,
International Journal of Computer
Applications (0975 – 8887), Volume 26– No.7,
July 2011
3. V. Dimitrov, G.A. Jullien, W.C. Miller, 1997,
“Theory and Applications for a Double- Base
Number System,” Proc. 13th IEEE Symp. on
Comp. Arithmetic, pp. 44-53.
4. BARRY B, BREY The Intel Microprocessors,
Sixth edition, prentice hall of India private
limited, New Delhi – 110 001, 2002
5. Ion Profeanu, 2010, “Ternary Arithmetic and
Logic”, Proc. WCE 2010, London, U.K.,
ISBN: 978-988-17012-9-9.
6. Ramesh S. Gaonkar Microprocessor
Architecture, Programming, and Applications
with the 8085/8080A Published by H.S. Poplai
for Wiley Eastern Limited, New Delhi ISBN: 0
85226 297 3.
7. Albert Paul Malvino, Jernald A. Brown Digital
Computer Electronics third edition,
GLENCOE Macmillan/ McGraw- Hill
8. Amarnath Murthy “On the divisors of the
unary sequence”, Smarandache Notions
Journal Vol. - 11, 2000.
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
240
ISSN:2229-6093
9. Davenport, Harold, The Higher Arithmetic:An
Introduction to the Theory of Numbers (7th
ed.), Cambridge University Press, Cambridge,
UK,1999, ISBN 0-521-63446-6.
10. Number Representation and Computer
Arithmetic, Article to appear in Encyclopedia
of Information Systems, Academic Press,
2001.
11. Histoire universelle des chiffres, Georges
Ifrah, Robert Laffont, 1994 (Also:The
Universal History of Numbers: From
prehistory to the invention of the computer,
Georges Ifrah, ISBN 0471393401, John Wiley
and Sons Inc., New York, 2000. Translated
from the French by David Bellos, E.F.
Harding, Sophie Wood and Ian Monk)
12. RICHARD, R. K. Arithmetic Operation in
Digital Computers, New York; Van Nost land
Co., 1955.
Debasis Das et al,Int.J.Computer Techology & Applications,Vol 3 (1), 235-241
IJCTA | JAN-FEB 2012 Available [email protected]
241
ISSN:2229-6093