coobird.net icon

projects.coobird.net

projects.coobird.net - Building a Processor

Learning to Build a Processor

Image of a circuit on breadboard with lots of wires

Why?

For a long time I've been interested in computers. I played around with programming and built simple circuits using microcontrollers. The last couple of years, I've became interested in building my own processor after seeing other people build their own computers out of logic ICs. Particularly inspiring were Bill Buzbee's Magic-1 and Donn Stewart's Home-built TTL CPU.

Never having any formal training nor education in electronics, I find it an interesting challenge to try to build my own processor, not only because it would be "cool" but also it would be an interesting to write programs for an platform that I designed. Although I've been programming for years, I've never actually done any low-level programming, so this will be a chance for me to get some experience. Also, since I'm the one designing the hardware and instruction set architecture, I'll be able to include features that I know I'll be able to utilize and exclude elements that I probably won't need. For example, I'd like to have hardware features to ease jumping around in the program, but I won't need interrupts as I'm expecting to have dip switches and LEDs for input and output.

Design Goals

The main goal of building the computer is to have it be able to do something a little more than just add numbers. I would say the first milestone will be to implement integer division by software.

For the sake of simplicity of building the computer, I will be building the computer on a solderless breadboard for the moment. I'll be using 74LS series logic ICs as they are used in other homemade computer projects and also because TTL devices tolerate static electricity better than CMOS devices. Since I live in Southern California, I'd like to use components that are less likely to get zapped.

Limitations

As I am still learning to play with electronics and never really studied computer architecture, I am going to build a computer that won't have all the fancy features that would be usually found in other microprocessors or minicomputers.

The computer will be built on a breadboard, so space will be limited. I won't be able to build a processor with 16-bit data and address bus like I'd like, but probably will be limited to 8-bits.

Progress

To date, I've been able to make a circuit which can add and subtract 7-bit values from an 8-bit accumulator. There are two "instructions," addition and subtraction. A clock pulse generated from a button can be used to execute an instruction, or pulses generated from a 555 timer can be used as well.

Two MPEG-1 videos of the circuit in action is available. The first video (9.7 MB) shows the instructions being selected using the rotary switches and executed via a push button.

The second video (6.0 MB) shows the circuit running off of the 555 timer which is creating pulses at around 200 Hz. (You'll notice that the accumulator status LEDs at the bottom right is brighter in the second video because I changed the resistor network which it is connected to.)

Overview

To the left is a picture of the breadboard hosting the current circuit. In the top row of the breadboard, from left to right, there's a voltage regulator that is bringing the positive line to 5 volts (the multimeter tells me that it's actually around 4.5 volts, but the circuit is working so I'm in no mood of working with it. Also, I shouldn't dismiss the fact my power supply is an ATX power supply that "died" for all intents and purposes for using it as a PC power supply) followed by a 555 timer. To the right is two hexadecimal rotary switches used to specify the instruction, along with a resistor network connected instruction status LEDs. Finally, there's a tiny push button switch to generate a clock pulse.

The second row is a pair of pairs. The pair consists of a 4-bit adder and a quad XOR gate to aid in the 2's compliment subtraction. The pair on the left is for the high-order 4 bits and the one on the right is for the lower-order. To the right of that is a 8-bit register (an octal D flip-flop) used to hold the instruction. The clock pulse from the switch or the 555 timer is used to store the instruction into the register. The brown resistor network at the end is the pull-up resistors used for the rotary switches.

Finally in the third row, another 8-bit register is the accumulator, and to the right of it is the resistor network connected to the LED accumulator state indicator. At the far right is a hex buffer that (I believe) is used in delaying the clock pulse to allow storage of the result of the instruction into the accumulator on the same clock pulse as the one used to store the instuction into the instuction register. I may later find out (if I ramp up the clock rate) that using a hex buffer to create a delay may not be a good idea, but that's a problem to solve for the future if I continue to go with this approach.

One of the things in the to-do list is to add an register to hold the carry status which is routed out of the high-order 4-bit adder to the LED indicator at the bottom. As the carry is used as both the plus/minus sign for subtraction operation and the carry flag for the addition operation, so a distinction needs to be made on the meaning of the carry status.

For progress up to this point, read the building the adder.

Specifications

In designing this processor, there is no set specifications. It is a project that is being build in the "as-you-go" style, where components that would go into the processor is being added piecemeal.

However, there is a rough specification/wishlist of features to be included in the processor.

Read the rough specification >

Status

As of January 2008, this project is on hold.