A couple of years ago I have built a copy of this project with my son on a breadboard with real (made in '80s and '90s) 74-series chips.
It was a very fun experience. And we liked the project very much.
It has a very small and concise schematics which makes it very easy and clear how CPU really works.
P.S.: the original simulator is written in C++/CLI (a .net flavour of c++), so I decided to refresh the project (to c#, it was easier to translate than to port to native c++), and added a real 1602-display simulator which looks nicer and support a “graphic” mode. You can play with it here https://github.com/omgtehlion/nibbler-sim
I was thinking of doing the same thing with my son (breadboarding the Nibbler). He has built a virtual computer with nandgame.com but asked me if he could build a real one. The nand game computer is 16-bit and would be a nightmare to build from TTL, but the Nibbler looks doable. This would be my largest breadboarding project by far, though, and I would appreciate any hints you could give me, especially regarding how to test the circuit while building it.
The only way is to build it piecewise, start with generator, clock and PC, then add microcode and code roms. And you will _need_ a chip programmer, something like TL866, this thing can also test simple chips. And a cheap logic analyzer will be helpful. DSLogic is very cool and has 16 lines, but anything cheap from aliexpress will also do fine.
It's worth noting that 4-bit microcontrollers are still in widespread use in ultra-low cost high-volume applications, where they use mask ROM and are usually in the form of a COB mount. Remote controls, 4-function calculators, and https://en.wikipedia.org/wiki/Handheld_electronic_game are some examples of where they can be found.
Well, he uses a '181 ALU chip -- which is very nice but you have to scour the universe to find vintage logic parts like that any more. Amusingly, it is easier to find vintage vacuum tubes than vintage TTL logic. For that matter... you can find Youtubers building vacuum tubes from scratch using crude home shop tools, which don't quite cut it for TTL logic.
For something you could build with today's part catalog, without going all the way to an FPGA, doing the ALU in a GAL parts might be both amusing and educational.
I started programming in the 80's writing BASIC on Sharp Pocket Computers, many of which used 4 bit processors. While no C64, these little machines were surprisingly nice to use. They also had the advantage of being slippable into a school backpack... https://sharppocketcomputers.com/
An intellectually interesting exercise would be to replace all of the logic by a 64bx16b EPROM which loops back onto itself through 2 8b latches. This is possible as the architecture has only 16 bits of state (4b accumulator + 12b PC). This simplifies the hardware, which is nice, but it also makes it a software defined MCU, hence the student could go on to define his own instructionset. Now that would be instructive.
I recall the low end of the IBM 360 line (the Model 30) used a similar arrangement, using an 8-bit ALU to execute a 32-bit ISA via microcode emulation. Yeah...it was slow.
On these small CPU, size of addressable RAM is even more important than word size.
I think if you want to get a BASIC running on that 4-bit CPU in the article, the easiest is probably to create a 6502 or Z80 emulator, then run the emulator on the 4-bit CPU.
After all, someone made an ARM (32 bit CPU) emulator for an 8 bit CPU and booted Linux on that.
I think writing a simple basic for it would be easier. The machine has enough memory (“4096 8-bit bytes for programs and 4096 4-bit nibbles for data.”), but the instruction set is lacking compared to a 6502, so it would be a limited one.
It was a very fun experience. And we liked the project very much.
It has a very small and concise schematics which makes it very easy and clear how CPU really works.
P.S.: the original simulator is written in C++/CLI (a .net flavour of c++), so I decided to refresh the project (to c#, it was easier to translate than to port to native c++), and added a real 1602-display simulator which looks nicer and support a “graphic” mode. You can play with it here https://github.com/omgtehlion/nibbler-sim
For something you could build with today's part catalog, without going all the way to an FPGA, doing the ALU in a GAL parts might be both amusing and educational.
All the logic remaining are bus arbiters and IO access. You can replace 74-181 with one more rom though, but it will not decrease chip count...
EDIT: actually if you replace 74*181 with rom, you can get rid of NZERO flag detection gates (minus 1 chip)...
The system was slower than others in the line, but was also the cheapest.
Nibbler 4 Bit CPU - https://news.ycombinator.com/item?id=10379017 - Oct 2015 (19 comments)
I think if you want to get a BASIC running on that 4-bit CPU in the article, the easiest is probably to create a 6502 or Z80 emulator, then run the emulator on the 4-bit CPU.
After all, someone made an ARM (32 bit CPU) emulator for an 8 bit CPU and booted Linux on that.
I would look at Apple’s first Basic (https://en.wikipedia.org/wiki/Integer_BASIC) and trim away all but the bare essentials. Some possible simplifications:
- only support variable names of length one
- remove the exponentiation operator
- only support 8-bit integers
- only support line numbers between 0 and 255
If, then, there’s program space left, add in features.