JACA 1 & 2 Homebrew Computer

JACA - Just Another CPU Again
Homebrew CPU, starting by a simple POC 4-bit CPU on circuit simulator soft. (done), then 8-bit (in progress)

Similar projects worth following
The ultimate goal is to make (physically build) from scratch a complete computer as simple as possible, but powerful enough to run old games such as Tetris, Pong, Arkanoid or Snakes on a LED matrix (probabily 16x16).

Edit: check it out for the latest version of project files on GitHub:

The ultimate goal is to make (physically build) from scratch a complete computer as simple as possible, but powerful enough to run old games such as Tetris, Pong, Arkanoid or Snakes on a LED matrix (probabily 16x16).

In order to do this (and have something working earlier) I decided to make first, as a POC, a very simple 4 bit CPU in a simulation software (Logisim 2.7.1).

This 4 bit CPU has the barely minimum to do some useful computing, in this case I chose a multiplication of two 4 bit numbers.
Hardware specifications:
-4 general registers of 4 bits (A to D)
-RAM memory of 16 words of 8 bits
-initially just 8 instructions, with 3 addressing modes (no instructions of memory access at this point) (*)
-fixed instruction size (8 bits, one cell of memory)

This last point I consider vital for the simplicity of the circuit, since I need only one access to the memory to get all the instruction, making the Fetch fase the simpler I could imagine.

There are only two steps cycles per instruction, Fetch and Execute. Two clock lines are used, one to properly set the inputs of the devices and other to trigger the clocks and commit the changes.

The ISA is heavilly influenced by that of MSX, which I used to program back in the early 90's. That was an 8 bit computer hugelly popular in my country (Brazil), despite almost unknown in the rest of the world.

It uses a Load/Store architecture, meant that all operations are done over the registers, the only instructions to access memory are Load/Store to or from a register. There is is no way to add two numbers in memory directly, for example. As all other design decisions that was for the sake of simplicity.

(*) Later in the project I could squeeze even more the ISA and insert two instructions to make memory access, but this is not necessary to the initial goal (multiply two registers).

Initial research and study on the subject was done late March 2017, I spent maybe two weeks choosing the simulation software (there are lots of options, even web based ones). Circuit design itself started one month ago, and, as of May is, I'd say 80% done. The pace seems very slow, but I could manage to effectively work on the project just 1-3 hours/week...

PS: the name JACA is a (bad) joke with the portuguese name of the jackfruit, common in Brazil.

  • 2 × 74LS181 4 bit ALU
  • 1 × 62256 32k x 8 bit SRAM
  • 4 × AT28C256 Memory ICs / EEPROMsEEPROM 32k X 8 bit
  • 13 × 74ALS874 8 bit register with async CLR and 3-state outputs
  • 10 × 74LS154 4 to 16 demux

View all 8 components

  • Microcode ROM module (almost) implemented

    Andre Baptista02/17/2018 at 23:35 0 comments

    Last weeks I implemented the microcode ROM in two breadboards:

    It's not very beautiful, as lacks me patience to cut wires the exact length and right colors...

    Besides that I started to document the circuit in an online tool called EasyEDA. This will be important in two ways:

    - Allow to understand the circuit on breadboards (it's a bit different of the Logisim circuit);

    - Make it possible to order the PCBs in the future, for a most professional version of the computer.

    Links for the Easy EDA schematics (I made them public, but not tested yet):

    PC and Memory 

    Instruction Register

    Another improvement: finally connected the PC, memory (very crude version) and IR together. I'm very anxious to see the computer working after almost one year, even a very basic version, so I made some things simpler, and after I will improve.

    Thanks for reading.

  • AT28C256 EEPROM writer

    Andre Baptista01/28/2018 at 22:12 0 comments

    Last week I made a fundamental step to complete the homebrew computer, an EEPROM writer.

    I decidede to put it in a separate project, which makes it easier for someone googling to find it:

    Best regards.

  • Small update

    Andre Baptista01/15/2018 at 20:42 0 comments

    Small improvement in circuit: part of RAM memory controller:

    Just to break the inertia in this part after maybe two months...

    Tetris game in the 8x8 led matrix is almost on Alpha version. It's working fine, but need performance improvements to be more playable. Logisim in my computer (Core i7/quad core/8gb) is only able to achieve around 2-3 KHz. Windows monitor shows ~25% of CPU used, which makes me think Logisim don't use any kinf of parallelism (not criticising at all, it's free and was only possible by the good will of author).

  • Vacations update

    Andre Baptista01/05/2018 at 00:11 0 comments

    During my vacations last december I managed to take some time to improve the Assembler, and it's now completely functional.

    Also, I could program the long awaited Tetris (not finished yet):

    Also I received my Arduino Mega, which with its 50+ pins will be used to make an EEPROM writer, and to unit test individually the modules of the computer.

    I plan to make a video demonstrating the computer working in Logisim.

    Hope this year I could finish the computer on breadboards and maybe in PCBs. Color VGA output would be great.

    Happy new year and happy hacking for everyone!

  • 74181 with Right Shift?

    Andre Baptista12/05/2017 at 14:41 0 comments

    When programming my first games for the Led Matrix of this computer in Assembly, I quickly realized how useful it would be the Shift instructions, for example to move left and right a character.

    In case of Left Shift, no problem at all, the 74181 ALU has the instruction A PLUS A (check here), which is the same as multiply by 2, or Left Shift one bit.

    Unfortunally the Right Shift instruction is missing in this IC, so I had to implement it with a 74HCT244 (eight tri-state buffer), redirecting bits, such as bit 7 to bit 6, bit 6 to bit 5, and so on... It's a little "ugly" design, as it's the only one instruction computed outside of 74181, but I haven't choice (any idea?)...

    We are very close to delivery the "production" version of the Logisim circuit, the 1.0.0 version. The "done" criteria was, since the very beginning, the ability to run simple games. I'm working on a Tetris game and already have a very crude version of an Arkanoid (or Pong).

    Thanks for reading.

  • Assembler / PCBs (?)

    Andre Baptista11/30/2017 at 19:38 0 comments

    Updating project status...

    Gave up making the compiler, at least for now. Reasons:

    a) It turned out far hard than it seems previously;

    b) Seems for me, now, an overkill. It's not that hard to program right in Assembly (have been watching many videos from WR Kits programming the Z80 in Assembly, it could be fun!), since you have a decent editor and an Assembler to take care of "ugly" things like memory addresses and let the programmer to worry only with the program logic.

    Picture of the assembler:

    That is half the story of last two weeks, the other half is:

    Thanks to this question I put on Electronics Stack Exchange, I'm seriousy considering make the computer right to PCBs, skipping the possible headaches of the breadboards...

    For designing the PCBs I'm thinking of EasyEDA, and for the manufacturing,

    Any ideas?

    Thanks for reading.

  • Update.

    Andre Baptista11/16/2017 at 13:46 0 comments

    After a month and a half, I returned to the ICs and wires, making the rest of registers logic and the register A.

    Realized I was mistakenly connecting some ICs, as control inputs are active low (most TTLs are) and I have to put a bunch of 7004 (inverters) to make things work.

    Now we have register A built and tested.

    Almost all of my 14 breadboards were used (some for testing boards) so I ordered 6 more.

    As a side note, I noted that the register was losing it's state when I turned off the desk light (!!!). One decoupling capacitor between Vcc and ground lines close to the IC seems to have corrected this issue. I'm afraid of what kinds of interference I will face when running this CPU above 1 MHz...

    Some pictures to make this log entry more beautiful:

    Thanks for reading.

  • Now we have to code a compiler...

    Andre Baptista10/24/2017 at 18:40 0 comments

    Last 2 weeks were very hard to the project... Almost no progress both in Logisim circuit design and breadboards.

    I've hit a wall: it became almost impossible to code test programs directly in assembly (with no tool but the Excel to convert to machine code), so I started to develop a simple compiler for a very simplified version of C#. But it (as always) revealed far more dificult than appeared, and the estimated 2 or 3 hours of coding quickly became 10 and far from finish.

    Hope to finish this in two weeks at most to return to the main project.

    Estimate of completeness so far:
    Logisim circuit design: 90%
    Real circuit in breadboards: 20%
    Compiler: 10%

  • Update project status

    Andre Baptista10/03/2017 at 20:09 0 comments

    Last two weeks saw some progress although not the expected.

    In the Logisim realm, finally implemented the RET_ADDR register, which, unsurprisingly, stores the return address to be used in the CALL isntructions.

    In the breadboards realm, I managed to build the IR (Instruction register), and a (small) part of the registers control logic.

    In the "future steps" realm I studied and I am very optimistic about VGA output (maybe 256 x 240 pixels, 256 colors/pixel) and interfacing a regular PS/2 keyboard for input.

    That's all people. See you next time.

    Instruction register (IR) with 3 chips (each 8 bits) to hold a 24 bit instruction.

    IR completed.

    Registers logic very far from completed, with those ugly stickrs to help me remember what each wire is for.

  • A little step for a man.

    Andre Baptista09/18/2017 at 16:32 0 comments

    This sunday I finally could make a progress in the hardware part of the project.

    This is the ALU module working, the board below is for test the ALU isolated.

    Now showing the sum of 201 (11001001) and 41 (00101001) which is 242 (11110010):

    Some next modules will need code to be writen to EEPROMs, I will use an arduino to accomplish that.

    Thanks to follow and see you soon.

View all 26 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates