Tic-Tac-Toe, In TTL

We’ll all be familiar with Tic-Tac-Toe, or Noughts and Crosses, a childhood pencil-and-paper diversion which has formed the basis of many a coding exercise. It’s an easy enough task to implement in software, but how many of us have seen it done in hardware alone? That’s just what [Warren Toomey] has done using TTL chips, and his method makes for a surprisingly simple circuit.

At its heart is an 8 kB ROM that contains precomputed move sequences that are selected via an address composed of the game states for both player and machine. A series of flip-flops control and buttons to make the board, and a 555 provides a clock.

The technique of using a ROM to replace complex logic is a very powerful one that is facilitated by the low price of relatively large devices that would once have been unaffordable. We’ve seen the technique used elsewhere, including as an ALU in a TTL CPU, and even for an entire CPU in its own right.

You can see the result in operation in the video below the break, and should you wish to have a go for yourself all the relevant information can be found in a GitHub repository.

15 thoughts on “Tic-Tac-Toe, In TTL

  1. When I was a kid Bell had donated a tic tac toe game to a science museum. It was behind a see through panel so you could see it work, and it was implemented with relays. That was neat.

  2. Back in the 1970s, Chicago’s Museum of Science and Industry had a relay-based TTL computer — it made a strong impression on me. In 8th grade I tried working out how to do it in TTL, but not being that smart yet, I simply had combinational logic for everything. The circuit just had tons of “If this bit and this bit and not this bit then make this move” or “if … game won”. It was way way more expensive than I could contemplate actually trying to build.

    The next year I started high school and they had a Wang 2200 computer that students could use. After reading the BASIC language manual, I took a quiz to prove to the teacher I was ready to use this rare resource. My first program was something on the order of 10 lines, just to prove to myself I understood things. My second program was tic-tac-toe. I wasn’t sophisticated enough to appreciate how to use arrays, or how to iterate and use reflections and such to simplify the code, so the code was hundreds of lines of “IF A[0]=1 AND A[1]=1 AND A[2]=0 THEN A[2]=-1” (if the first two squares are white and the 3rd one is empty, make it black). It took a month or so of learning before I figured out how to do it properly.

    1. Oops, that first line has a confusing think-o. It should have read:

      Back in the 1970s, Chicago’s Museum of Science and Industry had a relay-based tic-tac-toe computer

  3. I’m guessing Warren visited the old Tech Museum in Ultimo, Sydney back in the early 70s and played with the Noughts and Crosses machine there. It was about 1 cu ft, had a 3×3 matrix push panel for the display and the case was perspex so you could see all the transistor (yes it was AFAIK just transistors) circuit boards through the case. I thought it was the best thing there. Second best was a green electroluminescent panel that would light up when a button was pressed. I wanted that so badly…

    1. You are thinking of the “Museum of Arts and Sciences” which was in Harris Street (with the full-sized LEM model out the front, now part of the TAFE campus), which became the god-awful Powerhouse Museum. And now they’ve renamed it back to the Museum of Arts and Sciences, but it’s still run by the design mafia who have zero interest in technology except the “aesthetic design” of the enclosure it comes in.


      The machine was on the first level, at the southwestern end of the building near the planetarium.

      The original machine has a collection entry here:


      It’s a terrible old picture, but you can see some detail in this entry, as the machine is on the right in the photograph:


      You can make out the oh-so-60’s PCB and obviously hand-assembled wiring.

      Internally it had a bunch of what I always assumed were SSI gates in multi-lead transistor-style boxes. I’m guessing they wired hard logic to play the game. The manufacturer was EMI Australia in the mid-60’s. I’m going to guess it’s DTL, with a single gate per package (I can’t even find a reference to what that package style is called!), although it’s also possible that they’re actually not ICs at all but hybrid modules.

      Anyway, I would be very surprised if this machine still worked (last time I saw it on display, it wasn’t running). The chance of getting replacement components would be close to zero.

      BTW, the machine cheated. There was some randomness in its response, and if you were able to select the opposing corners in the first two moves without it blocking you, then it was in a no-win situation. This would cause it to make two moves in one go, because it seemed to be only designed to win or draw. Never to lose.

      1. Thanks Ian, that’s it! Seems the actual dimensions are smaller than what I remember it to be, but that’s the way when you see stuff as a child. I did not realise it used early ICs, and you are probably right about the DTL.
        I only ever heard the museum referred to as ‘the tech museum’ as the actual name is a bit more wordy.
        (I’m guessing you are perhaps the Ian Farqhar I knew in Sydney years ago)

        1. When I was a kid I was the president of the Astronomy Association (the “Museum of Applied Arts and Sciences Astronomy Association”, or MAASAA – how’s THAT for wordy?) So I knew the museum quite well. But MAASAA was one of the first victims of the move to the Powerhouse, and the diminution of technology and science in favor of “design” and “art”.

          Real story to illustrate the stupidity: I had a Cray Y-MP/EL92 which I could no longer house at home. Historically significant system, as it had formerly been owned by the company which did the CFD software which designed so many plastic molds, most notably for Apple. I called the Powerhouse and offered it to them, saying I had a Cray I wanted to donate. “We already have DSD’s old Cray”. I explained this was a deskside supercomputer, not an empty X/MP shell without any circuitry. Zero interest. I explained the system’s history. Zero interest. All he – the curator of computing – wanted to see was the chassis. I sent a picture of the chassis. “It has no design value,” he concluded, “so we’re not interested.”

          As for being that Ian Farquhar, I might be. There are a few of us around – both names are moderately common Scottish ones – and I went to school with another one to whom I am not related. So…. maybe.

          As for those ICs, I’m guessing they’d be from a British fab line. Australia did have a fab line in the 70s and 80s (that god-awful AWA one), but it mostly fab’d classified ASICs for Defence, DSTO and DSD. It would be really interesting to pull that machine – respectfully – apart and see inside.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.