Chapter A1: Introduction

Caveat Lector
Please be aware these are glorified notes. At no point do they reflect the current state of the project, and expect to find inaccuracies and errors.

A1.1. What Is The CFT?

The CFT is my project to designed and build a 1960s style mini-computer from first principles. I've designed and built the instruction set, data path, processor, computer, software stack, cross-assembler, emulator, software toolchain and even some of the software and hardware tools needed to do this.

It was designed for incremental upgrades: the initial version is nothing but a front panel, a processor and some memory. I have designed more peripherals to add features to the computer. Assuming I get the chance and time to build them all, the CFT will eventually have a floppy and hard disk interface, graphics, sound and maybe some basic networking.

All of this is built on a number of printed circuit boards using hundreds of discrete logic chips on a number of printed circuit boards. I've had some boards fabricated to keep things neat, but many, including the memory board and front panel are hand-wired with thousands of wires.

Since a lot of my life is spent on the move, and I want to be able to work on the CFT when I'm not at home, I've built a number of emulators for the hardware: from early attempts to test out the instruction set, to a full emulator for development, and even an emulator you can run on your browser right now.

There are is also a cross-assembler so I can write programs for the CFT, as well as a (yet immature) implementation of Forth, which will be used as the operating system on the computer itself.

Since this document doesn't change much, please see the project log for up-to-date information. That one is updated every time I do anything on the project. And yes, there are long periods of inactivity.

For out of date images and videos, you could also check out all the photos and screenshots on Flickr, or visit the Facebook CFT 16-bit Mini-Computer page (caution! Links contain social media). All of those were made when I was under the misunderstanding that people might be interested in this, but I don't really update them anymore.

Here's a YouTube video from the same era. It shows the processor executing its first program, still without a case, and with the front panel modules mounted on cardboard.

A1.2. The Game of the Name

CFT stands for ‘Copious Free Time’ because that's when this project is happening, NGW ‘Never Gonna Work’ wasn't catchy enough, and all the good names involving ‘magic’ and ‘mess’ were already taken.

A1.3. The Metagame: Why Make a Computer from Scratch?

Like many people these days, even my hardware work has moved to virtual machines, and even my data centre work is mostly remote. And even before that, I didn't buildanything. This is a way to work with my hands and produce something I can touch and people can understand. Okay, experience has shown that people don't understand, but you get the point.

Back in my pre-teens, I came across a book on digital electronics. I didn't understand enough of it (it turned out it was a collection of university-level notes — so I still don't understand enough) but it led to my wanting to design a fantasy 6502 micro undoing all the limitations of my own Oric Atmos. Understandably, all my designs had decent peripheral storage, good graphics and more than 48 KB of RAM. Funny that, the CFT has all three. I still have some of the schematics from back then. I couldn't afford to build it of course, and couldn't even source the parts. Not everyone had the good fortune to live a stone's throw from Silicon Valley.

Making a processor (and a computer) from scratch is a way to ‘touch the magic’, to quote Bill Buzzbee. Turing Completeness transforms a clump of sequential logic into a device that can calculate anything that's calculable. It's the difference between a digital alarm clock and playing Colossal Cave Adventure — no, writing Colossal Cave Adventure.

Counter to this, it's also a way to realise ‘there is no magic’, to quote Steve Furber on designing the ARM CPU. You don't need to weave magic to design and a processor. With sufficient patience and false starts, even I can do it.

It's a way to regress to those cute, friendly, limited architectures of the Sixties, Seventies and Eighties: back when you didn't need to read 716 pages just to program a RISC CPU, and a couple of hours of BASIC programming gave you something amazing.

It's a creative way to spend some time and everyone needs a hobby. Doing both the design and implementation gives me something to do when I'm at home, and also when I'm away!

I get to make up lots of TLAs and confuse you all.

It's my very own bad coping mechanism and a way to convince myself I'm not completely worthless. My standards are low, of course. Who in their right mind would consider a 16-bit, 4 MHz, 2 MWord computer in 2018 a worthwhile undertaking? It won't run Crysis, after all.

A1.4. People Who Did It Better

So I have a pretty unusual project. Nobody out there to inspire me, right? Wrong. If the CFT Project has anything to brag about, it's that it's the most vapourware home-designed processor project out there. You want people who did it better? I have people who did it better. Here are some!

  • Right about everyone making a computer before 1971 did it better. And there were plenty of people!

  • John V. Blankenbaker did it famously better, and with great style, and did it 49 years ago. Check out his Kenbak-1. In comparison, given the tools we have today, the CFT is a walk in the park.

  • John Doran did it better. See his D16/M. His machine's innards are a thing of beauty. And that front panel!

  • Bill Buzbee did it better. See his Magic-1. His computer is beautiful, inside and out, and has a beautiful instruction set. It's also online (or used to be) and you can access it from the Internet!

  • Steve Chamberlin did it better. See his Big Mess of Wires, a fantastic retro home micro with graphics and BASIC and stuff!

  • Dennis Kuschel did it better. See his MyCPU. His documentation is so good you can build your own MyCPU—and people have done just that. The sub-rack Eurocard form-factor was crucial in the design of the CFT.

  • Anyone qualifying for inclusion in the Homebrew CPU ring. The CFT doesn't qualify yet. Hopefully it will one day. Until then, you guys have my respect and admiration.

So yes, the CFT is a badly designed mess. But it's my badly designed mess, and I never claimed I'm a genius or even good at this stuff! Besides, it really shouldn't matter.

A1.5. What the CFT Is Not

The CFT is not a commercial project. Seriously, who'd want this?

The CFT is not an emulated fantasy computer. The aim is hardware. The emulators just help me carry the computer around with me when I'm not home.

The CFT is not meant to be a good computer.

The CFT is not meant to be a fast computer.

The CFT is not meant to be an elegant design.

For home-made computers you can buy, or are good, or nice to look at, or fast, or sport an elegant design, please refer to the amazing people listed in the previous section.

The only thing the CFT is meant to do is work. Sparks might fly, but as long as it calculates pi, or lists prime numbers, or animates Nyan Cat, I'm happy. Especially if it animates Nyan Cat.

A1.6. Aim of The CFT Book

The CFT Book has two aims: one is to document the CFT project in detail, both for ‘historical’ (age, not quality) reasons, and because of my uncontrollable academic urge to document his work with reproducibility in mind.

The other is to codify my own past notes because I sometimes don't work on the project for months.

A1.7. Hardware Features at a Glance

Except these to change a bit as the project progresses.

A1.7.1. Processor

  • 18 operation instruction set inspired by the PDP-8's, including two composite, bitmap instructions.
  • 16-bit word width without byte access—mini-computer style!
  • All instructions are exactly 16 bits in width.
  • Von Neumann (store program) architecture.
  • Accumulator-Based design.
  • 65,536 word address space.
  • Separate, 65,535 word 16-bit I/O address space. (the lower 1,024 words are easier to access)
  • Fully static design. The clock can vary or stop entirely.
  • Partially horizontal microcoded design with vertical fields used as failsafe devices to avoid bus contention.
  • The instruction set may be expanded using add-on peripherals or updating microcode.
  • Peripherals blur the line between processor and computer. Mini-computer style, again.

A1.7.2. Computer and Peripherals

In the style of the classic minis, most peripherals are clever peripherals to minimise the complexity of working with them from the processor. From lowly UARTs to the VDU card, the aim is for the device to appear as an instruction set extension. If it forces us to bang bits in CFT machine code, it's not smart enough. Here are the features and peripherals, most of which are still vapourware!

  • Eurocard-based backplane design in the style of the Microtan 65.
  • Mini-style case in the style of the D16/M—except not as clean or nice!
  • Banked Memory interface for up to 2 MW of memory. (this is now part of the processor)
  • Memory cards of 512 kW RAM/ROM. The MEM board contains 1,024 kW RAM and 512 kW ROM (three banks).
  • Programmer’s front panel. Provides lights to indicate the processor and computer’s state at the microcode level and above, as well as switches to provide input and modify state.
  • Debugging and testing card. It automates testing and can act as a simple data collector or logic analyser. It can also test peripherals on its own, with the rest of the computer pulled from the backplane. (update: this has been merged with the control panel)
  • Interrupt controller with 8 interrupt lines.
  • Two to four UART card, including a TTL serial port.
  • Three or six programmable timer card.
  • Real time clock and NVRAM.
  • Two or four IDE disk cards.
  • Floppy controller including an 8-inch floppy port for older drives.
  • Stackable smart VDU board with up to 80×30 text and up to 640×480 graphics. Includes PS/2 and/or Sun keyboard interface. (I have lots of Sun keyboards, and they're simpler to use than PS/2).
  • Sound card with speech synthesis.
  • I/O board with cassette interface, user I/O, and joystick interface. (because why not?)
  • Ethernet card using a smart MII.

A1.8. Software

Part of the project is writing software! Some of this software runs on-board, but so far most is used on my modern computer for development reasons.

Modern, off-board software includes:

  • The FlashProg firmware.
  • The FlashProg Python interface code.
  • The mcasm microcode compiler.
  • The ROMtools Python module that helps prepare ALU tables.
  • The cftasm cross-assembler written in Python. Now a very capable piece of software with support for aliases, macros, namespaces, and map files (for debugging on, e.g. the emulator).
  • Verilog models of the processor and computer.
  • An early Python emulator for the instruction set.
  • A C microcode-level emulator with support for all the peripherals. This is where I do all my testing.
  • A JavaScript microcode-level emulator you can see for yourself.
  • A test framework for the processor and computer that interfaces to Verilog simulators, the C emulator, and the actual hardware via the debugging board. This can verify the computer and peripherals at all levels, with tests written in Python.
  • A shockingly slow CRT emulator that helped me fine-tune the VDU card state machine on the road.
  • A CFT filesystem emulator/tool to create and populate filesystems on the PC for data transfer.
  • Dozens of scripts to convert Assembler to documentation, create graphics, and the like.

Software and features of the software that run on the computer:

  • The Debugging Board firmware, written in C targeting the Atmega architecture. This acts as a three-way bridge between the CFT, its front panel, and a controlling computer that can drive both for testing purposes.
  • Forth in ROM is used as the programming language.
  • The same Forth interpreter is used as the operating system.
  • The CFT Filesystem (based on Apple's ProDOS filesystem) organises data into files.
  • Disk partition tables and ROMs are abstracted into ‘programs’ to allow for a ROM boot menu.
  • The VDU configuration file, written in Verilog targeting the VDU board's CPLD chip.
  • The boot ROM supports ‘year modes’: a fully configured CFT can boot into something that resembles a 1965-style mini with no ROM, a 1970s S100 computer, a 1980s home micro, or a 1990s computer with network support. These are selected from the front panel at boot time.