Computing Spectrum – Simon Says

6 Jun , 2016  

Computing Spectrum & Simon Says

The 80’s are back!

Simon Says is a great example of a Computing System

Just like cell phones, computers, smart watches and wearables “Simon Says” consists of two major systems one clearly visible – the Hardware – and the other – the Software – hidden from sight. For this discussion, we’re focusing on SparkFun’s Simon Says Through Hole Soldering Kit!

The Hardware System – Electrical Engineers

Computing systems often interact with other systems – think cars, satellites, even phones. The interaction happens through the hardware system. The hardware system enables interactions with the physical world, taking inputs from the world and providing output to the world. In todays computing systems, the hardware system is generally responsible for translating information to and from the world to the brains of the hardware system – a processor. For the “Simon Says” the processing brains happens to be a microprocessor. The microprocessor is where the second major system – the Software – is hiding.

The Software System – Computer Scientist

The software subsystem is responsible for taking signals (translated, filtered and sanitized by the hardware system) and performing logical operations on these signals. The software system is the “brains” – it performs all of the calculations and maintains the logical state of the system. The processor itself is also a hardware system! Just like our brains are made of cells, the wiring of those cells allows us to think, process and control our bodies .

Getting Software & Hardware Systems to talk? Computer Engineers!

Maybe a picture will help? Sure it’s an over-simplification – so if you ever find yourself on this spectrum (or you’re reading this and already are on the spectrum) you’ll likely feel that in reality, the spectrum isn’t so crisply defined. The major take away is the following:

  • To the left (electrical engineering) you have the physical components that interact with the “real world” they are bound to the properties of physics;
  • on the right (computer science) you have logic and control through language (coding) that is supported by our understanding mathematics and logical truths; and
  • in the middle (computer engineering) you have the glue that allows the left and right side to communicate – the better the glue the easier/smoother the interaction between the left and right sides!


Your Turn

Looking at the Simon Says system, what are the inputs and output to the system?

With those input and outputs defined, can you describe the logic within the Simon Says system?

  • How do you start the game?
  • How does the game end?
  • What happens in the middle? / e.g. what is repeated?

After you go through this thought exercise check out the following, simplified python code which emulates the logic of Simon Says at a very high level. Afterwards, compare it to your original thoughts – think you can modify the code? There’s a link for you to try!

Example Code

Now head on over to the PythonTutor page with this code!

Okay – so now let’s look at the real code!

Actual Simon Says Code

The code running on the SparkFun Simon Says can be found for free on GitHub. While there are many files, the one that contains the portion of interest is here! The code uses an idea called abstraction, in which code is broken down into small manageable functions. Here’s the top level Simon Says code for a single player game, it makes assumptions about a value that should have previously been defined ( ROUNDS_TO_WIN , gameBoard), as well as a few other functions which modify gameBoard : add_to_moves() , playMoves(). When you begin investigating the code, you will notice even more functions within these functions.

Finally, now that you’ve seen the code – go to the live github page and find out how to access the secret features of your Simon.

Need A Hint?
Um, 1 more hint please?
I'm still lost, can you help?

Have thoughts? Feedback? Let us know!

Leave a comment on this post, send us a tweet @MBorowczak|@SciEdBurrows  or shoot us an email mike [at] erebusLabs [dot] com & aburrow1 [at] uwyo [dot] edu

Want the educational materials (pre/post) we used as well? Check out Andrea’s post on her website!

, ,

Comments are closed.