- BETA version - BETA version - BETA version -
What will you need:
- lots of electronics scrap (and/or: some money to buy new devices)
- thin copper wire (telephone wire). different color isolation recommended
- a 20x25cm (10x8inch) board
- some adhesive tape or glue of your choice
- wrench, tweezers, a soldering iron (solder wire), crocodile clip cables, a measuring instrument (optional) and some useful tools of your choice
- a computer
- some device to program array logic and PROM ICs.
- a book about computer architecture (i recommend keller-paul for german readers, dont know about translated versions)
- electric light highly recommended
- and last but not least some time to put it together
in advance...
first make sure to have the appropriate electronic components, proceeding is hardly possible without them. i got several (3/468) mainboards,
5~interface controllers (serial, parallel, ata), hard disk/tape/diskette drives, telephone switchboards and similar stuff from my old-computer-collection,
the neighborhood, some friends... wherever i looked for it. go for logic devices of the 74
LS/
HCT/
F series (for i wont contemplate speed-issues, i mixed them altogether). use 74LV(C) parts if you like
3.3V design leave out otherwise (as i did).
dont forget to put aside some (E)EPROMs and PALs/GALs. you will need these to build up control logics and program your 'computer'. dont miss
switches/buttons, schmitt triggers, resistors, capacitors (...and a 5VDC power supply). DIL-sockets, LEDs hopefully are self-evident though not essential. go
and buy any parts you didnt find (which can also be done in between, when actually needed or when someone asks you to participate in bulk buying). for
me these have been four ls181 (ALU) ICs and some (5-10) 16V8 GALs (from lattice semiconductor).
getting started
lets begin with a practice: build up a simple and slow clock generator.
this is quite straight forward, because the mm74c14 data sheet found googling includes a nifty sample
application,
which is exactly what you need. so find IC, several capacitors (1-100nF) and resistors (1-100kOhm), put it together, and find out which clock speed you like
best. dont forget the power supply at the upper right (VCC) and lower left (GND) pin. do not confuse orientation.
use a BC547 or similar transistor and an LED to make it visible (note that just connecting the LED to the clock output wont work!).
include a switch to deactivate the clock and a schmitt-triggered button to manually give clock signals. you will need them for debugging. the clock signal itself
should be rectangled by routing it through another schmitt trigger, otherwise it may lead to unwanted side effects.
to find out more about flipflops take a 74F74 (this could be 74LS74, 74HCT74, 74whatever74. for now lets call it "F"), download a datasheet (this should be
done implicitly from now on), connect your clock to the CK pin, loop Q to D and find out what (i.e. what exactly) it does and what
it does when using the /Q output. this is essential for building the phase signal generator later on.
the program counter
if you are a bit into computers, you might already know that every CPU contains a register which reflects the memory address of the next-to-execute command.
roughly speaking it will consist of 16 (yes we are building a 16bit CPU) D type latches and an incrementer. you will find 8 D-latches on a 74F374 IC,
which would yield two of them for a 16bit register. for the sake of it i took 8 74F74 ICs (2 FFs each). they additionaly offer a reset function that might be a
bit long winded to implement using 74F374 chips. take several OR, NAND, and XOR gates and implement a circuit that adds exactly one to a given 16bit binary
number represented by the voltage levels at the outputs of your flipflops (hint: use a carry chain adder diagram and cut out the 15 input lines and associated
gates you wont need (who needs 'gates' anyway *cough* )). this is what your incrementer may look like. put drivers between FFs and
incrementer to avoid too much fanout. dont connect the incrementer
outputs
directly to the inputs of the FFs, for you might want to read someting else
into them when jumping. take two 74LS244, put them in between, connect all /OE's to GND for now and make sure to have understood the concept and
function
of a bus. take some LEDs to visualize your register, use CK to increment, /R to reset.
if anything works - congratulations
the debug port[tm]
while building the first components of this cpu i noticed that i do not have as much LEDs and resistors to visualize every single bit on all of the buses or
latches. but maybe this could become essentially important if this pile of chips should ever do something comprehensible.
hence ive defined a simple standard implementation of a debug port: a 2x8 pin array laid out like the ones you might know from floppy or hd drives. pin
0 (the left
upper pin) is the least significant bit as one might expect. i chose pin 1 to be be the one below i.e. the upper right to be #8. that makes reading of binary
values much easier. you mileage may vary, but know what youre doing.
the debug port reader is easy to implement. take any connector that fits your 16 pins and add LEDs with adequate resistors. connect resistors to ground. pay
attention to LED orientation - and follow the lights.
(pictures coming soon)
the phase signal generation
...
the address bus and PROM
...
internal registers
not much to say about. just some 74F374 d-latches. use LOTS of 74F74 if you have them. 74F373 latches are easier to find (a), but notice that these will need an
external delay chain to CP, which will slow down everything. i went for 74F373 due to (a).
the ALU
buy four ls181 ics if you dont want to put it together manually. the easiest way to install them is to pile them one above another. solder power supply and
function/mode select pins to vertically aligned wires before you start attaching the bus wires. its best to connect the argument input pins to a distributor
installed
somwhat next to the ALU itself. this will reduce chaos and will make connections to all of the registers and bus drivers a bit more possible. for that purpose i
abused a 32 pin DIL socket into which i could easily plug in the pull down resistor arrays. depending on your bus stucture you might also
want those to spare another 32 0-drivers and related logics. the function output pins have to be connected to two drivers each. one to the address bus and one to
the internal data bus. i added another one to obtain a debug port with LED capable output power. the driver ICs (F244) can be mounted directly on top of the
ALU tower. this is easy to put into practice, for there's a lot of space left up there. this is what it might look like before actually
connecting adress and internal data bus.
okay i just noticed that i should have soldered the inputs after the outputs. that might have made sense, but choose your own poison *eg*.
control logics
now as you have lots of buses, drivers registers you may want to make it do something useful i.e. run a given program located on the installed PROM. to accomplish
this you want to implement functions for each signal with the current clock time and the given command as arguments. because i didnt want to re-implement the
whole world i decided to use pre-implemented programmable gate arrays. googling and asking friends may also lead you to the galblast project, which implements a
simple way to program GAL[tm]s (at least the 16 pin ones) using a parallel port and easy to build (pic0, pic1) no-cost
hardware. you will
remark that the galblast software unfortunately
is written for windoze platforms. it runs very well in a wine enviroment though (remember you have to be root to do real
mode
calls to your parport!). and dont forget adding the adresses of your port to the [ports] section (read and write) of your wine config file (note: the base address (e.g. 0x378) alone wont suffice, better try 0x378-0x388, which may be too much, but it works that way).
use galasm to convert your function description files to JEDEC fusemaps, which is
somehow the standard format for this purpose
and therefore used by galblast. ive written a simple .eqn file for the GAL that checks whether the ACC contains (only) zeroes. this is a
simple test application and exercise and additionaly essential for the jump controller to decide if a jmp eq is to be executed. note that the output of
this GAL is not directly related to a driver or a latch whatsoever. its just needed as input for some other GALs. for some cable length issues i chose
the location of this GAL directly on top of the accumulator as one might see on the overview picture (note the 'zero' labeled IC).
further on i made up some equations to represent the GAL functions to control the internal registers' CP and \OE
signals. the drivers to the ALUs left argument bus are controlled by these functions.
the full set of gal equations and possibly some more stuff is now (05.2004) available here.
about additional hardware
...
writing a simple program
...