Tuesday, May 30, 2017

TTL Brainfuck Computer Part 4 - Animate Objects

Part 1 (first) - Part 3 (prev) - Part 5 (next)

To breathe life into my CPU, it needs a heartbeat. I put together a simple 555 astable circuit with a 10k potentiometer to adjust the clock speed. I'm still waiting on some switches to put in a manual clock mode.

Since the counter control signals need to be synchronized with the clock, I added a 74LS00 (quad 2-input NAND) to combine the signals. This provides the high signal by default to disable count/load, and only activates (goes low) when both the clock and control signals go high. This "uninverts" the logic of the control signals and confuses me a couple times in the following video:

You'll notice a couple extra jumpers connecting the ground lines on the data register. I'm starting to have some really frustrating issues with these crappy breadboards. Replacements should be here tomorrow.

The LED boards are made from some breadboard-style PCB that came with one of the Elegoo kits. I trimmed the plastic lip with wire nippers so they'd fit snugly. I alternated their orientations so cathode is next to cathode, anode next to anode. Then I put resistors on the underside of the board between the cathodes and the power rail of the PCB. I chopped off the cathode leads, and added a ground connection to the new common cathode. Having 2 anodes side by side with 2 blank spaces between fits perfectly in the outputs of the 193s, and only needs a small bit of bending to fit into the data bus.

I've got a 16-bit one for the data pointer but still need to dremel it down to size.

Part 1 (first) - Part 3 (prev) - Part 5 (next)


  1. I really like how you've got buttons to increment/decrement your memory address. Can you explain how you implemented this? Thanks!

    1. The increment and decrement is built into the 74LS193 counters I'm using to store the address. The buttons are just connected to the count up & count down pins of the low order chip. There are pull-up resistors connecting the pins to Vcc, and the buttons pull it to ground.

    2. So just to be clear, you are using the 74193 in place of the 74173's that Ben Eater is using in his MAR? From my admittedly poor reading of the respective datasheets, it seems the 193 simply adds counting capabilities to the 173? The only other difference seems to be the pin out placement and the tri-state logic (which if I recall is not being used a year?)

      A perhaps related question, how did become aware of this alternative? I'm looking at https://en.m.wikipedia.org/wiki/List_of_7400_series_integrated_circuits but the list is way too long to get through all of those datasheets.

    3. Yes, the Data Pointer is equivalent to Ben's Memory Address Register. Since Brainfuck's only memory addressing operation is to move forwards or backwards through RAM, the built-in counting is all I really need for the Data Pointer; it never needs to load from an address directly.

      The Data Register and Stack Pointer are also built from the same chips and they'll actually use the load pins.

      When I first started thinking about this computer, I had considered building different pieces with different levels of integration; e.g. the data register could be made from flip-flops and custom adder logic rather than the 74LS193. I may still go that route but I just want to keep things simple at first.

      So I ordered a kit with a bunch of different LS series chips in it, and it had 10 of the 193s. I put together a list of all the chips in the kit (and some others I had picked up through the years) and googled them all to find out what they were. The 193 is called a Binary Up/Down counter which sounded exactly like what I needed.