Live data from Hacker News

Nibbler 4 Bit CPU (2013)

bigmessowires.com

21–30 of 35 posts

Re: Nibbler 4 Bit CPU (2013)

#21

Has anyone ever written a BASIC for a 4-bit CPU?

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.

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.

Re: Nibbler 4 Bit CPU (2013)

#22
i 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

Re: Nibbler 4 Bit CPU (2013)

#23

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/

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.

Re: Nibbler 4 Bit CPU (2013)

#26
I 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?)

Re: Nibbler 4 Bit CPU (2013)

#27

I 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?)

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

Re: Nibbler 4 Bit CPU (2013)

#28

I 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?)

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

Post reply on HN