Hello folks!

Intro
While I should be working on other things, like Grammer 3 (don't get your hopes up, sorry Razz), instead I am working on making my own, homemade CPU. This is a project that I project will take a looong time to reach completion, but as I have time, I am working on it bit-by bit (usually literally Wink ).

I made it in Logisim, but I forgot to backup the folder containing that part of the project (as well as the assembly language compiler I made for it Sad ). Luckily I posted images of it elsewhere so that'll make it easier to reconstruct, and it took me roughly 30 minutes to write he compiler in Python (as well as write a few test programs).

My work is made significantly easier by the fact that there is only one instruction-- storage/move/load. I took some inspiration from an older Z80 project of mine called Jade which had memory-mapped registers and I/O.

In the Logisim version, the byte at 0xF0 was the program counter, 0xF4 was the sum of the bytes at 0xF1 and 0xF2, so it could not be written to, (there is no storage at that byte), only read. As well, there were other functions like SUB, AND, OR, and XOR. So if you move 3 into 0xF1, and 4 into oxF2, then read 0xF4, you'll get 7.

This idea opens up my processor to easy customization. If I want a multiply instruction and I happen to have a circuit that multiplies, I can just plug it in to take the spot of a few bytes of memory. Or even better, I could easily use whole other processors to offload complicated tasks.

Scope
Since I have no previous experience working with ICs and very minimal experience with transistors, capacitors, and resistors, I am learning these things on the fly. This is slowing the process , but I've already learned a whole bunch. I've only burned out one LED so far by forgetting to accompany it with a resistor.
Essential Components/Circuits
With an ideal memory unit, I could perform instructions in one clock cycle. Unfortunately, that would cost a chunk of money that I do not have Razz Instead, I will simulate it with a 2-bit 'clock' to organize reads and writes. This means each instruction will take 4 clock cycles to complete. Done

I need to figure out how to interface with the SRAM and EEPROM. I haven't even started to experiment with this, but I bought what looked like the easiest chips. The EEPROM interfaces like SRAM, and they both have 8KB memory. For the first test, I'll only be using 128 bytes apiece. Not Done

I need to make a program counter, in this case 8 bits. I need this to increment by 1, as well as making it writeable. Not Done. However, I did finish a 4-bit counter. The only problem is that I can't load in a new value; I can only increment.

That's it for the essential components!
Non Essential Components/Circuits
For this first prototype, I am going to have an ALU with which the CPU can interface. There will be two inputs mapped to two bytes of RAM, and an operation select occupying another byte of RAM. I will also add a status byte whith one of the bits being overflow of the ALU and another that when set, disables the next write. (this will make conditional jumping possible).

Pictures and Videos
2-bit Counter:

4-bit Counter, tied to a clock:

Precursor to the 4-bit counter-- It takes a 4-bit input and returns that value, plus one. The extra LED on the end is simply overflow.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement