This has been an ongoing project for over a year before being added here, so in addition to the overall design here, I will merge everything done so far into a the first log rather than trying to separate everything as it happened.
Several years ago, there was a number of very interesting tutorial on making an 8-bit computer in breadboards produced by Ben Eater. While I had done some electronics before (mostly for school), this was my first large scale project which. With the help of these tutorials I was able to build it myself:
This computer uses 74LSxx chips for almost everything, with the exception being 555 timers for clocks, and AT28C16 EEPROMs as configurable logic to prevent some parts getting way to large. While I could get it running, it only has 16 bytes of memory, and to program it you need to set each byte individually. This firstly isn't much memory to do anything in, and secondly doesn't scale well even with an expanded memory. It also wasn't exactly my project as I had just followed a tutorial. As such I decided to build my own better, bigger, and as it turns out very troublesome version. There where several design considerations I set as rules:
- The computer would use a 16-bit word
- The computer would mostly use 74LSxx chips
- I was allowed to use more complicated chips for RAM and again use EEPROMs for configurable logic where size would get out of hand
- Use PCBs rather than breadboards to make it a bit more permanent
- Be able to store a program in EEPROM chips rather than enter it manually
- Have as much RAM as is feasible for the word size (64K words)
- Be able to add new modules for future expansion
- Keep the same rough design as the Ben Eater computer
- LEDs, lots of LEDs
The computer has this overall design:
- Clock: Synchronize the computer with both variable frequency free run and single step modes
- Program Counter (PC): Stores the address of the current instruction
- Memory Address (MAR): Stores the address of the value to fetch from RAM
- RAM: Stores all variable data during runtime
- A Register: Stores the current working value, and result from ALU
- B Register: Stores secondary value for ALU to perform calculation
- ALU: Performs some calculations using A and B registers, must at least to addition and subtraction
- X Register: Index register which can be incremented using a single instruction without affecting A register
- Program Memory Address (PMAR): Stores the address of the value to fetch from program memory
- Program Memory: Stores the program in EEPROM
- Output Register: Stores a value to be displayed
- Output Display: Displays 16-bit value as decimal
- Input Register: Allows user input of some form, should allow for both wait for input and read current value
- Current Instruction Register (IR): Stores the current instruction being used, must be 16 bits plus the opcode size (likely just use 2 word register)
- Control Logic: Decodes what is in IR to generate control signals for the rest of the computer, also handles flags and reset
ToDo: Write about choice of RAM and EEPROM, and some other design stuff (either here of in log)
With everything designed the full computer looks like this:
Unfortunately the computer isn't fully functioning. All separate modules have been tested, however the complete thing does not operate correctly. There are several problems to solve:
- Clock does not have a fast enough slew rate to function with 74LSxx logic.
- This has temporarily been replaced with the clock from the original Ben Eater computer.
- Control logic EEPROM 4 outputs high on each bit, regardless of being programed (and checked) to be all 0x00. This isn't really a problem as it is an extension to the control word and non of the bits are being used.
- Rough control signals are being generated. This causes modules to not perform correctly, mostly reading values whenever another register reads. THIS IS THE MAIN PROBLEM TO DEAL WITH
- It seems adding a 10nF capacitor to ground on the control lines somewhat helps with some modules. This has not been tested for all affected control lines, and doesn't completely remove the problem.
Based on how far I have got so far there are a number of changes to the design which would have greatly improved it (but aren't required for "completion"):
- 74LSxx chips are not really ideal for such a large computer, really I should have used some other version of 74xx (probably a CMOS version)
- LEDs are far too bright, I can change this but it requires re-soldering several hundred resistors
- Some other connection method between modules, currently they are quite messy and prone to issues
- Could consider using surface mounted components (and higher layer count PCBs) to reduce overall size
- Likely a number of other things