frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

LFSR CPU Running Forth

https://github.com/howerj/lfsr-vhdl
73•izabera•1d ago

Comments

kragen•1d ago
This is pretty cool. There were some LFSR-PC CPUs back in the 70s such as the TMS 1000 used in the Speak&Spell https://github.com/mikeakohn/tms1000_fpga (its Data Manual omits mention of this, but the Programmer's Reference Manual does mention it https://ia800306.us.archive.org/27/items/bitsavers_tiTMS1000...), and of course the Atari 2600 TIA raster generator is famous for using an LFSR counter for horizontal position. Ken Shirriff has also documented the use of an LFSR counter for tone generation in the UM66T greeting-card music chip http://www.righto.com/2021/12/reverse-engineering-tiny-1980s... and for Pentium self-test circuitry http://www.righto.com/2025/01/pentium-carry-lookahead-revers... and for DTMF tone generation.

It occurred to me recently that an LFSR-pc CPU could avoid having an address field in its conditional jump instructions, instead doing something like complementing a PC bit. There have been conventional counter-based CPUs that did something like this: Data General's NOVA and HP's RPN calculators had conditional-skip instructions which would skip over the next instruction without executing it if the condition was false. But it was usually a jump instruction, so it didn't really save you space. (The TMS 1000's conditionals also worked this way, but could only skip branch and call instructions.)

By contrast, in an LFSR, complementing a bit or incrementing the value takes you potentially far away in the address sequence. The assembler might have to insert NOPs to resolve the occasional collision.

The TMS 1000 program counter had an additional twist: it was only 6 bits, but to enable programs of more than 64 instructions, there were multiple 64-byte "pages" of ROM. The page address register was potentially updated on branches, calls, and returns, but not for normal program sequencing. I'm not sure if this actually saved any transistors, but it meant that normal branch instructions only needed a 6-bit field. An additional "load page buffer" instruction was needed for far jumps and calls, and the page buffer register remained loaded with the return page until the return instruction. (Subroutine calls within subroutines were not supported.)

https://electronics.stackexchange.com/questions/186762/first... claims that the TMS 1000 had 8000 transistors, which seems really inefficient compared to things like the 4004 and the MuP21.

jecel•1d ago
Didn't the TMS 1000 include the processor, i/o, ROM and RAM? All that in 8K transistors seems frugal.
kragen•1d ago
That's a good point. It's more like an 8051 than a 4004, and the 8051 was 50k transistors.
nullc•19h ago
If you had a pallet of a couple possible jump instructions that different twiddle the counter you might be able to use a solver to resolve collisions in the spirit of ribbon filters ( https://engineering.fb.com/2021/07/09/core-infra/ribbon-filt... ).
howerj•1d ago
I had a lot of fun writing this and it is great to see this submitted here, I just did it to see what was possible. It is an incredibly niche processor with little practical use. If you have any questions let me know.

I have also started contracting in the UK and I'm looking for work, details are in my profile.

kragen•1d ago
You may be interested in #forth on Libera, though it's unlikely to lead to work.
sph•1d ago
It’s unlikely to find paid Forth work, though I hope there is still someone hiring engineers that write Forths and LFSR CPUs in their spare time. One will find they are quite versatile and eager to learn :)
howerj•1d ago
Ah yeah, I'm not looking for Forth work, it would be nice, but not likely. Just C/C#/.Net/Linux and Embedded work.
alexisread•1d ago
Nothing involving forth (only Java really) where I'm working, but I wanted to send some appreciation for Embed forth (meta-compiler), the documentation is particularly good :)
artemonster•1d ago
I have used the same LFSR-PC trick for my relay CPU:

https://github.com/artemonster/relay-cpu

Instead of having 24 relays to have a 12bit incrementer (a full adder requires 4 DPDT relays per bit or 2 quad relays) I only have 3 relays for 3 XORs :)

tyrellj•1d ago
I got lost in the weeds following links for a bit. Had not heard of LFSR before, which I think is odd, and then onto some other things like Subleq and OISC. I've at least seen other OISCs before, it might have even come up on hn around x86 mov, I'm not sure. I really regret not taking more hardware/electronics courses in college.
jsd1982•1d ago
Wouldn't this make it somewhat more challenging for assemblers/compilers to emit branch instructions with target PC offsets?

For instance, the offset of an instruction two instructions away would be calculated as `lfsr(lfsr(pc))` (off-by-one bugs notwithstanding), right?

anthk•1d ago
If the PC offsets are non-repeating, you would just create a table from a known start. Kinda like Ouruborus, or the Humming distance between vertexes in a cube without repeating.
nullc•21h ago
LFSR IP seems like one of the optimizations that would show up in a CPU designed for the absolute lowest energy per operation. Sadly many of the most interesting low energy optimizations will be at the analog/transistor level-- or even from optimizing across that boundary--, taking them out of the realm of hobbiests.
dmitrygr•4h ago
instruction set design is reminiscent of PDP8

Deep learning gets the glory, deep fact checking gets ignored

https://rachel.fast.ai/posts/2025-06-04-enzyme-ml-fails/index.html
80•chmaynard•58m ago•6 comments

Destination: Jupiter

https://clarkesworldmagazine.com/liptak_06_25/
52•AndrewLiptak•2h ago•13 comments

A deep dive into self-improving AI and the Darwin-Gödel Machine

https://richardcsuwandi.github.io/blog/2025/dgm/
9•hardmaru•1h ago•0 comments

Quarkdown: A modern Markdown-based typesetting system

https://github.com/iamgio/quarkdown
556•asicsp•14h ago•238 comments

The Small World of English

https://www.inotherwords.app/linguabase/
104•michaeld123•7h ago•54 comments

Show HN: AirAP AirPlay server - AirPlay to an iOS Device

https://github.com/neon443/AirAP
107•neon443•2h ago•11 comments

Show HN: An Alfred workflow to open GCP services and browse resources within

https://github.com/dineshgowda24/alfred-gcp-workflow
28•dineshgowda24•3h ago•5 comments

(On | No) Syntactic Support for Error Handling

https://go.dev/blog/error-syntax
263•henrikhorluck•6h ago•316 comments

Activeloop (YC S18) Is Hiring Senior Back End and AI Search Engineers(Onsite, MV)

https://careers.activeloop.ai/
1•davidbuniat•1h ago

Ask HN: Options for One-Handed Typing

46•Townley•3h ago•52 comments

The Shape of the Essay Field

https://paulgraham.com/field.html
46•luisb•12h ago•31 comments

Show HN: I wrote a Java decompiler in pure C language

https://github.com/neocanable/garlic
132•neocanable•10h ago•64 comments

Show HN: Controlling 3D models with voice and hand gestures

https://github.com/collidingScopes/3d-model-playground
74•getToTheChopin•7h ago•15 comments

CVE-2024-47081: Netrc credential leak in PSF requests library

https://seclists.org/fulldisclosure/2025/Jun/2
30•jupenur•3h ago•5 comments

Swift at Apple: Migrating the Password Monitoring Service from Java

https://www.swift.org/blog/swift-at-apple-migrating-the-password-monitoring-service-from-java/
165•fidotron•5h ago•113 comments

Can adults grow new brain cells?

https://www.livescience.com/health/neuroscience/can-adults-grow-new-brain-cells
27•bookofjoe•1h ago•9 comments

Yoshua Bengio Launches LawZero: A New Nonprofit Advancing Safe-by-Design AI

https://lawzero.org/en/news/yoshua-bengio-launches-lawzero-new-nonprofit-advancing-safe-design-ai
31•WillieCubed•1h ago•18 comments

Vision Language Models Are Biased

https://vlmsarebiased.github.io/
102•taesiri•9h ago•80 comments

Gemini in Chrome

https://gemini.google/overview/gemini-in-chrome/?hl=en
37•aru•1h ago•39 comments

Technical Guide to System Calls: Implementation and Signal Handling in Modern OS

https://mohitmishra786.github.io/chessman/2025/03/31/Technical-Guide-to-System-Calls-Implementation-and-Signal-Handling-in-Modern-Operating-Systems.html
12•signa11•5h ago•3 comments

There should be no Computer Art (1971)

https://dam.org/museum/essays_ui/essays/there-should-be-no-computer-art/
63•glimshe•12h ago•96 comments

Show HN: PinSend – Share text between devices using a PIN(P2P, no login)

https://pinsend.app
48•avovsya•7h ago•28 comments

Oh fuck! How do people feel about robots that leverage profanity?

https://arxiv.org/abs/2505.05831
13•rolph•6h ago•14 comments

Builder.ai Collapses: $1.5B 'AI' Startup Exposed as 'Indians'

https://www.ibtimes.co.uk/builderai-collapses-15bn-ai-startup-exposed-actually-indians-pretending-bots-1734784
247•healsdata•9h ago•161 comments

Plutonium Mountain: The 17-year mission to guard remains of Soviet nuclear tests

https://www.belfercenter.org/publication/plutonium-mountain-inside-17-year-mission-secure-legacy-soviet-nuclear-testing
74•jmillikin•12h ago•41 comments

Covert Web-to-App Tracking via Localhost on Android

https://localmess.github.io/
241•sebastian_z•10h ago•192 comments

Fun with Futex

https://blog.fredrb.com/2025/06/02/futex-fun/
71•ingve•15h ago•20 comments

The Metamorphosis of Prime Intellect (1994)

https://localroger.com/prime-intellect/mopiall.html
141•lawrenceyan•18h ago•67 comments

Implementing a Forth

https://ratfactor.com/forth/implementing
104•todsacerdoti•3d ago•40 comments

A High-Level View of TLA+

https://lamport.azurewebsites.net/tla/high-level-view.html
79•blobcode•3d ago•19 comments