Voice-Controlled Chess Game on Fpga Using Dynamic Time Warping

Total Page:16

File Type:pdf, Size:1020Kb

Voice-Controlled Chess Game on Fpga Using Dynamic Time Warping VOICE-CONTROLLED CHESS GAME ON FPGA USING DYNAMIC TIME WARPING Varun Chirravuri, Michael Kuo Project Abstract Most modern digital chess games employ a mouse and keyboard based user interface. We change this paradigm by designing an FPGA based, voice-controlled, chess game. We will train the game to recognize specified voice commands from the players. We will use dynamic time warping to compare real-time speech samples to the trained command templates to determine what move a player wishes to make. The game will be displayed on a VGA display with all the functionality of a standard chess game. Table of Contents VOICE-CONTROLLED CHESS GAME ON FPGA USING DYNAMIC TIME WARPING ............................. i Project Abstract ............................................................................................................................................... i Table of Figures ............................................................................................................................................. iv Overview............................................................................................................................................................ 1 Audio Recognition Hardware ............................................................................................................. 1 Chess Hardware ........................................................................................................................................ 2 Keyboard Input..................................................................................................................................... 2 Chess Engine .......................................................................................................................................... 2 Graphics Engine ................................................................................................................................... 3 Description ....................................................................................................................................................... 3 Input ............................................................................................................................................................... 3 Audio Recognition Hardware ............................................................................................................. 3 DTW System Controller .................................................................................................................... 4 Dynamic Time Warping Engines.................................................................................................. 7 Valid Checker ...................................................................................................................................... 10 Finite Impulse Response Filter .................................................................................................. 11 Shift Connector .................................................................................................................................. 11 Chess Hardware ..................................................................................................................................... 12 Keyboard Input.................................................................................................................................. 12 Keyboard Entry ................................................................................................................................. 12 Keyboard Encoder ........................................................................................................................... 13 Chess Engine ....................................................................................................................................... 13 Chess Engine ....................................................................................................................................... 14 Move Checker ..................................................................................................................................... 15 Graphics Engine ................................................................................................................................ 16 Chessboard Drawer ......................................................................................................................... 16 Chess Pieces Drawer ....................................................................................................................... 17 Text Drawer ........................................................................................................................................ 18 Chess Graphics ................................................................................................................................... 18 Testing and Debugging ............................................................................................................................ 18 Audio Recognition Hardware .......................................................................................................... 18 ii DTW Engine ........................................................................................................................................ 19 DTW System Controller ................................................................................................................. 20 System Integration .......................................................................................................................... 20 Proof of Concept Testing............................................................................................................... 20 Chess Hardware ..................................................................................................................................... 21 Conclusion ..................................................................................................................................................... 22 Appendices .................................................................................................................................................... 23 Appendix A : Single DTW Test Data “Funk” v “Bridge” and “Cat” v “Dog” ................. 23 Appendix B: Letter Hit Frequency Data ...................................................................................... 25 Appendix C: Shift Connector Verilog ............................................................................................ 28 Appendix D: FIR 31 Verilog .............................................................................................................. 30 Appendix E: DTW Engine Verilog .................................................................................................. 33 Appendix F: DTW System Controller + Valid Checker Verilog ........................................ 38 Appendix G: Modified Lab 4 W/ Instantiated Modules + Debouncer Verilog .......... 46 Appendix H: Labkit File for Chess System ................................................................................. 62 Appendix I: Keyboard Entry ............................................................................................................. 74 Appendix J: Keyboard Encoder ....................................................................................................... 76 Appendix K: Chess Engine ................................................................................................................. 81 Appendix L: Move Checker ............................................................................................................... 88 Appendix L: Chessboard Drawer ................................................................................................... 97 Appendix M: Chess Pieces Drawer ................................................................................................ 98 Appendix N: Text Drawer ................................................................................................................102 Appendix O: Chess Graphics...........................................................................................................108 Appendix P: MATLAB JPG to COE ................................................................................................111 iii Table of Figures Figure 1. High Level Block Diagram Of Entire System................................................................. 1 Figure 2. Top level block diagram of chess system. ...................................................................... 2 Figure 3. Move command encoding. ..................................................................................................... 3 Figure 4. Block Diagram Of Audio Recognition Hardware. ....................................................... 4 Figure 5. Outer FSM of the DTW System Controller. .................................................................... 5 Figure 6. Inner FSM of the DTW System Controller. .................................................................... 7 Figure 7. Diagram of the DTW Engine. ................................................................................................ 8 Figure 8. Dynamic Time Warping Engine FSM............................................................................. 10 Figure 9. Block diagram of keyboard input component. ......................................................... 12 Figure 10. Block diagram of chess engine component.
Recommended publications
  • The 12Th Top Chess Engine Championship
    TCEC12: the 12th Top Chess Engine Championship Article Accepted Version Haworth, G. and Hernandez, N. (2019) TCEC12: the 12th Top Chess Engine Championship. ICGA Journal, 41 (1). pp. 24-30. ISSN 1389-6911 doi: https://doi.org/10.3233/ICG-190090 Available at http://centaur.reading.ac.uk/76985/ It is advisable to refer to the publisher’s version if you intend to cite from the work. See Guidance on citing . To link to this article DOI: http://dx.doi.org/10.3233/ICG-190090 Publisher: The International Computer Games Association All outputs in CentAUR are protected by Intellectual Property Rights law, including copyright law. Copyright and IPR is retained by the creators or other copyright holders. Terms and conditions for use of this material are defined in the End User Agreement . www.reading.ac.uk/centaur CentAUR Central Archive at the University of Reading Reading’s research outputs online TCEC12: the 12th Top Chess Engine Championship Guy Haworth and Nelson Hernandez1 Reading, UK and Maryland, USA After the successes of TCEC Season 11 (Haworth and Hernandez, 2018a; TCEC, 2018), the Top Chess Engine Championship moved straight on to Season 12, starting April 18th 2018 with the same divisional structure if somewhat evolved. Five divisions, each of eight engines, played two or more ‘DRR’ double round robin phases each, with promotions and relegations following. Classic tempi gradually lengthened and the Premier division’s top two engines played a 100-game match to determine the Grand Champion. The strategy for the selection of mandated openings was finessed from division to division.
    [Show full text]
  • Chess Engine Using Deep Reinforcement Learning Kamil Klosowski
    Chess Engine Using Deep Reinforcement Learning Kamil Klosowski 916847 May 2019 Abstract Reinforcement learning is one of the most rapidly developing areas of Artificial Intelligence. The goal of this project is to analyse, implement and try to improve on AlphaZero architecture presented by Google DeepMind team. To achieve this I explore different architectures and methods of training neural networks as well as techniques used for development of chess engines. Project Dissertation submitted to Swansea University in Partial Fulfilment for the Degree of Bachelor of Science Department of Computer Science Swansea University Declaration This work has not previously been accepted in substance for any degree and is not being currently submitted for any degree. May 13, 2019 Signed: Statement 1 This dissertation is being submitted in partial fulfilment of the requirements for the degree of a BSc in Computer Science. May 13, 2019 Signed: Statement 2 This dissertation is the result of my own independent work/investigation, except where otherwise stated. Other sources are specifically acknowledged by clear cross referencing to author, work, and pages using the bibliography/references. I understand that fail- ure to do this amounts to plagiarism and will be considered grounds for failure of this dissertation and the degree examination as a whole. May 13, 2019 Signed: Statement 3 I hereby give consent for my dissertation to be available for photocopying and for inter- library loan, and for the title and summary to be made available to outside organisations. May 13, 2019 Signed: 1 Acknowledgment I would like to express my sincere gratitude to Dr Benjamin Mora for supervising this project and his respect and understanding of my preference for largely unsupervised work.
    [Show full text]
  • Elo World, a Framework for Benchmarking Weak Chess Engines
    Elo World, a framework for with a rating of 2000). If the true outcome (of e.g. a benchmarking weak chess tournament) doesn’t match the expected outcome, then both player’s scores are adjusted towards values engines that would have produced the expected result. Over time, scores thus become a more accurate reflection DR. TOM MURPHY VII PH.D. of players’ skill, while also allowing for players to change skill level. This system is carefully described CCS Concepts: • Evaluation methodologies → Tour- elsewhere, so we can just leave it at that. naments; • Chess → Being bad at it; The players need not be human, and in fact this can facilitate running many games and thereby getting Additional Key Words and Phrases: pawn, horse, bishop, arbitrarily accurate ratings. castle, queen, king The problem this paper addresses is that basically ACH Reference Format: all chess tournaments (whether with humans or com- Dr. Tom Murphy VII Ph.D.. 2019. Elo World, a framework puters or both) are between players who know how for benchmarking weak chess engines. 1, 1 (March 2019), to play chess, are interested in winning their games, 13 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn and have some reasonable level of skill. This makes 1 INTRODUCTION it hard to give a rating to weak players: They just lose every single game and so tend towards a rating Fiddly bits aside, it is a solved problem to maintain of −∞.1 Even if other comparatively weak players a numeric skill rating of players for some game (for existed to participate in the tournament and occasion- example chess, but also sports, e-sports, probably ally lose to the player under study, it may still be dif- also z-sports if that’s a thing).
    [Show full text]
  • Super Human Chess Engine
    SUPER HUMAN CHESS ENGINE FIDE Master / FIDE Trainer Charles Storey PGCE WORLD TOUR Young Masters Training Program SUPER HUMAN CHESS ENGINE Contents Contents .................................................................................................................................................. 1 INTRODUCTION ....................................................................................................................................... 2 Power Principles...................................................................................................................................... 4 Human Opening Book ............................................................................................................................. 5 ‘The Core’ Super Human Chess Engine 2020 ......................................................................................... 6 Acronym Algorthims that make The Storey Human Chess Engine ......................................................... 8 4Ps Prioritise Poorly Placed Pieces ................................................................................................... 10 CCTV Checks / Captures / Threats / Vulnerabilities ...................................................................... 11 CCTV 2.0 Checks / Checkmate Threats / Captures / Threats / Vulnerabilities ............................. 11 DAFiii Attack / Features / Initiative / I for tactics / Ideas (crazy) ................................................. 12 The Fruit Tree analysis process ............................................................................................................
    [Show full text]
  • Project: Chess Engine 1 Introduction 2 Peachess
    P. Thiemann, A. Bieniusa, P. Heidegger Winter term 2010/11 Lecture: Concurrency Theory and Practise Project: Chess engine http://proglang.informatik.uni-freiburg.de/teaching/concurrency/2010ws/ Project: Chess engine 1 Introduction From the Wikipedia article on Chess: Chess is a two-player board game played on a chessboard, a square-checkered board with 64 squares arranged in an eight-by-eight grid. Each player begins the game with sixteen pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. The object of the game is to checkmate the opponent’s king, whereby the king is under immediate attack (in “check”) and there is no way to remove or defend it from attack on the next move. The game’s present form emerged in Europe during the second half of the 15th century, an evolution of an older Indian game, Shatranj. Theoreticians have developed extensive chess strategies and tactics since the game’s inception. Computers have been used for many years to create chess-playing programs, and their abilities and insights have contributed significantly to modern chess theory. One, Deep Blue, was the first machine to beat a reigning World Chess Champion when it defeated Garry Kasparov in 1997. Do not worry if you are not familiar with the rules of chess! You are not asked to change the methods which calculate the moves, nor the internal representation of boards or moves, nor the scoring of boards. 2 Peachess Peachess is a chess engine written in Java. The implementation consists of several components. 2.1 The chess board The chess board representation stores the actual state of the game.
    [Show full text]
  • Dvoretsky's Endgame Manual
    Dvoretsky’s Endgame Manual Mark Dvoretsky Foreword by Artur Yusupov Preface by Jacob Aagaard 2003 Russell Enterprises, Inc. Milford, CT USA 1 Table of Contents Foreword 6 Preface 7 From the Author 8 Other Signs, Symbols, and Abbreviations 12 Chapter 1 PAWN ENDGAMES 13 Key Squares 13 Corresponding Squares 14 Opposition 14 Mined Squares 18 Triangulation 20 Other Cases of Correspondence 22 King vs. Passed Pawns 24 The Rule of the Square 24 Réti’s Idea 25 The Floating Square 27 Three Connected Pawns 28 Queen vs. Pawns 29 Knight or Center Pawn 29 Rook or Bishop’s Pawn 30 Pawn Races 32 The Active King 34 Zugzwang 34 Widening the Beachhead 35 The King Routes 37 Zigzag 37 The Pendulum 38 Shouldering 38 Breakthrough 40 The Outside Passed Pawn 44 Two Rook’s Pawns with an Extra Pawn on the Opposite Wing 45 The Protected Passed Pawn 50 Two Pawns to One 50 Multi-Pawn Endgames 50 Undermining 53 Two Connected Passed Pawns 54 Stalemate 55 The Stalemate Refuge 55 “Semi-Stalemate” 56 Reserve Tempi 57 Exploiting Reserve Tempi 57 Steinitz’s Rule 59 The g- and h-Pawns vs. h-Pawn 60 The f- and h-Pawns vs. h-Pawn 62 Both Sides have Reserve Tempi 65 Chapter 2 KNIGHT VS. PAWNS 67 1 King in the Corner 67 Mate 67 Drawn Positions 67 Knight vs. Rook Pawn 68 The Knight Defends the Pawn 70 Chapter 3 KNIGHT ENDGAMES 74 The Deflecting Knight Sacrifice 74 Botvinnik’s Formula 75 Pawns on the Same Side 79 Chapter 4 BISHOP VS.
    [Show full text]
  • Portable Game Notation Specification and Implementation Guide
    11.10.2020 Standard: Portable Game Notation Specification and Implementation Guide Standard: Portable Game Notation Specification and Implementation Guide Authors: Interested readers of the Internet newsgroup rec.games.chess Coordinator: Steven J. Edwards (send comments to [email protected]) Table of Contents Colophon 0: Preface 1: Introduction 2: Chess data representation 2.1: Data interchange incompatibility 2.2: Specification goals 2.3: A sample PGN game 3: Formats: import and export 3.1: Import format allows for manually prepared data 3.2: Export format used for program generated output 3.2.1: Byte equivalence 3.2.2: Archival storage and the newline character 3.2.3: Speed of processing 3.2.4: Reduced export format 4: Lexicographical issues 4.1: Character codes 4.2: Tab characters 4.3: Line lengths 5: Commentary 6: Escape mechanism 7: Tokens 8: Parsing games 8.1: Tag pair section 8.1.1: Seven Tag Roster 8.2: Movetext section 8.2.1: Movetext line justification 8.2.2: Movetext move number indications 8.2.3: Movetext SAN (Standard Algebraic Notation) 8.2.4: Movetext NAG (Numeric Annotation Glyph) 8.2.5: Movetext RAV (Recursive Annotation Variation) 8.2.6: Game Termination Markers 9: Supplemental tag names 9.1: Player related information www.saremba.de/chessgml/standards/pgn/pgn-complete.htm 1/56 11.10.2020 Standard: Portable Game Notation Specification and Implementation Guide 9.1.1: Tags: WhiteTitle, BlackTitle 9.1.2: Tags: WhiteElo, BlackElo 9.1.3: Tags: WhiteUSCF, BlackUSCF 9.1.4: Tags: WhiteNA, BlackNA 9.1.5: Tags: WhiteType, BlackType
    [Show full text]
  • Art. I.—On the Persian Game of Chess
    JOURNAL OF THE ROYAL ASIATIC SOCIETY. ART. I.— On the Persian Game of Chess. By K BLAND, ESQ., M.R.A.S. [Read June 19th, 1847.] WHATEVER difference of opinion may exist as to the introduction of Chess into Europe, its Asiatic origin is undoubted, although the question of its birth-place is still open to discussion, and will be adverted to in this essay. Its more immediate design, however, is to illustrate the principles and practice of the game itself from such Oriental sources as have hitherto escaped observation, and, especially, to introduce to particular notice a variety of Chess which may, on fair grounds, be considered more ancient than that which is now generally played, and lead to a theory which, if it should be esta- blished, would materially affect our present opinions on its history. In the life of Timur by Ibn Arabshah1, that conqueror, whose love of chess forms one of numerous examples among the great men of all nations, is stated to have played, in preference, at a more complicated game, on a larger board, and with several additional pieces. The learned Dr. Hyde, in his valuable Dissertation on Eastern Games2, has limited his researches, or, rather, been restricted in them by the nature of his materials, to the modern Chess, and has no further illustrated the peculiar game of Timur than by a philological Edited by Manger, "Ahmedis ArabsiadEe Vitae et Rernm Gestarum Timuri, qui vulgo Tamerlanes dicitur, Historia. Leov. 1772, 4to;" and also by Golius, 1736, * Syntagma Dissertationum, &c. Oxon, MDCCJ-XVII., containing "De Ludis Orientalibus, Libri duo." The first part is " Mandragorias, seu Historia Shahi.
    [Show full text]
  • Determining If You Should Use Fritz, Chessbase, Or Both Author: Mark Kaprielian Revised: 2015-04-06
    Determining if you should use Fritz, ChessBase, or both Author: Mark Kaprielian Revised: 2015-04-06 Table of Contents I. Overview .................................................................................................................................................. 1 II. Not Discussed .......................................................................................................................................... 1 III. New information since previous versions of this document .................................................................... 1 IV. Chess Engines .......................................................................................................................................... 1 V. Why most ChessBase owners will want to purchase Fritz as well. ......................................................... 2 VI. Comparing the features ............................................................................................................................ 3 VII. Recommendations .................................................................................................................................... 4 VIII. Additional resources ................................................................................................................................ 4 End of Table of Contents I. Overview Fritz and ChessBase are software programs from the same company. Each has a specific focus, but overlap in some functionality. Both programs can be considered specialized interfaces that sit on top a
    [Show full text]
  • Move Similarity Analysis in Chess Programs
    Move similarity analysis in chess programs D. Dailey, A. Hair, M. Watkins Abstract In June 2011, the International Computer Games Association (ICGA) disqual- ified Vasik Rajlich and his Rybka chess program for plagiarism and breaking their rules on originality in their events from 2006-10. One primary basis for this came from a painstaking code comparison, using the source code of Fruit and the object code of Rybka, which found the selection of evaluation features in the programs to be almost the same, much more than expected by chance. In his brief defense, Rajlich indicated his opinion that move similarity testing was a superior method of detecting misappropriated entries. Later commentary by both Rajlich and his defenders reiterated the same, and indeed the ICGA Rules themselves specify move similarity as an example reason for why the tournament director would have warrant to request a source code examination. We report on data obtained from move-similarity testing. The principal dataset here consists of over 8000 positions and nearly 100 independent engines. We comment on such issues as: the robustness of the methods (upon modifying the experimental conditions), whether strong engines tend to play more similarly than weak ones, and the observed Fruit/Rybka move-similarity data. 1. History and background on derivative programs in computer chess Computer chess has seen a number of derivative programs over the years. One of the first was the incident in the 1989 World Microcomputer Chess Cham- pionship (WMCCC), in which Quickstep was disqualified due to the program being \a copy of the program Mephisto Almeria" in all important areas.
    [Show full text]
  • New Architectures in Computer Chess Ii New Architectures in Computer Chess
    New Architectures in Computer Chess ii New Architectures in Computer Chess PROEFSCHRIFT ter verkrijging van de graad van doctor aan de Universiteit van Tilburg, op gezag van de rector magnificus, prof. dr. Ph. Eijlander, in het openbaar te verdedigen ten overstaan van een door het college voor promoties aangewezen commissie in de aula van de Universiteit op woensdag 17 juni 2009 om 10.15 uur door Fritz Max Heinrich Reul geboren op 30 september 1977 te Hanau, Duitsland Promotor: Prof. dr. H.J.vandenHerik Copromotor: Dr. ir. J.W.H.M. Uiterwijk Promotiecommissie: Prof. dr. A.P.J. van den Bosch Prof. dr. A. de Bruin Prof. dr. H.C. Bunt Prof. dr. A.J. van Zanten Dr. U. Lorenz Dr. A. Plaat Dissertation Series No. 2009-16 The research reported in this thesis has been carried out under the auspices of SIKS, the Dutch Research School for Information and Knowledge Systems. ISBN 9789490122249 Printed by Gildeprint © 2009 Fritz M.H. Reul All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronically, mechanically, photocopying, recording or otherwise, without prior permission of the author. Preface About five years ago I completed my diploma project about computer chess at the University of Applied Sciences in Friedberg, Germany. Immediately after- wards I continued in 2004 with the R&D of my computer-chess engine Loop. In 2005 I started my Ph.D. project ”New Architectures in Computer Chess” at the Maastricht University. In the first year of my R&D I concentrated on the redesign of a computer-chess architecture for 32-bit computer environments.
    [Show full text]
  • [Math.HO] 4 Oct 2007 Computer Analysis of the Two Versions
    Computer analysis of the two versions of Byzantine chess Anatole Khalfine and Ed Troyan University of Geneva, 24 Rue de General-Dufour, Geneva, GE-1211, Academy for Management of Innovations, 16a Novobasmannaya Street, Moscow, 107078 e-mail: [email protected] July 7, 2021 Abstract Byzantine chess is the variant of chess played on the circular board. In the Byzantine Empire of 11-15 CE it was known in two versions: the regular and the symmetric version. The difference between them: in the latter version the white queen is placed on dark square. However, the computer analysis reveals the effect of this ’perturbation’ as well as the basis of the best winning strategy in both versions. arXiv:math/0701598v2 [math.HO] 4 Oct 2007 1 Introduction Byzantine chess [1], invented about 1000 year ago, is one of the most inter- esting variations of the original chess game Shatranj. It was very popular in Byzantium since 10 CE A.D. (and possible created there). Princess Anna Comnena [2] tells that the emperor Alexius Comnenus played ’Zatrikion’ - so Byzantine scholars called this game. Now it is known under the name of Byzantine chess. 1 Zatrikion or Byzantine chess is the first known attempt to play on the circular board instead of rectangular. The board is made up of four concentric rings with 16 squares (spaces) per ring giving a total of 64 - the same as in the standard 8x8 chessboard. It also contains the same pieces as its parent game - most of the pieces having almost the same moves. In other words divide the normal chessboard in two halves and make a closed round strip [1].
    [Show full text]