6 ms·
Nibbler 4 Bit CPU (2013)
- userbinator 4y agoIt'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 https://en.wikipedia.org/wiki/Handheld_electronic_game are some examples of where they can be found.
- speed_spread 4y agoI 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/ https://sharppocketcomputers.com/
- wkjagt 4y agoI 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.
- entrylevel 4y agoHas anyone ever written a BASIC for a 4-bit CPU?
- actionfromafar 4y agoOn 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 4y agoI 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 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 4y agoI wrote a Forth for a 1-bit CPU (sort of, it was really a 16-bit bit-serial CPU) once.
- dang 4y agoRelated: Nibbler 4 Bit CPU - https://news.ycombinator.com/item?id=10379017 https://news.ycombinator.com/item?id=10379017 - Oct 2015 (19 comments)
- dbcurtis 4y agoWell, 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.
- ecpottinger 4y agoI think you can make a good copy of the 74181 with just a eprom.
- Lerc 4y agoThe 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.
- Taniwha 4y agoA great candidate for TinyTapeout
- omgtehlion 4y agoA 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 https://github.com/omgtehlion/nibbler-sim
- apricot 4y agoI 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 4y agoThe 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.
- apricot 4y agoThanks. Do you think the Nibbler would be compatible with Ben Eater's 555-based clock? I think it would be instructive to run it at slow speeds and use LEDs to see how the signals propagate. What would you say was the hardest part of building the computer? How many breadboards did you end up using?
- aricz 4y agoFor those who don't know, the name is taken from https://en.wikipedia.org/wiki/Nibble https://en.wikipedia.org/wiki/Nibble
- jazzyjackson 4y agobut also https://futurama.fandom.com/wiki/Lord_Nibbler https://futurama.fandom.com/wiki/Lord_Nibbler
- aricz 4y agoI didn't know, I should've put "I assume the name is from...". It just made too much sense. Nibbler being a 4-bit CPU and "nibble" meaning 4 bits.
- shrubble 4y agoFun 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 4y agoI 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.
- childintime 4y agoAn 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 4y agoIf 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)...
- daitangio 4y agoBy the way HP calculators (like 48S was based on a 4bit access-RAM. They was 32bit CPU but first model used 4bit buses. Also GameBoy first CPU was 4bit based if I recall correctly So 4bit CPU has something to say. https://gioorgi.com/2020/hp-42s/ https://gioorgi.com/2020/hp-42s/
- mytailorisrich 4y agoGame boy had an 8-bit CPU very similar to a Z80.
- trifit 4y agoSanity and happiness are an impossible combination. ~ Mark Twain This is my view on the SSD crashing family of events. Lessons learnt to always be alert and have backups handy.
- punkx 4y agoi love 4 bit cpus, it is so nice to teach with them i made a card "game" for Richard Buckland's made up instruction set and my daughter was very receptive, we also started to build Ben Eater's cpu, but it was too slow and she got impatient i think nibbler is the right amount of fun/effort, i will absolutely try it link to the game if someone is interested (you can also print it yourself): https://punkx.org/4917 https://punkx.org/4917
- VincentKun 4y ago
- bogomipz 4y agoI had a question about the pictures at the bottom of the post. Is this an example of "wire wrapping"? If so what mechanism is actually holding the wire securely around those metal posts(terminals?)
- rrss 4y ago> Is this an example of "wire wrapping"? Yes > If so what mechanism is actually holding the wire securely around those metal posts(terminals?) The wire is wrapped around the posts several times, with no other mechanism. https://en.m.wikipedia.org/wiki/Wire_wrap https://en.m.wikipedia.org/wiki/Wire_wrap has a good close up picture of one connection and a description of the details (including some info on how this forms a reliable connection)
- hoosieree 4y agoFriction. You can use a wire wrap gun that takes a bit of wire - fine-gauge, solid core, and stripped on both ends - and tightly wraps it around the square pin. A handful of turns provide plenty of surface area for the square corners of the pin to "bite" into the wire. Kind of like how in old western movies when the cowboy wants to park his horse he just loosely wraps the reins around a fencepost. It's secure enough to keep the horse from wandering off. Here's a video showing a manual wire wrap tool: https://www.youtube.com/watch?v=lG5oKLrG7R0 https://www.youtube.com/watch?v=lG5oKLrG7R0