4
A Digital Multiplier Architecture using Urdhva Tiryakbhyam Sutra of Vedic Mathematics Harpreet Singh Dhillon and Abhijit Mitra Department of Electronics and Communication Engineering, Indian Institute of Technology, Guwahati 781 039, India. E-mail: [email protected]; [email protected] Abstract—Vedic mathematics is the name given to the ancient Indian system of mathematics that was rediscovered in early twentieth century. Vedic mathematics is mainly based on sixteen principles or word-formulae which are termed as Sutras. We discuss a possible application of Vedic mathematics to digital signal processing in the light of application of Vedic multiplication algorithm to digital multipliers. A simple digital multiplier (referred henceforth as Vedic multiplier) architecture based on the Urdhva Tiryakbhyam (Vertically and Cross wise) Sutra is presented. This Sutra was traditionally used in ancient India for the multiplication of two decimal numbers in relatively less time. In this paper, after a gentle introduction of this Sutra, it is applied to the binary number system to make it useful in the digital hardware. The hardware architecture of the Vedic multiplier is presented and is shown to be very similar to that of the popular array multiplier. It is also equally likely that many such similar technical applications might come up from the storehouse of knowledge, Veda, if investigated properly. Index Terms—Vedic mathematics, Urdhva Tiryakbhyam, bi- nary multiplication, hardware design, array multiplier. I. I NTRODUCTION V EDIC mathematics [1] is the ancient Indian system of mathematics which mainly deals with Vedic mathemat- ical formulae and their application to various branches of mathematics. The word ‘Vedic’ is derived from the word ‘Veda’ which means the store-house of all knowledge. Vedic mathematics was reconstructed from the ancient Indian scrip- tures (Vedas) by Sri Bharati Krsna Tirtha (1884-1960) after his eight years of research on Vedas [1]. According to his research, Vedic mathematics is mainly based on sixteen principles or word-formulae which are termed as Sutras. The beauty of Vedic mathematics lies in the fact that it reduces otherwise cumbersome looking calculations in conventional mathematics to a very simple ones [2]. This is so because the Vedic formulae are claimed to be based on the natural principles on which the human mind works. This is a very interesting field and presents some effective algorithms which can be applied to various branches of engineering such as computing and digital signal processing. This paper discusses a possible application of Vedic mathematics to digital signal processing in the light of application of Vedic multiplication algorithm to digital multipliers [3]. Digital multipliers are indispensable in the hardware imple- mentation of many important functions such as fast Fourier transforms (FFTs) and multiply accumulate (MAC). This has made them the core components of all the digital signal pro- cessors (DSPs). Two most common multiplication algorithms followed in the math coprocessor are array multiplication algorithm and booth multiplication algorithm [4]. The array multipliers take less computation time because the partial products are calculated independently in parallel. The delay associated with the array multiplier is the time taken by the signals to propagate through the gates that form the multiplication array. Booth multiplication is another important multiplication algorithm [5]. Large Booth arrays having large partial sum and partial carry registers are required for high speed multiplica- tion and exponential operations. Multiplication of two n bit operands using a radix-4 Booth recording multiplier requires approximately n/(2m) clock cycles to generate the least significant half of the final product, where m is the number of Booth recoder adder stages. Thus, a large propagation delay is associated with this case. This paper presents a simple digital multiplier architecture [3] based on the ancient Vedic mathematics Sutra (formula) called Urdhva Tiryakbhyam (Vertically and Cross wise) Sutra which was traditionally used for decimal system in ancient India. In [6], this Sutra is shown to be a much more efficient multiplication algorithm as compared to the conventional counterparts. Another paper [7] has also shown the effective- ness of this sutra to reduce the N ×N multiplier structure into efficient 4 × 4 multiplier structures. However, they have mentioned that this 4 ×4 muliplier section can be implemented using any efficient multiplication algorithm. We apply this Sutra to binary systems to make it useful in such cases. In particular, we develop an efficient 4 × 4 digital multiplier that calculates the partial products in parallel and hence the computation time involved is less. The architecture of the designed Vedic multiplier comes out to be very similar to that of the popular array multiplier and hence it should be noted that Vedic mathematics provides much simpler derivation of array multiplier than the conventional mathematics. This paper is organized as follows. In Section 2, a brief overview of the Vedic mathematics is provided and the Vedic multiplication algorithm is discussed in detail. Section 3 provides the hardware architecture of the proposed Vedic multiplier. The paper is concluded in Section 4 by summer- izing the importance of the Vedic mathematics in the field of engineering.

A Digital Multiplier Architecture Using Vedic Mathematics

Embed Size (px)

DESCRIPTION

A Digital Multiplier Architecture using UrdhvaTiryakbhyam Sutra of Vedic MathematicsHarpreet Singh Dhillon and Abhijit MitraDepartment of Electronics and Communication Engineering,

Citation preview

Page 1: A Digital Multiplier Architecture Using Vedic Mathematics

A Digital Multiplier Architecture using UrdhvaTiryakbhyam Sutra of Vedic Mathematics

Harpreet Singh Dhillon and Abhijit MitraDepartment of Electronics and Communication Engineering,

Indian Institute of Technology, Guwahati 781 039, India.E-mail: [email protected]; [email protected]

Abstract— Vedic mathematics is the name given to the ancientIndian system of mathematics that was rediscovered in earlytwentieth century. Vedic mathematics is mainly based on sixteenprinciples or word-formulae which are termed as Sutras. Wediscuss a possible application of Vedic mathematics to digitalsignal processing in the light of application of Vedic multiplicationalgorithm to digital multipliers. A simple digital multiplier(referred henceforth as Vedic multiplier) architecture based onthe Urdhva Tiryakbhyam (Vertically and Cross wise) Sutra ispresented. This Sutra was traditionally used in ancient Indiafor the multiplication of two decimal numbers in relatively lesstime. In this paper, after a gentle introduction of this Sutra, itis applied to the binary number system to make it useful inthe digital hardware. The hardware architecture of the Vedicmultiplier is presented and is shown to be very similar to thatof the popular array multiplier. It is also equally likely thatmany such similar technical applications might come up fromthe storehouse of knowledge, Veda, if investigated properly.

Index Terms— Vedic mathematics, Urdhva Tiryakbhyam, bi-nary multiplication, hardware design, array multiplier.

I. INTRODUCTION

VEDIC mathematics [1] is the ancient Indian system ofmathematics which mainly deals with Vedic mathemat-

ical formulae and their application to various branches ofmathematics. The word ‘Vedic’ is derived from the word‘Veda’ which means the store-house of all knowledge. Vedicmathematics was reconstructed from the ancient Indian scrip-tures (Vedas) by Sri Bharati Krsna Tirtha (1884-1960) after hiseight years of research on Vedas [1]. According to his research,Vedic mathematics is mainly based on sixteen principles orword-formulae which are termed as Sutras. The beauty ofVedic mathematics lies in the fact that it reduces otherwisecumbersome looking calculations in conventional mathematicsto a very simple ones [2]. This is so because the Vedicformulae are claimed to be based on the natural principleson which the human mind works. This is a very interestingfield and presents some effective algorithms which can beapplied to various branches of engineering such as computingand digital signal processing. This paper discusses a possibleapplication of Vedic mathematics to digital signal processingin the light of application of Vedic multiplication algorithm todigital multipliers [3].

Digital multipliers are indispensable in the hardware imple-mentation of many important functions such as fast Fouriertransforms (FFTs) and multiply accumulate (MAC). This has

made them the core components of all the digital signal pro-cessors (DSPs). Two most common multiplication algorithmsfollowed in the math coprocessor are array multiplicationalgorithm and booth multiplication algorithm [4]. The arraymultipliers take less computation time because the partialproducts are calculated independently in parallel. The delayassociated with the array multiplier is the time taken bythe signals to propagate through the gates that form themultiplication array.

Booth multiplication is another important multiplicationalgorithm [5]. Large Booth arrays having large partial sum andpartial carry registers are required for high speed multiplica-tion and exponential operations. Multiplication of two n bitoperands using a radix-4 Booth recording multiplier requiresapproximately n/(2m) clock cycles to generate the leastsignificant half of the final product, where m is the number ofBooth recoder adder stages. Thus, a large propagation delayis associated with this case.

This paper presents a simple digital multiplier architecture[3] based on the ancient Vedic mathematics Sutra (formula)called Urdhva Tiryakbhyam (Vertically and Cross wise) Sutrawhich was traditionally used for decimal system in ancientIndia. In [6], this Sutra is shown to be a much more efficientmultiplication algorithm as compared to the conventionalcounterparts. Another paper [7] has also shown the effective-ness of this sutra to reduce the N×N multiplier structureinto efficient 4 × 4 multiplier structures. However, they havementioned that this 4×4 muliplier section can be implementedusing any efficient multiplication algorithm. We apply thisSutra to binary systems to make it useful in such cases. Inparticular, we develop an efficient 4 × 4 digital multiplierthat calculates the partial products in parallel and hence thecomputation time involved is less. The architecture of thedesigned Vedic multiplier comes out to be very similar to thatof the popular array multiplier and hence it should be notedthat Vedic mathematics provides much simpler derivation ofarray multiplier than the conventional mathematics.

This paper is organized as follows. In Section 2, a briefoverview of the Vedic mathematics is provided and the Vedicmultiplication algorithm is discussed in detail. Section 3provides the hardware architecture of the proposed Vedicmultiplier. The paper is concluded in Section 4 by summer-izing the importance of the Vedic mathematics in the field ofengineering.

Page 2: A Digital Multiplier Architecture Using Vedic Mathematics

3 2 5

7 3 8

Result = 4 0Prev. Carry = 0

04

Carry = 4

3 2 5

7 3 8

3 2 5

7 3 8

STEP 3

Prev. Carry = 3Result = 6 5

86

8 5 0

Carry = 6

3 2 5

7 3 8

3 2 5

7 3 8

0

STEP 1 STEP 2

Result = 3 1Prev. Carry = 4

Carry = 3

5 0

53

Result = 2 3Prev. Carry = 6

2 9

Carry = 2

9 8 5 0

STEP 4

Result = 2 1Prev. Carry = 2

2 3 9 8 5 0

2 3

STEP 5

325 X 738 = 239850

Fig. 1. Multiplication of two decimal numbers by Urdhva Tiryakbhyam Sutra.

5 4 9 81

0

0

08

0 0

3

1

215

1

1

25

22

8

01

4

7

6

6

90

4

63

8

2

0

21 2 7 2 2 3 7

0122210

2

3

1

4

PreviousCarry

5498 X 2314 = 12722372

Fig. 2. Alternative way of multiplication by Urdhva Tiryakbhyam Sutra.

II. VEDIC MULTIPLICATION ALGORITHM

A. The Vedic Sutras

Vedic mathematics is based on 16 Sutras (or aphorisms)dealing with various branches of mathematics like arithmetic,algebra, geometry etc. [8]. These Sutras along with their briefmeanings are enlisted below alphabetically.

1) (Anurupye) Shunyamanyat – If one is in ratio, the otheris zero.

2) Chalana-Kalanabyham – Differences and Similarities.3) Ekadhikina Purvena – By one more than the previous

one.4) Ekanyunena Purvena – By one less than the previous

one.5) Gunakasamuchyah – The factors of the sum is equal to

the sum of the factors.6) Gunitasamuchyah – The product of the sum is equal to

the sum of the product.

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

O O O O

STEP 1 STEP 2

STEP 3 STEP 4

STEP 5 STEP 6

STEP 7

Fig. 3. Line diagram for multiplication of two 4-bit numbers.

7) Nikhilam Navatashcaramam Dashatah – All from 9 andthe last from 10.

8) Paraavartya Yojayet – Transpose and adjust.9) Puranapuranabyham – By the completion or non-

completion.10) Sankalana-vyavakalanabhyam – By addition and by sub-

traction.11) Shesanyankena Charamena – The remainders by the last

digit.12) Shunyam Saamyasamuccaye – When the sum is the

same that sum is zero.13) Sopaantyadvayamantyam – The ultimate and twice the

penultimate.14) Urdhva-Tiryagbyham – Vertically and crosswise.

Page 3: A Digital Multiplier Architecture Using Vedic Mathematics

15) Vyashtisamanstih – Part and Whole.16) Yaavadunam – Whatever the extent of its deficiency.These methods and ideas can be directly applied to

trigonometry, plain and spherical geometry, conics, calculus(both differential and integral), and applied mathematics ofvarious kinds. As mentioned earlier, all these Sutras werereconstructed from ancient Vedic texts early in the last centuryby Sri Bharati Krsna Tirtha. Many Sub-sutras were alsodiscovered at the same time which are not discussed here.

B. The Proposed Vedic Multiplier

One of the mentioned Sutras in the last subsection, Urd-hva Tiryakbhyam (Vertically and Crosswise), deals with themultiplication of numbers. This Sutra has been traditionallyused for the multiplication of two numbers in the decimalnumber system. In this paper, we apply the same idea to thebinary number system to make it compatible with the digitalhardware. Let us first illustrate this Sutra with the help of anexample in which two decimal numbers are multiplied.

Line diagram for the multiplication of two numbers (325×728) is shown in Fig. 1. The digits on the two ends of theline are multiplied and the result is added with the previouscarry. When there are more lines in one step, all the resultsare added to the previous carry. The least significant digit ofthe number thus obtained acts as one of the result digits andthe rest act as the carry for the next step. Initially the carry istaken to be zero.

An alternative method of multiplication using Urdhva-Tiryak Sutra is shown in Fig. 2. The numbers to be multipliedare written on two consecutive sides of the square as shownin the figure. The square is divided into rows and columnswhere each row/column corresponds to one of the digit ofeither a multiplier or a multiplicand. Thus, each digit ofthe multiplier has a small box common to a digit of themultiplicand. These small boxes are partitioned into two halvesby the crosswise lines. Each digit of the multiplier is thenindependently multiplied with every digit of the multiplicandand the two-digit product is written in the common box. All thedigits lying on a crosswise dotted line are added to the previouscarry. The least significant digit of the obtained number actsas the result digit and the rest as the carry for the next step.Carry for the first step (i.e., the dotted line on the extremeright side) is taken to be zero.

We now extend this Vedic multiplication algorithm to bi-nary number system with the preliminary knowledge that themultiplication of two bits a0 and b0 is just an AND operationand can be implemented using simple AND gate. To illustratethis multiplication scheme in binary number system, let usconsider the multiplication of two binary numbers a3a2a1a0

and b3b2b1b0. As the result of this multiplication would bemore than 4 bits, we express it as ...r3r2r1r0. Line diagramfor multiplication of two 4-bit numbers is shown in Fig. 3which is nothing but the mapping of the Fig. 1 in binarysystem. For the sake of simplicity, each bit is represented bya circle. Least significant bit r0 is obtained by multiplying theleast significant bits of the multiplicand and the multiplier. Theprocess is followed according to the steps shown in Fig. 3. As

in the last case, the digits on the both sides of the line aremultiplied and added with the carry from the previous step.This generates one of the bits of the result (rn) and a carry(say cn). This carry is added in the next step and hence theprocess goes on. If more than one lines are there in one step,all the results are added to the previous carry. In each step,least significant bit acts as the result bit and all the other bitsact as carry. For example, if in some intermediate step, we get110, then 0 will act as result bit and 11 as the carry (referedto as cn in this text). It should be clearly noted that cn maybe a multi-bit number. Thus we get the following expressions:

r0 = a0b0, (1)c1r1 = a1b0 + a0b1, (2)c2r2 = c1 + a2b0 + a1b1 + a0b2, (3)c3r3 = c2 + a3b0 + a2b1 + a1b2 + a0b3, (4)c4r4 = c3 + a3b1 + a2b2 + a1b3, (5)c5r5 = c4 + a3b2 + a2b3, (6)c6r6 = c5 + a3b3 (7)

with c6r6r5r4r3r2r1r0 being the final product. Partial productsare calculated in parallel and hence the delay involved is justthe time it takes for the signal to propagate through the gates.

III. HARDWARE ARCHITECTURE

The main advantage of the vedic multiplication algorithm(Urdhva-Tiryak Sutra) stems from the fact that it can beeasily realized in hardware. The hardware realization of a 4-bitmultiplier using this Sutra is shown in Fig. 4. This hardwaredesign is very similar to that of the famous array multiplierwhere an array of adders is requited to arrive at the finalproduct. All the partial products are calculated in parallel andthe delay associated is mainly the time taken by the carry topropagate through the adders which form the multiplicationarray.

IV. CONCLUSION

Ancient Indian system of mathematics, known as Vedicmathematics, can be applied to various branches of engi-neering to have a deeper insight into the working of variousformulae. The algorithms based on conventional mathematicscan be simplified and even optimized by the use of VedicSutras. We have discussed one such possible application ofVedic mathematics to digital signal processing. A simple Vedicmultiplier architecture based on the Urdhva Tiryakbhyam (Ver-tically and Cross wise) Sutra of Vedic mathematics has beenpresented. The hardware architecture of the Vedic multiplier isalso depicted and is found to be very similar to that of the socalled array multiplier. This is just one of the many possibleapplications of the Vedic Mathematics to Engineering andsome serious efforts are required to fully utilize the potentialof this interesting field for the advancement of Engineeringand Technology.

Although, Vedic mathematics provides many interestingSutras, but their application to the field of engineering is notyet fully studied. Knowingly or unknowingly we always useVedic Sutras in everyday world of technology. As an example,

Page 4: A Digital Multiplier Architecture Using Vedic Mathematics

ADDER ADDER ADDER ADDER ADDER ADDER

c r r r r r r r6 6 5 4 3 2 1 0

(Output)

bb

aaaa

bb

0123

0123

Fig. 4. Hardware Architecture of the proposed Vedic Multiplier.

whenever we use i← i+1 or i← i−1 in software routines, weuse ‘Ekadhikina Purvena’ and ‘Ekanyunena Purvena’ Sutrasrespectively. Similarly the Vedic algorithms can be directlyapplied to solve many problems of trigonometry, plain andspherical geometry, conics, calculus (both differential andintegral), and applied mathematics of various kinds. Hence,the vast potential of this interesting field should be exploitedto solve the real world problems efficiently.

REFERENCES

[1] Swami Bharati Krsna Tirtha, Vedic Mathematics. Delhi: Motilal Banar-sidass Publishers, 1965.

[2] Vedic Mathematics [Online]. Available:http://www.hinduism.co.za/vedic.htm.

[3] Kai Hwang, Computer Arithmetic: Principles, Architecture And Design.New York: John Wiley & Sons, 1979.

[4] D. Goldberg, “Computer Arithmetic”, in Computer Architecture: AQuantitative Approach, J.L. Hennessy and D.A. Patterson ed., pp. A1-A66, San Mateo, CA: Morgan Kaufmann, 1990.

[5] A.D. Booth, “A Signed Binary Multiplication Technique”, Qrt. J. Mech.App. Math.,, vol. 4, pp. 236–240, 1951.

[6] P. D. Chidgupkar and M. T. Karad, “The Implementation of VedicAlgorithms in Digital Signal Processing”, Global J. of Engg. Edu., vol.8, no. 2, 2004.

[7] H. Thapliyal and M. B. Srinivas, “High Speed Efficient N×N BitParallel Hierarchical Overlay Multiplier Architecture Based on AncientIndian Vedic Mathematics”, Enformatika Trans., vol. 2, pp. 225–228,Dec. 2004.

[8] Vedic Maths Sutras - Magic Formulae [Online]. Available:http://hinduism.about.com/library/weekly/extra/bl-vedicmathsutras.htm.

[9] Swami Bharati Krishna Tirtha’s Vedic mathematics [Online]. Available:http://en.wikipedia.org/wiki/Vedic mathematics.