Skip to main content

Automatic Sudoku solver with SystemVerilog

Hello, 

You have been heard of sudoku as a great puzzle where we have to place numbers in a square using the rules - like unique row, unique column, and unique sub-square...

What about solving it just like that? Yeah, you can now automate the sudoku using the hardware language - "SystemVerilog"...!

SystemVerilog is a hardware language to program the electronic circuits and to test them as well - The other hardware language are Verilog and VHDL (You can refer here a brief tabulated version of differences between all the three here)

SystemVerilog is like an updated version of Verilog; Hence, in industry VHDL or SystemVerilog are preferred to Verilog...

Okay, how SystemVerilog helps to solve Sudoku?

In the SystemVerilog, there is a feature to randomize the given values; but that's not yet - we can control the randomization with a feature called  "Constraints"

Briefly, these constraints help the randomization stick to given conditions, like:-

1. The values should be in the given range;

2. The values should have the given distribution;

3. We can even make a set of randomized values unique...

So, yeah, we can use that "being unique" concept to solve our sudoku - but hey, it is not that direct..

Well, finally you can try to code this if you wanna feed a good puzzle to your brain... (In case if you want to learn the SystemVerilog, you can take some help here!) 

Well, if you just want to solve the sudoku directly, you can click this and enter your given values and wait for the magic..!

(Note: EDA playground is an online based hardware language compiler and editor)

Thank you for reading..!

As always, you can absolutely mention your suggestions for the improvement of post through the comments section...

Do you also know some cool puzzles and the solutions to automate? We love to hear from you; share them with us and help us reach the 'Eternal Thing'...

Comments

Popular posts from this blog

Top 5 take aways from "Linux 101 Hacks" - The Bloggers League 2022

  Author: Rama Subrahmanyam Hello, how are you doing..?         We all know that Windows is a super cute-looking OS, but software people will connect to Linux; It offers much flexibility with file management, and plus, it's open-source too..!         So, the book - Linux 101 Hacks, is a nice intro for beginners, by Ramesh Natarajan . Having said that, we look at the top 5 hacks from the book. It is a free e-book, and you can download it here . 1. 'alias' for most used commands:-     There will be commands that are used repeatedly, for which we can have a shortcut using an alias. For example, for cd commands, we can have            alias cd1="cd .."           alias cd2="cd ../.."           alias cd3="cd ../../.."           alias cd4="cd ../../../.."           alias cd5="cd ../../../../.." *Put these in your .bashrc to save permanently. 2. 'ctrl-r' to search:-     Pressing the up arrow till you reach that one previous

Bye-bye strict timetables...! - The Bloggers League 2022

     Author: Rama Subrahmanyam (ramasubrahmanyam.m@gmail.com) When we are planning for multi-tasking, we divide our time and allocate it for each task. That is a great thing, as it gives a chance for incremental growth, eventually getting compounded...      Scheduling makes us punctual; sometimes forces us to be punctual if someone is counting on us, say an examination, office meeting, so on...      Besides strict things, some activities should happen at planned times, like sports, gym, etc. But, we still have things, that can be done in our free time - say reading books, solving puzzles, or learning something of our passion. Should we also maintain the timetable in those cases...? Well, may not be that necessary... We get used to a task at the same time if we have a strict timetable; In a way, can also affect our peace... Suppose due to urgent work, we missed a task      -  We may develop a bad feeling,      - This can lead to frustration, anger, regret, grief...       uff... Enough d

How can we become narrow-minded people without realising it?

In science, whenever we observe a novel event, we start sharpening our brains to decode it. We make a couple more observations related to that event, and try to get a reason for it. It was also the same with the previous generation of scientists. They observed various new phenomena and they gathered as much information as possible to get the accurate reason behind them. But there was a problem with the human mind. In the past days, when there was limited information at hand and more time was required for getting new information, scientists had to make the best possible theories (i.e., explanations) with whatever data was available. It was like a competition, where the scientist with the best theory would win. This "winner" scientist, should be able to explain the data from future experiments with the theory. Consider that, a new experiment happened later, but the results were not explained by the theory of our scientist, then the theory was to be changed, and again the compet