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

25 and Disappointed: Can’t we choose simple life?

 There’s something strange about the way we live now. It’s not enough to do your job. You have to grow. Climb. Upskill. Network. Earn more. Spend more. Repeat. People areound you - even the ones who seem tired - still say, “Keep pushing.” The ones ahead keep reaching higher. The ones behind are told to catch up. And if you stand still for even a moment, they say you’re wasting time. But no one explains why. Why is a peace a problem? Why is being satisfied with what you have seen as a failure? This idea of “simple life” - it used to be normal. Work. Come home. Cook. Be with the people you love. Rest. Now it’s rare. Or romanticized. Or quietly looked down on. We’re told that success means constant movement. That we need to hustle, or we’ll be left behind.  But behind what, really? We’ve normalized the rat race, without asking who started it. And the truth is - only a few can actuallly win it. Most people burn out trying.  Others fake their way through it, smiling through st...

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,    ...

25 and Disappointed: Survival should not mean Struggling

There are days I wish I could just leave my job. But I don’t do it. Because I need to pay my rent. I need to eat. I don’t have any other income. I am afraid that I am not alone in this. I see people who are smart and talented - doing things they don’t love. They settle. Not out of choice, but out of fear. The fear of being homeless, being hungry. They live in a world that demands payment of bills more than anything. That brings a simple, maybe naive thought: What if food and shelter were guaranteed for everyone? What if one need not be working just to survive? Is it wild to wish for these? Are these not the basic human rights… If the basic needs were covered, what could we become? Artists, teachers, thinkers, healers - they are made out of passion. People can volunteer more, care for the elderly, innovate better, or take time and get a chance to do things slower… The working class would not have to burn themselves to keep the lights on. The poor wouldn’t have to beg.  What if peopl...