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,...
Thoughts and suggestions - no guarantees ;-)
"Clock does not have a fast enough slew rate" - use a schmitt trigger buffer? Especially as you mention "using a Resistor/capacitor" to decouple".
"Control logic EEPROM 4 outputs high on each bit" - sounds like somewhere you have parallel wired another output. If you disconnect the EEPROM are the lines still high (enough to llight a LED)?
"Rough control signals ... modules to not perform correctly" - You may have race conditions, ie some signal needs to arrive simultaneously with another, but one of them is transient.
"Adding a 10nF capacitor to controlines ... somewhat helps" - reinforces my racecondition suspicion. It would slow down the signal. It also stresses the chips, as they have to supply/sink lots of current at the transition (no resistor to limit current).
"LEDs are far too bright" - have you measured voltage? They may pull down your logic high to a few volts - still enough to be a high ... some of the time. I'd buffer them (ie use a on lines where the fanout is more than 1, or at least on the bus (I have on my project)