Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 238
Implementation And Analysis of Different Veda Ganitha Sutras And Its Comparison
with Conventional Methods
Preethu C1, Chaitra Shenoy M 2, Daya Naik
3
1 M.Tech VLSI Design and Embedded Systems, Srinivas Institute of Technology, Mangalore,574143 Karnataka, India 2 M.Tech Power Electronics Systems and Control, Manipal Institute of Technology, Manipal,576104 Karnataka, India
3 Associate Prof, Dept of Electronics & Communication, Srinivas Institute of Technology, Mangalore,574143 Karnataka, India [email protected] , [email protected] , [email protected]
Abstract. Veda Ganitha is an ancient technique, which simplifies multiplication, divisibility, operation on complex numbers, squaring, cubing,
and square and cube roots. Veda ganitha is unique technique of calculations based on sixteen sutras and thirteen sub sutras .The ever increasing demand for high speed, smaller, lighter & portable electronics directly translates to low power requirements. The designers are working on to reduce the delay, size and power consumed by the processor. To increase the speed of any processor, the speed of ALU has to be increased. The speed of the ALU depends on multipliers and adders. With the help of Veda ganitha, we can reduce the delay area and power requirement of an ALU. In this paper we propose to implement Urdhva tiryagbhyam, Nikhilam navatascharamam dasatah, Anurupyena, Dwanda yoga, Anurupye, Dwajanka Veda ganitha sutras and analyze its performance by comparing with the conventional mathematics methods. By employing these Veda ganitha sutras in the
computation algorithms of the ALU, the Delay, area, power etc can be reduced.
Keywords: Veda Ganitha, Urdhva tiryagbhyam, Nikhilam, Anurupyena, Dwandayoga, Dwajanka
1 Introduction
Veda Ganitha The Sanskrit word Veda is derived from the root Vid, meaning to know without limit. The word Veda covers all Veda-sakhas
known to humanity.[3] Vedas are mainly sub divided into four. Rig-Veda, Yajur Veda, Samaveda & Atharvaveda. Veda Ganitha or
Vedic Mathematics is originated from Atharva Veda. Vedic Mathematics forms a part of Jyothisastra (Astronomy) which is one of the
six parts of Vedangas. It is an ancient technique, which simplifies multiplication, divisibility, operation on complex numbers,
squaring, cubing, and square and cube roots. Even, recurring decimal and auxiliary fractions can be handled by Vedic Mathematics.[3] Vedic mathematics was reintroduced to the world by Swami Bharathi Krishna ThirthaJi Maharaj(1884-1960), Former Jagadguru
Sankaracharya of Govardhan Peeth,Puri. Thirthaji collected the lost formulae‘s from the writings of Stapathya Veda, an Upaveda of
Atharvaveda and wrote them in the form of sixteen sutras (aphorisms) and thirteen sub- sutras (corollaries). Any mathematical
problems like arithmetic, algebra, trigonometry or geometry can be solved mentally using Veda Ganitha sutras. [1]
The Sutras covers almost every branch of Mathematics. Application of these Sutras saves a lot of time and effort in solving the
problems, compared to the present methods. The application of the Sutras is perfectly logical and rational. The Vedic Mathematics is
not simply a collection of rapid methods; it is a system, a unified approach through which any mathematical problems can be easily
solved mentally using Veda Ganitha sutras.
1.1 Veda Ganitha Sutras
Vedic sutras The word ‗Vedic‘ is derived from the word ‗veda‘ which means the treasure-house of all knowledge. Veda Ganitha is mainly
based on sixteen sutras (aphorisms) and thirteen sub- sutras (corollaries). These sutras deals with various branches of mathematics like
Arithmetic, Geometry, Algebra, Trigonometry etc. These Sutras, along with their brief meanings and sub sutras are enlisted below
alphabetically. [1]
1) (Ānurūpye) Śūnyamanyat - If one is in ratio, the other is zero.
Sub-sutra: Yāvadūnam Tāvadūnam-Whatever the extent of its deficiency, lessen it still further to that very extent.
2) Chalanā kalanābhyām – Differences and Similarities. Sub-sutra: Antyayoreva-Only the last terms
3) Ekādhikena Pūrvena – By one more than the previous one
Sub-sutra: Ānurūpyena-Proportionately.
4) Ekanyūnena Pūrvena – By one less than the previous one
5) Gunitasamuchayah– The factors of the sum is equal to the sum of the factors.
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 239
6) Gunakasamuchayah – The product of the sum is equal to the sum of the product. 7) Nikhilam Navataścharamam Daśatah – All from 9 and the last from 10.
Sub-sutra: Sisyate sesamjnah-Remainder remains constant
8) Parāvartya Yojayet– Transpose and adjust.
Sub-sutra: Kevalaih Saptakam Gunỹat-In case of seven our multiplicand should be 1 4 3
9) Puranāpuranābhyām – By the completion or noncompletion.
Sub-sutra: Antyayor dasake’ pi-Whose last digits together total 10 and whose previous part is exactly the same.
10) Sankalana- vyavakalanābhyām – By addition and by subtraction. Sub-sutra: Yāvadūnam Tāvadūnīkrtya Vargaňca Yojayet-Whatever the extents of its deficiency lessen it still further to that
very extent; and also set up the square of that deficiency.
11) Śesānyankena Charamena – The remainders by the last digit Sub-sutra:Vilokanam-By observation 12) Sūnyam Samuchchaye – When the sum is the same that sum is zero.
Sub-sutra:Vestanam -Osculation
13) Sopaantya dvayamantyam – The ultimate and twice the penultimate.
Sub-sutra:Gunitha samuchchayah samuchchayah gunitah-The product of sum of the coefficients in the factors is equal to the
sum of the coefficients in the product.
14) Ūrdhva - tiryagbhyām -vertically and crosswise.
Sub-sutra: Ādyamādyenantyamantyena-First by first and last by last.
15) Vyashtisamanstih – Part and Whole(use the average)
Sub-sutra: Lopanasthāpanabhyām-By alternate elimination and retention
16) Yāvadūnam -Whatever the extent of its deficiency.
Sub-sutra: samuchchayah gunitah [1]
2 Proposed Techniques
2.1 Urdhva-tiryagbhyam sutra Urdhva – tiryagbhyam is the sutra which is applicable to all cases of multiplication which means ―vertically and crosswise‖. To
illustrate this multiplication method, let us consider the multiplication of two decimal numbers (123x132). The conventional methods
already known to us require 9 multiplications and 5 additions. An alternative way of multiplication using Urdhva tiryagbhyam sutra is
shown in Fig. 1.
Fig. 1. Method of Urdhva tiryagbhyam
Step-1: 3 X 3 = 9. First digit = 9 Step-2: (2 X 3) + (3 X 2) = 6 + 6 = 12. The digit 2 is retained and 1 is carried over to left side. Second digit = 2.
Step-3: (1 X 3) + (1 X 3) + (2 X 2) = 3 + 3 + 4=10. The carried over 1 of above step is added i.e., 10 + 1 = 11. Now 1 is retained
and 1 is carried over to left 29 sides. Thus third digit = 1.
Step-4: (1X 2 ) + ( 1X 2 ) = 2 + 2 = 4. The carried over 1 of above step is added .i.e., 4 + 1 = 5. It is retained. Thus fourth digit = 5
Step-5: ( 1 X 1 ) = 1. As there is no carried over number from the previous step it is retained. Thus fifth digit = 1
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 240
123 X 123 = 15129
Fig 2. Urdhva 8x8 Vedic Multiplier
Urdhva 8x8 bit Vedic multiplier is structured using 4X4 bit Urdhva blocks as shown in Fig. 2.
2.2 Nikhilam navatascharamam dasatah sutra
The sutra simply means : ―all from 9 and the last from 10‖The sutra can be applied to all cases of multiplication but it is very
effectively applied in multiplication of numbers, which are nearer to bases like 10, 100, 1000i.e., to the powers of 10 . The procedure
of multiplication using the Nikhilam involves minimum number of steps, space, time saving and only mental calculation. The numbers taken can be either less or more than the base considered. To illustrate this multiplication method, let us consider the
multiplication of two decimal numbers(95x96) where the chosen base is 100 which is nearest to and greater than both these two
numbers. Nikhilam sutra is shown in Fig.3. As shown in Fig.3, we write the multiplier and the multiplicand in two rows. For 95, the
deviation can be obtained by ‗all from 9 and the last from 10‘ sutra i.e., the last digit 5 is from 10 and remaining digit 9 from 9 gives
05. For 96, the last digit 7 is from 10 and remaining digit 9 from 9 gives 04. We can write two columns of numbers, one (Column 1)
consisting of the numbers to be multiplied and the other (Column 2) consisting of their compliments.
Fig 3. Method of Nikhilam sutra
The product also consists of two parts which are separated by a vertical line for the purpose of illustration. The RHS (right hand side) of the product can be obtained by simply multiplying the numbers of the Column 2 i.e., (5×4 = 20). The LHS (left hand side) of
the product can be found by cross subtracting the second number of Column 2 from the first number of Column 1 or vice versa, i.e.,
95 - 4 = 91 or 96 - 5 = 91. The final result is obtained by concatenating RHS and LHS (Answer = 9120).
2.3 Anurupyena sutra
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 241
The upa-Sutra 'Anurupyena' means 'proportionality'. This Sutra is highly useful to find products of two numbers when both of them are near the Common bases i.e. powers of base 10. It is very clear that in such cases the expected 'Simplicity ' in doing problems
is absent.
Example: 43 X 47
As per the previous methods, if we select 100 as base we get
43 -57
47 -53
‾‾‾‾‾‾‾‾
This is much more difficult and of no use.
Now by ‗Anurupyena‘ we consider a working base in three ways. We can solve the problem.
Example: 43 X 47.
With 100 / 2 = 50 as working base, the problem is as follows: 43 -07
47 -03
‾‾‾‾‾‾‾‾‾
2) 40 / 21
‾‾‾‾‾‾‾‾‾
20 / 21
43 x 47 = 2021
2.4 Square Algorithm
Square Algorithm using Dwanda yoga (Duplex-D) property of Urdhva tiryagbhyam sutra. To find the square of any number
which is near the base 10,100 etc., Yavadunam Sutra is used. The Sutra is used for Squaring, is limited to number which ends with
digit 5 only is ―Ekadhikena Purvena sutra‖. The other method ―Dwandwa Yoga‖ or Duplex-D is used in two different senses. The
first one is by squaring and the second one is by cross multiplication.[5]
Fig. 4. 8bit Vedic Square Algorithm
To calculate the square of a number, we have used ―Duplex-D‖ property of Urdhva Tiryagbhyam. To find the Duplex, we take
twice the product of the outermost pair and then add twice the product of the next outermost pair and so on till no pairs are left. When
there are odd numbers of bits in the original sequence, there is one bit left by itself in the middle and this enters as its square.
Thus for 7654321,
D= 2 * ( 7 * 1) + 2 * ( 6* 2 ) + 2 * ( 5 * 3 ) + 4* 4 = 84. Further, the Duplex can be explained as follows
Thus D (1) = 1 * 1;
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 242
D (11) =2 * 1 * 1; D (101) =2 * 1 * 1+0 * 0;
D (1011) =2 * 1 * 1+2 * 1 * 0;
For a 1 bit number D is its square.
For a 2 bit number D is twice their product.
For a 3 bit number D is twice the product of the outer pair + square of the middle bit.
For a 4 bit number D is twice the product of the outer pair + twice the product of the inner pair.
Fig. 4. Shows the 8-bit Vedic square algorithm. In this algorithm Urdhva tiryagbhyam 4x4 Vedic multiplier is used to implement
the algorithm. The Vedic square has all the advantages as it is quite faster and smaller than the Booth array and Urdhva Vedic
multiplier.
2.5 Square root (Dwandayoga)
Dwanda yoga, duplex-d property of Urdhva Tiryagbhyam sutra is used to find the square root of a perfect square .To find the
square root, first Pair the numbers from right to left. For example, to find square root of 5184, Pair the numbers from right to left 5184
two pairs. we get two pairs. Therefore the answer is two digit numbers. Then find the nearest square of the left most pair and find the
square root of that number. 72 = 49 and 82 = 64. 49 is less than 51.Therefore first digit of square root is 7. The last digit which is 4.As
22 = 4 and 82 = 64 both end with 4.Therefore the answer could be 72 or 78.As we know 752 = 5625 greater than 5184.Therefore square
root of 5184 is below 75.Therefore the square root of 5184 =72
2.6 Cube Algorithm (Anurupye)
The cube of the number is based on the Anurupyena Sutra of Vedic Mathematics which states ―If you start with the cube of the first
digit and take the next three numbers (in the top row) in a Geometrical Proportion (in the ratio of the original digits themselves) then
you will find that the 4th figure (on the right end) is just the cube of the second digit‖.
Fig.5. Vedic Cube Algorithm
In this 8-bit Anurupye Vedic cube algorithm 4x4 Vedic cube block and 4x4 bit Vedic square blocks are used to implement the
algorithm. In final stage carry save adders are used to obtain the result.
2.7 Vedic division(Dwajanka)
For Vedic division, we are using Dwajanka sutra. The Sanskrit word dwajam means flag pole. For example Divide 234 by 54.The
division, 54 is written with 4 raised up, on the flag, and a vertical line is drawn one figure from the right hand end to separate the
answer, 4, from the remainder 28.
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 243
Fig.6 Division using Dwajanka sutra
Step 1: 5 into 20 goes 4 remained 3 as shown in Fig. 6 Step 2: Answer 4 multiplied by the flagged 4 gives 16 and this 16 taken from 34 leaves the remainder 28 as shown in Fig. 6.
3 Result And Analysis
In this work, Verilog HDL has been used to code the algorithms. Logic synthesis and simulation are done in Xilinx 12.2 and ModelSim SE 6.3f Simulator. Synthesis results are compared to conventional method .The results are displayed in tables 1, 2 & 3. The comparison of these tables shows the difference in combinational delays and device utilization. Thus, proposed method outperforms conventional method in terms of delay area and low power.
Fig. 7. simulation result for signed multiplier (32x32) using Urdhva tiryagbhyam
Fig. 8. Simulation result for 3-bit multiplier using Nikhilam & Anurupyena
Fig. 8. Simulation result for 8-bit squaring using dwanda yoga
Fig. 9. Simulation result for 8-bit cubing using Anurupye
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 244
Fig. 10. Simulation result for 8-bit square rooting using Anurupye
Fig. 11. Simulation result for 4/2 division using Dwajanka
Table 2 Comparison between Urdhva tiryagbhyam and conventional method
Device Utilization
Bit NO. of slices NO. of 4input
LUTs
NO. of bonded
IOBs
Delay
(ns)
Urdhva tiryagbhyam (Vedic
method) 32x32 signed bit
1344
2399
126
54.597ns
Booths multiplier
(Conventional
method)
32x32 bit
2141
4002
128
163.515
ns
Urdhva tiryagbhyam
(Vedic method)
64x64 unsigned bit
5177
9217
256
56.903ns
Booths multiplier (Conventional method) 64x64 bit
8682
16193
256
323.695
ns
The result obtained from proposed Urdhva tiryagbhyam Vedic sutra are faster than conventional booth multiplier
Table 2. Synthesize result for Nikhilam and Anurupyena sutras
Device Utilization
Bit NO. of slices NO. of 4input
LUTs
NO. of bonded
IOBs
Delay
(ns)
Nikhilam &
Anurupyena
(2-bit)
2
4 8
9.073ns
Nikhilam & 23 40 12
ISBN: 97-8-93-81195-82-6 PROCEEDINGS OF NJCIET 2015
Canara Engineering College Mangalore NJCIET 2015 245
Anurupyena
(3-bit)
22.359 ns
Table 3. Synthesize result for Vedic square, square root and cube.
Device Utilization
Bit 8 NO. of slices NO. of 4input LUTs
NO. of bonded IOBs
Delay
(ns)
Square architecture
using Dwandayoga
Sutra
28
50
24
24.093 ns
Square root using
Dwandayoga Sutra
2
4
8
9.073ns
cube architecture using
Anurupye Sutra
141
254
32
46.433 ns
4 Conclusions
The tabulated results demonstrate that the proposed Veda Ganitha sutras for multiplication reduce the delay and area and
outperform the conventional methods of multiplication. The number of adder and multiplier are reduced; hence it also reduces the
power requirements.
References
1. Swami Bharati Krsna Tirtha, Vedic Mathematics. Delhi: Motilal Banarsidass Publishers, 1965 2. AK Janardhnan Nair,Vedaganitham,(Malayalam), kottayam:Avanti Publications, 2002 3. Vijay Prakash, Essence of Vedic Mathematics .Bangalore: Vasan Publications, 2008
4. Anvesh kumar, Ashish raman, ―Low Power ALU Design by Ancient Mathematics‖, 978-1-4244-5586-7/10, 2010 IEEE
5. Vaijyanath kunchigi, Linganagouda Kulkarni and Subhash Kulkarni,―Low Power Square and Cube Architectures using vedic
sutras‖ 2014 fifth
International Conference on Signal and Image processing.