Saturday, November 23, 2024

A Four-Digit Word for Fool

 A Four-Digit Word for Fool

By Bobby Neal Winters

Think about the first calculator you owned or your first LED watch, if you had one.  The symbols it used were displayed on a seven-segment LED.  These are somewhat misnamed. They have eight segments, not seven. One of the “segments” is not geometrically a segment; it’s a decimal point.

But the geometrical segments are the important part.  There are two vertical segments on the left; two vertical segments on the right; three horizontal segments up the middle.  Two plus two plus three equals seven, and you don’t even need an electronic calculator for that.

These LEDs are limited as to the symbols they can display. You can do the decimal digits: 0, 1, 2,..., 8, 9.  You have to have those for arithmetic.  You can also do: A, b, C, d, E, and F.  These are important to machine-level programmers who work in hexadecimal, i.e. base 16, arithmetic.  But there are constraints.  Note that even in getting all of the extra hexadecimal digits, I had to go lowercase for b and d.

Such is the skill of the brain of interpreting and reinterpreting that there were games played by nerds back in the 70s in making calculators spell words like bOObIES.

And nerds we were, but rest assured I never used my intelligence for anything that salacious. 

Since the first half of the year, I’ve been devoting a large chunk of my time to learning the details of the Atmega328P microcontroller. I’ve learned enough to add it to the list of things I can be a bore on. (That list is published in three volumes, and each volume is as thick as the Oxford English Dictionary.)

Given that this chip is smaller than a kidney bean, there is a surprising amount written on it.  The basic resources I’ve been using consist of a pair of 250-page technical documents.  Think of the style of writing in these documents being like the IKEA instructions for putting together the Roswell Probe, but without as many helpful pictures.

I’ve done this project in order to teach a class. And it is going to be a good class. But my idea of what I am going to do has changed tremendously as a result of my own learning experience. 

Tremendously.  I didn’t choose that word lightly.

A device like this--and indeed any computer-like device--does three things: it takes in data; it processes that data; it then displays its results. We can call that Input, Process, and Output. 

Of these three parts, we usually spend most of the time on the middle part, Process. This is not because it is so hard, but rather the reverse.  The remainder, Input/Output, is so hard that it has been done for us by others. It has been dealt with and put to the side so that most people can concentrate on the process part.

The thing is that someone has to think about Input/Output. Someone has to work out those details to make it easier for everyone else.

Last night I was at a Computer Science Club meeting. (It was at 6pm on the Friday night before Thanksgiving break; that is hardcore.) Two of the students who presented did so on computer mice they had made and programmed in one of their EET classes. They were amazing.

Computer mice represent input.

For my part, I’ve been working on writing to the seven-segment LED I mentioned at the beginning of this column.  The hardware I am working with (a Freenove project board for those of you who are interested) has a four-digit seven-segment LED.  This will let me display a decimal number between 0 and 9,999. If I use hexadecimal, I can get any number between 0 and 65,535, but only a nerd could read it. 

By the end of September--just before I left for Paraguay--I’d managed to write a program that would output to that four-digit display.  The problem was that I could no longer find anything in that program. It had grown organically as I was in the process of learning what I was doing, and it had gotten away from me.

Since that point, I’ve been going back over the code and basically rewriting it from scratch.

Last night, before the CS Club members gave their presentations, I went in and fiddled with my program just a little.  I’d been having trouble getting it to act predictably, but I had an insight and fixed something. 

I put in my code, pressed run, and there came my output in four seven-segment digits: bOOb.  While this has a salacious interpretation, I mean it as a description of someone who enjoys solving this sort of puzzle as much as I do.

Bobby Winters, a native of Harden City, Oklahoma, blogs at redneckmath.blogspot.com and okieinexile.blogspot.com. He invites you to “like” the National Association of Lawn Mowers on Facebook. Search for him by name on YouTube.


No comments: