 Displaying hex digits on a 7-segment display can be very useful. The ancients tended to count in octal, but today we typically count in hex because we have a plethora of bits, so displaying data in the modern mode is highly desirable. I have this chip here, which is a binary to 7-segment decoder chip. This other chip is just a 7493 counter to exercise the decoder. So, which 7400 series chip is the decoder? Trick question, there is no such thing as a 7400 series binary to 7-segment decoder chip. There is a DM9368 that does it, but you need to get that on eBay. So, what is this mystery chip? It's an AT-Tiny84 microcontroller, acting as a simple 16x7 ROM. They're much cheaper than a dedicated decoder chip, 80 cents each for one, or $1.19 and a dip package. The only downside is that they are slow compared to a dedicated chip, but if you don't need the speed, these are great. An AT-Tiny84 has 12 IO pins, which is enough for a decoder having 4 inputs and 7 outputs. So, I quickly wrote an assembly language program to read the input pins, look up the corresponding output pattern, and write that to the output pins in a loop. Here's the program. I added copious documentation on how to compile it and use the chip. Unfortunately, I don't go into detail about how to program the chip. There are lots of ways to program a device, and most of them are very fiddly and the instructions are highly dependent on the operating system, version, type of cables, and voltage. The best way is simply to get a dedicated device programmer and not waste your time. Take a look at OpenProg if you wish to build your own, link down below. Or try the MiniPro programmer, which I used, link also down below. Anyway, the program starts by disabling the watchdog timer. This is the thing that will reset the processor if it doesn't get touched within a certain period of time. It's to prevent the processor from hanging. I don't anticipate this happening because all my programs are perfect, so I just turn it off. Next, I disable all pull-ups on input pins. I don't want to add a load to the signals being monitored, although this does mean that the display will probably be random if there is no signal. In this next part, I couldn't help but add a non-standard feature. I actually read from one of the output pins to determine whether the LED connected to it is common cathode or common anode. The ROM effectively inverts its output if necessary, so you can use either common cathode or common anode displays with this thing. Next, I set pin directions. I'm using four pins on port A as the input and the other four pins on port A and three pins on port B as the output. I wanted to read all four digital inputs at the same time, which you can only do if the inputs are on the same port. Since port B only has three usable pins available, the fourth being dedicated to the reset signal, I had to use port A. Then comes the loop. Read the inputs on port A, look up what we should output in the table below, and output on port A and B. That's it. This instruction is where I invert the outputs if we detected that it was necessary from the earlier LED probe. So, we just hook it up and it looks like a 16x7 ROM. The loop is 15 clock cycles long. Without an external clock, the device uses its internal 8 MHz clock, and by default this is divided by 8 unless otherwise specified. That means the loop is 15 microseconds long, which is the effective read delay for this ROM. I could have sped this up by setting the clock division factor to 1 in the beginning, which would get us a read delay of 1 in 7 eighths microseconds. However, since this is a visual display, pretty much any delay up to 10,000 microseconds is acceptable, so I just didn't care. In the general ROM case, I might want to use a device with more available port pins, which would make the loop much tighter, since I wouldn't have to do all this swapping and anding. Anyway, the next step is to get a handful of AT tinies and put together a board with 4 7-segment displays so I can display a 16-bit number. That will enable me to display the address and data lines on the TMS99 CPU to see what's going on. Thanks for watching.