Sunday, August 20, 2017

"Fuel, Air, and Spark" as a processor analogy.

One EE I worked with years ago used an analogy that has stuck with me when debugging embedded systems.  He said, "A processor is like a car engine, it only needs three things to run: fuel, air, and spark."  The fuel is power: you need the correct voltage on all the rails.  In some more complex systems, you need to carefully respect the power sequencing rules, but more generally you need the correct power.  The air in this analogy is the code and data, drawn in from memory and through the engine of the processor in the unending march of the program counter.  Sure, the analogy is imperfect because you loop back through and jump around within the code, but it needs to be there, or the processor never has anything to execute.  And finally, the spark is the clock.  In an engine, the spark triggers the combustion in the cylinders, and in a processor the clock advances the sequential logic of all the state machines that together make up the overall state machine of the processor.  Without spark, the fuel-air mixture in an engine never burns.  Without the clock, a processor never advances.

This analogy makes debugging an embedded system or any sort of processor system remarkably straightforward.  If it isn't operating, it's because something is wrong with the fuel (power), air (code / data), or the spark (clock.)  A voltmeter can quickly tell you if the power rail has the approximately correct DC voltage, and an oscilloscope will reveal transient deviations in voltage.  A 'scope will also let you check your clock signal, both for frequency and electrical quality.  And if you have an external address/data bus, you can watch the memory transaction directly.  For an embedded system with all internal memory, your examination of the code / data may need to be more indirect.  But if you get all three things, fuel (power), air (code), and spark (clock), together, and the hardware is not fundamentally broken, then the processor will run.

Saturday, July 29, 2017

Ewwwww!! Sharing Germs At The Venetian Hotel in Las Vegas

Note:  I have a ton of half-written posts, so I'm going to try to finish up and post some of them.  Here's something from the start of 2017...

I stayed at The Venetian hotel in Las Vegas while I was at CES in January, and noticed something really gross...

The water glass in the bathroom had a layer of crud in the bottom of it.  Maybe it was just hard water residue, maybe it was toothpaste film from some prior guest.  Whatever it was, I wasn't going to use the glass.  But I decided to take a picture of the crud for posterity, and then I set the glass back down next to the sink:

Bathroom Drinking Glass Jan 6

That, however was not the really gross part.  This morning I noticed that there were two "new" glasses, upside down, in the corner.  I decided to check if the new ones were any cleaner.  That's when I saw this:

Bathroom Drinking Glass Jan 7

Ewwwwww!  The same stain is still partially there.  But only partially.  And that's horrifying.  Because it means that housekeeping must have "washed out" the original glass, there in the bathroom, and then put it back.  And there is no scenario in which the person cleaning the bathroom also washing the glassware is a good thing.

When I checked out shortly after this, I spoke with a manager.  She said that the policy is that the glassware is replaced in the rooms if it has been used.  Clearly this isn't what happened.   She also suggested that perhaps this was two different glasses, but if you look at the shape of the blob in the upper left corner of both photos, it is clearly the same mark:

This original blob is clearly the same stain...

... as this one that had been partially washed off the next day.

Had I known that I would be doing "before and after" comparisons, I would have tried harder to get a better image for the original picture.  Nonetheless, I'm completely confident that this is evidence of a really disgusting housekeeping practices, at least between January 6 and 7 in my room, at the Venetian.