Close
0%
0%

NanoCPU.org

A minimal functional 16-bit CPU made from transistors with lots of LEDs that anyone can build and learn from

Similar projects worth following
The main web site is http://www.nanocpu.org/ - below is extracts from the home page on 11Jan17

The goals are:
* Simple enough so that everyone can see how it works, that means lots of LEDs
* Complex enough to demonstrate the main ideas of a CPU
* Small enough to be affordable by anyone with the time to build it
* Quick enough to build and keep my (and those that follow me) family life
* Fast enough to run some complex software
* Slow enough so that everyone can see it running and understand it step by step
* Flat enough so that the entire state can be seen in one go

The CPU is Raspberry Pi hosted which will:
* Be the main memory and any memory mapped IO
* Control the clock, so you can single step in software
* Run the compiler
* Run the job queue
* Host the webcam so you can submit a job and see it see it see it running

Very many thanks to @Yann Guidon / YGDES for pointing out that most of my CPU had no chance of working (the memory cells). This is just the feedback I need. I'm working on something better.

  • the state machine - or lack of one

    Tony Robinson02/09/2017 at 20:40 0 comments

    Wow, the state machine of the CPU is hard - really hard. I thought I should start with what took the most real estate, the ALU and the memory cells, now I think I'm (touch wood) on top of both of those (I will update logs with progress as and when) but I'm struggling with the state machine - that is the bit of logic that raises all of the right enable lines at the right time. I shouldn't be at all surprised, there's a few people on home-built computers web-ring who said the same thing - it's the go-to site.

    So this isn't really a log entry as I don't have a state machine. What I find fascinating is that a CPU is something that, in my software world, runs compiled code (leaving aside the fact I run Python under Linux in a VM running Windows) but is really something that may execute microcode which may execute itself to fetch instructions (my I = *P++) which executes a state machine which executes a set of control lines which executes a set of logical functions which are expressed as analog signal processing where semiconductor physics (my almost-lost first degree) does the hard work.

    So many levels. I really don't like public speaking unless I have something worthwhile to say, but taking all this from a "BASIC" language through FORTH, assembly code, right the way down to the electrons and holes is something I feel confident I can engage and audience with. Teaching technology is not my goal - my goal is to encourage others to explore their dreams, however corny that sounds. But to do that I've got to succeed and that's a lot more time and effort away that I can plan for (even when you take into account Hofstadter's law).

  • A 2 Transistor 9 Diode memory cell

    Tony Robinson02/03/2017 at 19:02 0 comments

    Today I got my latest memory cell to work. It's only running at 150kHz for a read/write cycle right now but I'm confident that I can speed it up if needs be. The two transistors form a flip-flop to store the state, S. There is also: Di - data in, We - Write enable, Do - data out and Re, Read enable. Write is:

    S = (S AND NOT We) OR (We AND Di)

    The NOT comes for almost free as it's shared across all 16 memory cells in a register. Read is:

    Do = S AND Re

    Both AND and OR may be implemented with two diodes and a resistor (e.g. http://electronics.stackexchange.com/questions/131860/diode-logic-gates). This is the simplest memory cell I can think of, if you double the write logic you can write to both halves of the flip-flop at the same time which improves speed - but I value simplicity over speed.

    Currently I'm struggling with easyeda.com, when I have it mastered I'll add a pretty piccie (which will be 11 diode as I want two read circuits). I also need to add a blue LED at 3.3v as per my last post. It's good I failed first time, I like this design a lot better.

  • 3.3v vs 5v

    Tony Robinson01/27/2017 at 19:17 14 comments

    Right now my #1 question to sort out is should I run this at 3.3v or 5v? 3.3v has the advantage that transistors switch faster, and I'm an optimiser so I would like this. However I love blue LEDs and have just bought a thousand of them, these are on max current when wired 3.3v -> LED -> NPN -> ground without a current limiting resistor. Should I worry that the LED might short and so blow the lot? (yes I think so). Also my new carry logic uses a diodes ladder which would like 5v much more than 3.3v (at a pinch I could use 5v just for this). So what should it be, 3.3v or 5v - I have yet to decide.

    [ I've been out of the country on a work trip so haven't had any time for this in the last week and a bit - some new Schottky diodes have arrived and I need to stress test my new memory cell - time to take a day's holiday I think ]

    P.S. it seems that there is a maximum thread depth which is stopping me replying directly below some of the comments. As a result they are appearing above which does confuse the flow.

View all 3 project logs

Enjoy this project?

Share      

Discussions

Yann Guidon / YGDES wrote 01/18/2017 at 03:24 point
9 diodes ? That's "above average" :-D

  Are you sure? yes | no

Tony Robinson wrote 01/17/2017 at 16:28 point

I will keep trying!   I now think I have a two transistor, 9 diode memory cell.     You will like the fact that it works on logic, not some dodgy assumed behaviour of NPN bipolar transistors.   I don't know when I'll get the time to put it together and write it up, hopefully this weekend.   Cheers, Tony.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/14/2017 at 17:11 point

Thank you for sharing and being open, I'm sure you learn a lot from your mistakes and will make something very cool soon :-)

Developing a good flip-flop is a lost art and there is no shame in making mistakes, everybody does that :-D

Keep trying !

  Are you sure? yes | no

Does this project spark your interest?

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