User Tools

Site Tools


dippy

Dippy

dippy (adjective): silly and eccentric or scatterbrained

The idea for Dippy originated on hackaday.io but now this is the main page.

Overview

A really wacky computer built using DIP switches for ROM, a few shift registers, no RAM, running a Forth-like instruction set and having a minimal transistor count.

Q: Why DIP switches for ROM? A: So that you can visibly see all of the instructions. There will be one LED per bank of DIP switches so that you can see which one is being read and the instruction bus will also have LEDs on it so that you can see that the values on the switch have made it to the processor.

Q: Why shift registers? A: To keep the component count down - registers/RAM and ALU are most of the count for a PISC 16 bit processor. Ideally the shift registers would be physical, needing components only to read or write, more on this below.

Q: Why no RAM? A: The idea is that the shift registers have enough storage to run really basic programs. External RAM violates the completeness of the solution and it wouldn't be visible.

Q: Why Forth-like instruction set? Because it is compact, I've got to squeeeze in as much as possible here.

Q: Why minimal transistor count? A: Partly because of the challange, partly because it is easier for others to replicate and build on this work but mostly because I'm terrible at soldering so unless it's minimial it will never get finished.

Rough specs

10 bit instructions in a 9 bit read-only address space built from 512 10-way dip switches (e.g. eBay).

16 shift registers, holding at least 16 bits each, hopefully 32 bits. These form an ascending Forth data stack and a descending Forth address stack (even though addresses are 10 bits). Two 4 bit registers act as the data and address stack pointers. If not physical shift registers but four components per memory cell (may be 5), then 16 registers at 16 bits would be 1024 components (512 transistors). At 32 bits per register that would be 2048 components (1024 transistors).

DIP switch ROM

The goal is a reasonably inexpensive program storage where it is clear how it operates.

A simple (linear) design would take the 9 bit address bus and invert each line to give 18 signals. Any and all addresses can now be decoded using 9 diodes and one transistor per address. Each diode is wired to either the corresponding data line or its inverse, so that current flows in all cases except the required address. This then feeds a transistor whose output is high when the required address is present. A LED can be used as the load so that there is a visual indication of the address used. The output feeds all the top pins of the DIP switches via diodes, with all lower pins connected to the instruction bus. There's a huge number of DIP switches and an enoumous number of diodes…

An improved design would first get rid of all of the diodes to the instruction bus, then work on better decoding.

Shift Registers

I'd really like the registers to be 32 bits as, unusually, with shift registers the component count is independent of the register size, i.e. the register bits come for free (okay, that's assuming no acoustic dissipation and even then the instruction clock does run proportionally slower)

I'd also like to see all the bits. This is difficult with most hardware shift registers. One solution might be to take the input and power a scanning laser, the persistance of vision may show all the bits.

Also ideally it would have a variable clock rate between one cycle every few seconds (so that you can see exactly how everything works) up to hundreds of kiloHertz (the max switching speed of the transistors).

Instruction set

b10 b9 b8-b6 b5-b1
0 0 JSR to 9 bit address ending in 0
0 1 LOAD - 8 bit immediate load
1 0 condition branch relative: -16 to +15
1 1 condition basic instruction (5 bit)

If top two bits are clear, then JSR to the remaining address (even addresses only). Thus this is subroutine linked Forth but without the overhead of the JSR instruction.

If next bit clear, load immediate the lower 8 bits (possibly sign extended - TBD)

Everything else is 3 bit conditional (1, lt0, le0, eq0, ne0, ge0, gt0, 0). Half of the space is for relative branching, of 5 bits (-16 to +15). The remaining is the basic instruction space:

  • IN input to top of stack
  • OUT output top of stack
  • RET return from JSR
  • NOT bitwise invert top of data stack
  • INC increment the value at the top of the data stack
  • DEC decrement the value at the top of the data stack
  • DROP decrement data pointer
  • SWAP swap top two items on data stack