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

25 and Disappointed: The tragedy of leaving home

It’s strange, isn’t it? We live in a world with high-speed internet, 5G, instant messages, Zoom calls and flight tickets that can take us across the country in a few hours. The world has never been more connected. And yet… we’re all so far apart. We are becoming disabled in this tech enabled world. People move away from home more than ever. To study. To work. To “build a future.” Yes, it’s needed sometimes. For learning. For exposure.  But often… it seems we are allowing it quietly more than required. Maybe it’s just the system forcing us to. All the jobs are in cities. All the money, infrastructure and “opportunities”. Hence we leave. We leave behind warm meals, evening walks with parents, familiar lanes and families that actually feel like festivals. We leave people who raised us - and see them only on phone calls or during a short visit squeezed between deadlines. For what? For a cubicle in a crowded city, A rented flat that never feels like home, Weekends that vanish in chores,...

my fav quotes from my teachers

  On the occasion of Teacher's day, I wanted to remember my fav teachers in school/teacher and their quotes that stayed fresh in my mind after many years. NOTE: I may not remember the exact words. These are just from my memory. Anyway, who cares?   From my social sir in school:- When does a revolt rise? When people lose their patience. From my Sanskrit sir in jr. college:- There is no edge for knowledge. From my chemistry sir in jr. college:- No one wants to return from the death. Maybe death is very beautiful. Also from the same sir:- When you comb your hair, your focus should be on completely on your hair and the comb. Also from the same sir:- In a forest, the tallest animal is Giraffe. The wisest animal is fox. The largest animal is Elephant. Lion is none of them. But still he is king of the jungle. From my maths sir in jr. college:- (he said in a form of poem which his teacher told) I am going through a forest,  On the way there was beautiful trees,  with bloomin...