Close
0%
0%

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:

https://github.com/albs-br/jaca

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
  • 5 × 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

  • Control Unit migrated to PCB

    Andre Baptista5 days ago 0 comments

    Project update:

    • as the post's title implies, Control Unit is now living on a PCB, a life form hundreds of years ahead of the breadboards, but not without some pain... As always there was a mistake on the PCB desing, but this time it wasn't my fault: the EasyEDA software has a trick (or more apropriatelly, a bug) and it doesn't connect wires in a specific situation, like this:
    These wires are NOT connected with the Labels... I'm not sure what's the cause, maybe a small misalignment on grids

    Before
    After
    • Registers board was ordered today. As it is twice the size of the others (and three times the price) I took special caution to not make mistakes. I hope everything will be fine. Now the only thing to do is to wait, around 30 days for the board to arrive.

    Thanks for reading.

  • Testing ALU

    Andre Baptista02/26/2019 at 00:40 0 comments

    Some days ago I made a video of the ALU testing. I had some surprises with this module: the power wires were too thin, which, together with the cheap eBay ICs was causing a voltage drop; I made some mistakes when designing the PCB which I had to correct with very ugly wires.

    PS. Today one more board arrived, soon we will have a new module working.

    Thanks for reading.

  • ALU working. Damn cheap Ebay ICs

    Andre Baptista01/20/2019 at 19:08 8 comments

    After two months stuck in this problem, I finally came to a solution: the fault was on cheap chinese ICs from ebay, which caused a huge drop of tension across the board, making VCC on some IC's to fall below 4 V. So, caution with Ebay components.

    ALU working:

    Lets stay focused to finish project within the schedule!

    Thanks

  • Homebrew CPU Webring​

    Andre Baptista01/11/2019 at 01:02 2 comments

    Now we are honoured to be featured on the great  https://www.homebrewcpuring.org!!!

    Thanks!

  • New Year commitments

    Andre Baptista12/19/2018 at 15:46 0 comments

    As it's standard on all end of years, I'm trying to make a promise and finally make this thing work. It's already more than a year and a half since I got into this trap.

    The deadlines are as follow:

    • Jan - make the ALU to work standalone (I'm now stuck at this problem)
    • Jan - finalize and order Control Unit PCB
    • Feb - finalize and order Registers PCB
    • Feb - assemble Control Unit PCB
    • Mar - assemble Registers PCB
    • Mar - put it all together
    • Mar - design and order the Program Counter and memory PCB
    • Apr - assemble Program Counter and memory PCB
    • Apr - put it all together again

    Then that's it. Let's cross our fingers and hope that, on the second anniversary of the project, the first full version would be running on real hardware.

    Thanks for reading.

  • Loading instructions from memory, now with PCBs

    Andre Baptista11/20/2018 at 23:49 0 comments

    I connected two modules that are now converted to PBCs, the Clock and the Instruction Register. Between them is the Program Counter and Memory, still in a breadboard. This is the last module I plan to turn into PCB.

    Everything worked fine, despite some stupid mistakes I made (these chips don't fry easily).

    This video shows the modules working together:

    Thanks for reading and see you next time.

  • Instruction Register PCB working

    Andre Baptista11/09/2018 at 11:01 0 comments

    Finally build the IR PCB and it works fine.

    One issue: I forgot a pin header and had to make an ugly workaround:

    Other (small) problem: the green leds are very weak (look the led bar at top, it is showing the 01010101 pattern). I measured the 74ALS874 output and it reads only 3,5V, and while it is still inside the TTL standard, I am used with 5V on outputs. So I will need to lower the resistors but it is a simple and painless change.

    TTL accepted voltage levels:

    Image result for ttl voltage levelsThanks for reading.

  • Two more PCBs

    Andre Baptista10/12/2018 at 00:35 0 comments

    Long time since last update.

    Meanwhile, today two packages arrived: 2 PCBs and one octopus board support:

    See you next time.

  • Newborn, two more PCBs ordered

    Andre Baptista08/25/2018 at 15:48 0 comments

    Montly update (there was a time I updated this project 2 or 3 times a week...):

    Thanks to the arrival of my second son, time for project shrunk to almost zero.

    Finally I ordered two more PCBs (expected time to delivery: 4 weeks), lets see the modules status right now:

    • Clock and sequencer: Completed and working fine;
    • Program Counter and Memory: ?
    • Instruction Register: Ordered;
    • Control Store: 90% designed, will be ordered this week;
    • ALU: Ordered;
    • Registers: 20% designed.

    Since a log entry without pictures is useless, lets see the 3D view of the two just ordered modules:

    Thanks for reading.

  • First PCB

    Andre Baptista07/30/2018 at 18:34 0 comments

    Finaly the PCB of the Clock and Sequencer module arrived:

    Apart from small mistakes (e.g. the two potentiometers where placed very close) everything went generally well and I'm very satisfied with the overall quality of the PCBs (https://jlcpcb.com/).

    I hope in the next weeks I could manage to design and order the other modules.

    Thanks for reading.

View all 45 project logs

Enjoy this project?

Share

Discussions

Andre Baptista wrote 04/30/2018 at 20:17 point

PS. The 74181 component for Logisim it's not mine, I found out it here: https://74x.weebly.com/blog/library-of-7400-logic-for-logisim.

Also, caution with the versions: the right version of 74181 ALU is the v2, the other ones aren't working correctly. 

  Are you sure? yes | no

Ruud van Falier wrote 05/01/2018 at 07:13 point

I took the correct one then, thanks! :)

  Are you sure? yes | no

Ruud van Falier wrote 05/01/2018 at 07:16 point

Do you know why some datasheets state that "M=L, Cn=L, S=LHHL" will output "A minus B" and some state that it outputs "A minus B minus 1" ?

  Are you sure? yes | no

Andre Baptista wrote 05/02/2018 at 12:25 point

I have no idea. The right output is "A minus B minus 1" as shown in most resources (like the Motorola datasheet). Also I tested in Logisim and its output was  "A minus B minus 1" as expected.

Edit: forget about above. I misread the datasheet ("Active Low Inputs" seems to exist just to make life harder...). Right output is "A minus B". Anyway it's better test by yourself, both in Logisim and with the real IC using breadboards (maybe an Arduino to automatically test all functions with all possible input combinations).

  Are you sure? yes | no

Andre Baptista wrote 04/30/2018 at 19:48 point

You welcome.

This link was very helpful for me: http://www.righto.com/2017/03/inside-vintage-74181-alu-chip-how-it.html

  Are you sure? yes | no

Ruud van Falier wrote 04/30/2018 at 18:32 point

Thanks for sharing all your work. I've picked up your 74181 component and test circuit which helped out a lot in understanding the comparator functions.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

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