Readit News logoReadit News
omgtehlion · 3 years ago
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

apricot · 3 years ago
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.
omgtehlion · 3 years ago
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.
userbinator · 3 years ago
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.
dbcurtis · 3 years ago
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.

Lerc · 3 years ago
The gigatron implements an 8-bit ALU in 10 chips. Four 74hc153 and one 74hc283 for each nibble. Quite a nice solution to avoid the 181.
ecpottinger · 3 years ago
I think you can make a good copy of the 74181 with just a eprom.
speed_spread · 3 years ago
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/
wkjagt · 3 years ago
I have a PC1500 and there’s just something magical about it. I still need to get around repairing the little printer that comes with it.
childintime · 3 years ago
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.
omgtehlion · 3 years ago
If you look closer, this CPU _is_ actually some roms sandwiched between registers.

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)...

shrubble · 3 years ago
Fun fact: the 1200ns cycle time DataGeneral Nova 1200 system used a 4 bit CPU that ran the 16 bit DG operating system.

The system was slower than others in the line, but was also the cheapest.

kjs3 · 3 years ago
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.
dang · 3 years ago
Related:

Nibbler 4 Bit CPU - https://news.ycombinator.com/item?id=10379017 - Oct 2015 (19 comments)

krallja · 3 years ago
Hi Dan, the article appears to originally be from (2013), in case you want to update the title.
dang · 3 years ago
Added. Thanks!
entrylevel · 3 years ago
Has anyone ever written a BASIC for a 4-bit CPU?
actionfromafar · 3 years ago
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.

Someone · 3 years ago
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.

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.

howerj · 3 years ago
I wrote a Forth for a 1-bit CPU (sort of, it was really a 16-bit bit-serial CPU) once.