Vedic Mathematics for Faster Mental

25,966 views

Published on

Vedic Mathematics for Faster Mental
Calculations and High Speed VLSI Arithmetic

Published in: Education, Technology
4 Comments
41 Likes
Statistics
Notes
No Downloads
Views
Total views
25,966
On SlideShare
0
From Embeds
0
Number of Embeds
1,809
Actions
Shares
0
Downloads
0
Comments
4
Likes
41
Embeds 0
No embeds

No notes for slide

Vedic Mathematics for Faster Mental

  1. 1. Vedic Mathematics for Faster Mental Calculations and High Speed VLSI Arithmetic Himanshu Thapliyal , Ph.D. Student Department of Computer Science and Engineering University of South Florida Web: http://www.csee.usf.edu/~hthapliy/ Email: hthapliy@cse.usf.edu <ul><li>Acknowledgement: </li></ul><ul><li>I would like to thank Gaurav Tekriwal , President The Vedic Math Forum India, for sharing the Vedic Maths Tutorial and permitting their use in the presentation </li></ul><ul><li>Many examples shown are from the seminal book “Vedic Mathematics or Sixteen Simple Sutras From The Vedas” by Jagadguru Swami Sri Bharath, Krsna Tirathji, Motilal Banarsidas , Varanasi(India),1965. </li></ul>
  2. 2. Introduction <ul><li>Vedic Mathematics is introduced by Jagadguru Swami Sri Bharati Krishna Tirthaji Maharaja (1884-1960). </li></ul><ul><li>Vedic means derived from Vedas or another definition by Sri Sankaracharya is “the fountain head and illimitable store house of all knowledge”. </li></ul><ul><li>Based on Sixteen Simple Mathematical formulae from the Vedas accumulated in a book ‘Vedic Mathematics’ by Swamiji </li></ul><ul><li>Prof. Kenneth Williams from U.K and many other researchers have done significant study on Vedic Maths. </li></ul><ul><li>Many books on Vedic Maths and its application are written by Prof. Kenneth Williams and other researchers. </li></ul>
  3. 4. Array Multiplier E.L. Braun. Digital computer design. New York academic, 1963.
  4. 5. Derivation of Array Multiplier from Vedic Mathematics
  5. 6. Partition Multiplier Derivation from Vedic Mathematics 1. H. Thapliyal and M.B Srinivas, &quot;High Speed Efficient N X N Bit Parallel Hierarchical Overlay Multiplier Architecture Based On Ancient Indian Vedic Mathematics&quot;, Enformatika (Transactions on Engineering, Computing and Technology),Volume 2,Dec 2004, pp.225-228.
  6. 7. The Duplex The concept of Duplex helps us to calculate Squares and Square Roots. Sanskrit Sutra: Dvanda Yoga
  7. 8. (abc) 2 = Duplex of (a/ab/abc/bc/c) 3 Digits Squaring
  8. 9. Duplex for Binary Number <ul><li>In order to calculate the square of a number “Duplex” D property of binary numbers has been taken advantage of. In 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 number of bits in the original sequence, there is one bit left by itself in the middle, and this enters as such. </li></ul>[1] H.Thapliyal and and H.R. Arabnia , &quot;A Time-Area-Power Efficient Multiplier and Square Architecture Based On Ancient Indian Vedic Mathematics&quot;, Proceedings of the 2004 International Conference on VLSI (VLSI'04: Las Vegas, USA), Paper acceptance rate of 35%; pp. 434-439. [2]H. Thapliyal and M.B. Srinivas ,”Design and Analysis of A Novel Parallel Square and Cube Architecture Based On Ancient Indian Vedic Mathematics&quot;, Proceedings of the 48th IEEE MIDWEST Symposium on Circuits and Systems (MWSCAS 2005), Cincinnati, Ohio, USA, August 7-10, 2005, pp.1462-1465. [3] H. Thapliyal and M.B. Srinivas ,”An Efficient Method of Elliptic Curve Encryption Using Ancient Indian Vedic Mathematics&quot;, Proceedings of the 48th IEEE MIDWEST Symposium on Circuits and Systems (MWSCAS 2005), Cincinnati, Ohio, USA, August 7-10, 2005, pp. 826-829.
  9. 10. <ul><li>Thus, </li></ul><ul><li>For a 1 bit number, D is the same number i.e D(X0)=X0. </li></ul><ul><li>For a 2 bit number D is twice their product i.e D(X1X0)=2 * X1 * X0. </li></ul><ul><li>For a 3 bit number D is twice the product of the outer pair + the e middle bit i.e D(X2X1X0)=2 * X2 * X0+X1. </li></ul><ul><li>For a 4 bit number D is twice the product of the outer pair + twice the product of the inner pair i.e D(X3X2X1X0) </li></ul><ul><li>=2 * X3 * X0+2 * X2 * X1 </li></ul><ul><li>The pairing of the bits 4 at a time is done for number to be squared. </li></ul><ul><li>Thus D (1)= 1; </li></ul><ul><li>D(11)=2 * 1 * 1; </li></ul><ul><li>D( 101)=2 * 1 * 1+0; </li></ul><ul><li>D(1011)=2 * 1 * 1+2 * 1 * 0; </li></ul>
  10. 11. Square Proposed in [1,2] [1] Albert A. Liddicoat and Michael J. Flynn, &quot;Parallel Square and Cube Computations&quot;, 34th Asilomar Conference on Signals, Systems, and Computers, California, October 2000. [2] Albert Liddicoat and Michael J. Flynn,&quot; Parallel Square and Cube Computations&quot;, Technical report CSL-TR-00-808 , Stanford University, August 2000.
  11. 12. Proposed Square <ul><li>The proposed square architecture is an improvement over partition multipliers in which the NXN bit multiplication can be performed by decomposing the multiplicand and multiplier bits into M partitions where M=N/K ( here N is the width of multiplicand and multiplier(divisible by 4 ) and K is a multiple of 4 such as 4, 8 , 12 ,16……….. 4* n). The partition multipliers are the fastest multipliers implemented in the commercial processors and are much faster than conventional multipliers. </li></ul>[1] H. Thapliyal and M.B. Srinivas ,”Design and Analysis of A Novel Parallel Square and Cube Architecture Based On Ancient Indian Vedic Mathematics&quot;, Proceedings of the 48th IEEE MIDWEST Symposium on Circuits and Systems (MWSCAS 2005), Cincinnati, Ohio, USA, August 7-10, 2005, pp.1462-1465. [2] H. Thapliyal and M.B. Srinivas ,”An Efficient Method of Elliptic Curve Encryption Using Ancient Indian Vedic Mathematics&quot;, Proceedings of the 48th IEEE MIDWEST Symposium on Circuits and Systems (MWSCAS 2005), Cincinnati, Ohio, USA, August 7-10, 2005, pp. 826-829.
  12. 13. Performance Improvement
  13. 14. Comparison with [1,2] [1] Albert A. Liddicoat and Michael J. Flynn, &quot;Parallel Square and Cube Computations&quot;, 34th Asilomar Conference on Signals, Systems, and Computers, California, October 2000. [2] Albert Liddicoat and Michael J. Flynn,&quot; Parallel Square and Cube Computations&quot;, Technical report CSL-TR-00-808 , Stanford University, August 2000.
  14. 15. Cube Anurupya 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) you will find that the 4th figure ( on the right end) is just the cube of the second digit”. a 3 + a 2 b + ab 2 + b 3 2a 2 b + 2ab 2 a 3 + 3a 2 b + 3ab 2 + b 3 (a + b) 3 =
  15. 16. This sutra has been utilized in this work to find the cube of a number. The number M of N bits having its cube to be calculated is divided in two partitions of N/2 bits, say a and b, and then the Anurupya Sutra is applied to find the cube of the number. [1] H. Thapliyal and M.B. Srinivas ,”Design and Analysis of A Novel Parallel Square and Cube Architecture Based On Ancient Indian Vedic Mathematics&quot;, Proceedings of the 48th IEEE MIDWEST Symposium on Circuits and Systems (MWSCAS 2005), Cincinnati, Ohio, USA, August 7-10, 2005, pp.1462-1465. [2] H. Thapliyal and M.B. Srinivas ,”An Efficient Method of Elliptic Curve Encryption Using Ancient Indian Vedic Mathematics&quot;, Proceedings of the 48th IEEE MIDWEST Symposium on Circuits and Systems (MWSCAS 2005), Cincinnati, Ohio, USA, August 7-10, 2005, pp. 826-829.
  16. 17. Cube Proposed in [1,2] [1] Albert A. Liddicoat and Michael J. Flynn, &quot;Parallel Square and Cube Computations&quot;, 34th Asilomar Conference on Signals, Systems, and Computers, California, October 2000. [2] Albert Liddicoat and Michael J. Flynn,&quot; Parallel Square and Cube Computations&quot;, Technical report CSL-TR-00-808 , Stanford University, August 2000.
  17. 18. A Comparison [1] Albert A. Liddicoat and Michael J. Flynn, &quot;Parallel Square and Cube Computations&quot;, 34th Asilomar Conference on Signals, Systems, and Computers, California, October 2000. [2] Albert Liddicoat and Michael J. Flynn,&quot; Parallel Square and Cube Computations&quot;, Technical report CSL-TR-00-808 , Stanford University, August 2000.
  18. 19. Straight Division
  19. 20. <ul><li>TABLE 2: 3 digit by 2 digit Vedic Division Algorithm </li></ul><ul><li>X2 X1 X0 by Y0Y1 </li></ul><ul><li>X2 X1: X0 </li></ul><ul><li>Y0 C1 : C0 </li></ul><ul><li>Y1 _________________ </li></ul><ul><li>Z1 Z0 : RD </li></ul><ul><li>------------------------------ </li></ul><ul><li>Steps: </li></ul><ul><li>1. First do X2/Y0 (divide) to get Z1 as quotient and C1 as remainder. </li></ul><ul><li>2. Call Procedure ADJUST(Z1,C1,X1,Y1,Y0). </li></ul><ul><li>Now take the next dividend as </li></ul><ul><li>K=( C1 * 10+X1)-(Y1 * Z1). </li></ul><ul><li>3. Do K/Y0(divide) to get Z0 as quotient and C0 as remainder. </li></ul><ul><li>4. Call procedure ADJUST (Z0,C0,X0,Y1,Y0). </li></ul><ul><li>Now Our required remainder, </li></ul><ul><li>RD=(C0 * 10+X0)-(Y1 * Z1). </li></ul><ul><li>Hence the Quotient= Qt=Z1Z0 </li></ul><ul><li>Remainder=RD </li></ul><ul><li>Procedure ADJUST (H, I, E, A, B) </li></ul><ul><li>{ </li></ul><ul><li>While ( (I * 10+E) < B * H) </li></ul><ul><li>{ </li></ul><ul><li>H=H-1; </li></ul><ul><li>I=I+ A; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>For example 35001/77 will work as follows </li></ul><ul><li>3 5 0 0 : 1 </li></ul><ul><li>7 7 7 : 7 </li></ul><ul><li>7 ---------------- </li></ul><ul><li>4 5 4 : 43 </li></ul><ul><li>1. Divide 35 by 7 and get 5 as the quotient and 0 as the remainder. </li></ul><ul><li>2. Call ADJUST (5,0, 0,7,7) . </li></ul><ul><li>=> modified quotient=5 and remainder 7 </li></ul><ul><li>Next Dividend K= ( 7 * 10 + 0)-(7 * 4)=42 </li></ul><ul><li>3. Do K/ 7 and get 6 as quotient and 0 as remainder. </li></ul><ul><li>4. Call ADJUST(6,0,0,7,7). </li></ul><ul><li>=> modified quotient 5 and remainder 7 </li></ul><ul><li>Next dividend K= (7 * 10+0)-(7 * 4)=42 </li></ul><ul><li>5. Do K/7 and get 6 as quotient and 0 as remainder </li></ul><ul><li>6. Call ADJUST (6,0,1,7,7) </li></ul><ul><li>=> modified quotient= 4 and remainder 7 </li></ul><ul><li>Remainder RD=(7 * 10+1)-(7 * 4)=43 </li></ul><ul><li>Therefore Quotient =454 and Remainder=43 </li></ul><ul><li>H. Thapliyal and H. R. Arabania,&quot;High Speed Efficient N Bit by N Bit Division Algorithm And Architecture Based On Ancient Indian Vedic Mathematics&quot;, Proceedings of VLSI04, Las Vegas, U.S.A, June 2004, pp. 413-419 </li></ul><ul><li>2. H. Thapliyal and M.B Srinivas, “VLSI Implementation of RSA Encryption System using Ancient Indian </li></ul><ul><li>Vedic Mathematics ”, Proceedings of SPIE -- Volume 5837 VLSI Circuits and Systems II, Jose F. Lopez, </li></ul><ul><li>Francisco V. Fernandez, Jose Maria Lopez-Villegas, Jose M. de la Rosa, Editors, June 2005, pp. 888-892 </li></ul>
  20. 21. Verification and Synthesis <ul><li>The algorithms are implemented in Verilog HDL and the simulation is done in Verilog simulator. </li></ul><ul><li>The code is synthesized in Synopsis FPGA Express. The design is optimized for speed using Xilinx, family Spartan, device S30VQ100. </li></ul><ul><li>The design is completely technology independent and can be easily converted from one technology to another </li></ul><ul><li>The Spartan family used for synthesis consists of FMAP & HMAP which are basically 4 inputs and 3 input XOR function respectively. </li></ul>
  21. 22. Timing Simulation Results of RSA Circuitry Using Vedic Overlay Multiplier and Division Architectures RSA Architecture ( With Overlay Multiplier) Vendor Family Device Area Delay(µs) F M A P H M A P Restore Division Xilinx Spartan S30VQ 100 14077 164 2.838 Non-Restore Division Xilinx Spartan S30VQ 100 6616 73 2.828 Vedic Division Xilinx Spartan S30VQ 100 14942 293 1.507
  22. 24. Results and Discussion <ul><li>Using the Vedic hierarchical overlay multiplier and the novel Vedic division algorithm lead to significant improvement in performance </li></ul><ul><li>The RSA circuitry has less timing delay compared to its implementation using traditional multipliers and division algorithms. </li></ul>
  23. 25. Conclusions <ul><li>Vedic Maths algorithms leads to faster mental calculation. </li></ul><ul><li>High speed VLSI arithmetic architectures can be derived from Vedic Maths </li></ul><ul><li>Due to its parallel and regular structure the Vedic algorithms can be easily laid out on silicon chip . </li></ul><ul><li>This presentation is a tribute to a great scholar and mathematician Jagadguru Swami Sri Bharati Krishna Tirthaji Maharaja. </li></ul><ul><li>Vedic maths India forum lead by Gaurav Tekriwal is doing a great job in promoting the Vedic Maths among the students. </li></ul>
  24. 26. <ul><li>To refer to (cite) this presentation, the following style should be used: </li></ul><ul><li>Himanshu Thapliyal, “Vedic Mathematics for Faster Mental Calculations and High Speed VLSI Arithmetic”, Invited talk at IEEE Computer Society Student Chapter, University of South Florida, Tampa, FL, Nov 14 2008. </li></ul>

×