Close

ALU and RegMem Completed - Demo Time!

A project log for The Spikeputor

I am building a computer featuring a 16-bit RISC CPU made of discrete transistors for learning, fun and art. It will be pretty large.

spudfishscottspudfishScott 03/02/2019 at 22:155 Comments

Two of the four major pegboards of the Spikeputor are now complete and have been mounted. They come down pretty easily in case repairs or modifications need to be made that can't be performed right on the wall.

Now that we have seven functioning registers and an ALU, we can put it through its paces by simulating the rest of the CPU. Wiring together the components along with an Arduino, the nascent CPU can be "programmed" by simply setting up the correct input signals after every rising clock pulse (also provided by the Arduino). 

Since there is no RAM yet, the only storage is in the registers. Nevertheless, you can easily set up the Arduino to do something like this:  

And voilá! Ghost In The Machine!

You can also set up a similar type of loop, except instead of shifting bits, you can add a constant. This video starts with adding 1 by setting the ALU A Input DIP switch to 0x0001, outputting the selected register to Channel B with write-back, and cycling for a number of clock cycles before moving on to the next register. It shows the whole CPU, then focuses on the ALU output, and then Register Output Channel B. The DIP switch is then changed to 0x0010 to increment the second digit (by adding 16), leaving the first digit intact.

Finally, for something a bit more advanced, we can manipulate the control signals to simulate a program to calculate the first 24 Fibonacci numbers (all of them that can fit in 16 bits). After each number, the control signals are set to place the step number on RegMem Output Channel A and the corresponding Fibonacci number on RegMem Output Channel B, then pause before calculating the next one. The "program" uses four registers: 

(Video in the dark for dramatic effect!)

Discussions

Lee Wilkins wrote 03/04/2019 at 17:58 point

wow, awesome!

  Are you sure? yes | no

matseng wrote 03/04/2019 at 07:37 point

I guess you are using that Apple ][ as your main development station for that ultimate retro-feeling here ;-)

  Are you sure? yes | no

spudfishScott wrote 03/04/2019 at 15:15 point

Hah! But I WILL be using it for all of the I/O and mass storage. I'll be making an Apple peripheral card that will halt the Spikeputor CPU and access its memory directly.

  Are you sure? yes | no

Amos wrote 03/03/2019 at 00:13 point

That looks awesome! Lots of blinky lights! 8^)

  Are you sure? yes | no

spudfishScott wrote 03/03/2019 at 12:11 point

Thanks! That’s pretty much the rationale for this project. Blinky lights with an artifact of computation. 

  Are you sure? yes | no