Top
Best
New

Posted by a1k0n 3 days ago

Pure Silicon Demo Coding: No CPU, No Memory, Just 4k Gates(www.a1k0n.net)
422 points | 72 comments
yoan9224 2 days ago|
This is absolutely wild. Rendering graphics with just combinational logic and no frame buffer is the kind of constraint that breeds creativity.

The HAKMEM sine/cosine generator is such an elegant choice - it's numerically stable in fixed-point and requires only adds and bit-shifts. Perfect for hardware. I used a similar approach once for generating test patterns in an FPGA.

The fact that you can iterate on this in simulation, then deploy to actual silicon via Tiny Tapeout for $150 is honestly mind-blowing. We're living in the future.

tails4e 2 days ago||
How does this compare to CORDIC for sin/cos generation? Which is more accurate, etc ?
yoan9224 2 days ago|||
Good question! CORDIC and HAKMEM Item 149 are both hardware-friendly, but have different trade-offs:

CORDIC: - Iterative algorithm (needs multiple clock cycles) - Accuracy improves with more iterations - Generates both magnitude and phase - Typical hardware implementation: 12-16 iterations for decent precision

HAKMEM (Item 149): - Single-cycle computation (just two adds per step) - Uses the recurrence: x' = x - εy, y' = y + εx - Accuracy depends on word width and epsilon choice - Numerically stable in exact arithmetic if ε² < 2

a1k0n 2 days ago|||
CORDIC is more accurate, but takes as many iterations as you have bits of precision in your angle. Another demo called Warp in this contest used pipelined CORDIC to do atan2 on every pixel to create a tunnel, which is super impressive.

https://www.youtube.com/watch?v=K9mu3getxhU&t=780s

zahlman 2 days ago||
> The fact that you can iterate on this in simulation, then deploy to actual silicon via Tiny Tapeout for $150 is honestly mind-blowing. We're living in the future.

It's really cool but it doesn't seem practical at all. They aren't setting up print runs, just one-offs (https://tinytapeout.com/faq/#how-many-chips-will-i-receive-c...) and $150 could get you... many orders of magnitude more power than that.

... For that matter, apparently the microcontroller in the dev kit is a https://en.wikipedia.org/wiki/RP2040 , which seems like a beast in comparison. And it's still available for less than $1 USD on PiShop.

immibis 2 days ago||
Tiny Tapeout's schtick is that for $150 you can get your chip design made at all. It's not a mass production run.

Remind me to participate in the next one!

xphos 3 days ago||
As a computer science guy who interlops in computer engineering i really want to find time to build something cool like this and tapeout. The retro architectures for rendering are simple but fun! I love the project
Neywiny 3 days ago||
I recommend getting started like the author did: simulation first, then FPGA. Honestly FPGA will take you very far. I always get a kick out of being able to design my own SoC. "Hmmm I need 9 separate I2C ports... Ok, copy block, paste paste paste..." Or if you have an operation in software that's taking forever you can write an accelerator for it
8f2ab37a-ed6c 2 days ago|||
What are the best modern tools to get started with in simulation for those who have never dabbled before?
Neywiny 2 days ago|||
I do the vast majority of my work on xilinx and it's easiest to just use the built in simulator. It's free and supports vhdl and verilog. Most support just one. For lattice and microchip work I use what the tool provides which is usually a cut down modelsim or something
sehugg 2 days ago||||
Try https://8bitworkshop.com/verilog to get started with dabbling
y1n0 2 days ago||||
start here: https://github.com/YosysHQ/oss-cad-suite-build
sweetjuly 2 days ago||||
The other commentator mentioned Verilator (which is indispensable in larger designs) but you may also want to grab Icarus Verilog too. It's a FOSS simulator and, unlike Verilator, is 2-bit and so it handles X ("don't care") and Z ("high impedance") signals. It's ridiculously slow compared to Verilator but the greater fidelity can be valuable depending on what you're trying to do.
vanjoe 2 days ago|||
Verilator is very good. It's faster than anything else, and it is free. The downsides are it won't stimulate encrypted IP blocks. And it doesn't do mixed language sim, so vhdl is no bueno.
alfiedotwtf 2 days ago||||
Are there any open or at least standard FPGAs that the open source community flock to? Last time I looked into FPGAs, it was mostly closed architecture and proprietary tools
RossBencina 1 day ago|||
One flock-to is Lattice ICE40 series. Decent support from Yosys for hobby stuff at least. Possibly Go-win. You can develop for many of the affordable FPGAs with free versions of the proprietary tools. As for "closed architecture" it depends what you mean, the architecture of all FPGAs that I know of is documented, the tools show you how your design was mapped onto the hardware. The proprietary stuff includes the timing model that drives the static timing analysis and timing-aware place and route.
Neywiny 2 days ago|||
Not for anything mid to higher range, but I believe there's open source tooling for some of the older Lattice and Xilinx parts. I would say for me it's not as big a deal as on the software side, because each vendor's hardware tends to be pretty different from each other anyway.
alfiedotwtf 2 days ago||
Dang, sounds like there’s still a bit of lock in. That’sa shame
Neywiny 2 days ago||
I think there will always be vendor lock in. The same way there have been architectural differences between Intel and AMD's x86, or even stuff like one specific chip/family tanking performance because one instruction was implemented differently, you won't be able to guarantee efficient utilization of different vendor/families.

For example, I've taken code optimized for Xilinx, ran it for another vendor, and resource count ballooned because stuff that was built-in/free on one wasn't on the other. It's a lot of work to truly make generic code and usually just means switching out modules per vendor.

checker659 2 days ago|||
Do you know if there are any tutorials that use bounded model checking tools from the very get go? For verilog or VHDL.
oofbey 3 days ago||
It’s amazing and wonderful to see the Internet support these tiny cliques of interest. Having everybody connected leads to homogenization of culture in some ways, but it also supports these couple dozen (?) people around the world finding each other for this amazing little competition.
anonymous908213 3 days ago||

   Having everybody connected leads to homogenization of culture in some ways
The internet may hypothetically homogenize culture relative to a society that does not have any kind of mass communication at all, but relative to the world it was actually introduced into, the internet has completely balkanised the culture. Prior to the internet, we had television, cinema, literature, radio, and newspapers, which were all centralised and controlled enough that they created a shared monoculture in nations. A signifant portion of a country's population would watch, read, and listen to the same media. The internet bucked that trend, allowing all kinds of new subcultures to pop up and to more easily cross national boundaries.
therein 2 days ago|||
Yeah, back in the day you would go to school the next day after a show that everyone watches released its new episode, it aired on the prime-time slot on the primary TV channel, and you'd discuss what happened in that episode, or have some references or new jokes. Created a common culture.
amarant 2 days ago||
I remember those days. As the only kid in school who didn't watch Lost, those days sucked
adrianN 2 days ago|||
Then algorithms optimized content for addictiveness and we’re in a world where a large part of the world looks at the same set of „influencers“.
RossBencina 2 days ago||
I was curious about the long-term stability of the cited HAKMEM sin/cos generator. I found an overview here: https://news.ycombinator.com/item?id=3111501 (EDIT: I'm still not sure about stability, apparently it is stable in exact arithmetic under certain conditions.) Coincidentally it is related to the Verlet integration video I posted last week: https://news.ycombinator.com/item?id=46253592
a1k0n 2 days ago|
Yeah, it is exact in this specific circumstance. But yes, it's exactly the same trick; I also enjoyed that video in my Youtube recommender feed last week!
intalentive 2 days ago||
I like how the grid pulses with the kick drum. Nice touch.
glimshe 3 days ago||
Reminds me of college: "Hardware and Software are logically equivalent"
amelius 2 days ago||
Writing hardware is like writing software except parallelism is way cheaper, but mistakes are way more expensive.
lucyjojo 2 days ago||
that doesnt seem like a good tradeoff...
Joel_Mckay 2 days ago||
Hardware takes 20 years to learn how to build properly.

Software takes 1 year under someone smart in a production environment.

People that conflate the two... longer or more likely never.. =3

jacquesm 2 days ago||
> Software takes 1 year under someone smart in a production environment.

That's very funny.

Joel_Mckay 1 day ago||
Be honest, most Software people find utility in artifacts which are a mysterious black box with an emulated abstraction.

During a career role most have no idea "why" chips were designed and built a certain way, nor require this information to work within abstract domains.

In many ways, vibe-coders are the absurd optimization of a naive trajectory toward zero workmanship standards. =3

https://en.wikipedia.org/wiki/Five_stages_of_grief

Joel_Mckay 2 days ago|||
Whoever said that was mistaken... or worked at Intel. lol =3

https://en.wikipedia.org/wiki/Metastability

https://en.wikipedia.org/wiki/Clock_domain_crossing

xecaz 2 days ago||
Wow, nice work!! Coming from demo/intro coding where you have memory and a driver for audio(x86), this is very impressing.
startupsfail 3 days ago||
Wow, I'm looking at current "Open Shuttles", a license to use 4KB of SRAM in the project is $2500. But it comes with Wishbone Bus interface!

> 1024x32 Commercial SRAM > CF_SRAM_1024x32 > Commercial SRAM: 1024 words x > 32 bits (4KB) with Wishbone Bus interface > Area: 0.17mm² > GPIOs: 0 > License: Commercial - $2500 per project

Archit3ch 2 days ago||
I'm tempted to put together an FPAA with Tiny Tapeout, but it likely won't fit in the allocated area.
Taniwha 2 days ago||
TT allows you to pay more and build multi-block designs
Joel_Mckay 2 days ago||
Check the switching speed specification, and shared i/o bank configuration.

The project has a narrow scope of use-cases. =3

Archit3ch 2 days ago||
Switching speed: should be good enough for audio in the kHz range, even for off-chip control.

Analog i/o pins: definitely limited, even if you purchase the highest option available (6).

idiotsecant 3 days ago||
No x, no y, just Z is a pattern so often used by chatGPT it has started to bleed into common usage by people who maybe aren't even using an LLM.
layer8 2 days ago||
Or maybe ChatGPT picked it up from common usage.
idiotsecant 2 days ago||
It was used occasionally before chatGPT but it has exploded since then.
immibis 2 days ago||
Apparently ChatGPT speaks like lower-class Kenyans. You can guess why.
peddling-brink 2 days ago|||
Language is fluid. This is ok.

There are many bad things about LLMs, but a benign shift in popular language usage isn't one of them.

mschuster91 2 days ago|||
> There are many bad things about LLMs, but a benign shift in popular language usage isn't one of them.

Organic shifts in language are fine. What is not fine is Big Money (which most forms of AI are) manipulating society at large - and that's not just the AI companies' doing. Think of Tiktok leading people to say "unalive" instead of the various clear words before (e.g. kill, murder, executed, run over by car, mauled to death by animal).

idiotsecant 2 days ago|||
I disagree. It's a sign of what is essentially cultural contamination by an LLM. There is something vaguely gross about it, like when people start repeating advertising slogans. It's a sign that someone spent enough money that they directly rewired our brains.
peddling-brink 2 days ago|||
Do you get grossed out when you step on a linoleum floor? Or you ride an escalator? Or drink out of a thermos?

Culture contaminates.

Marazan 2 days ago|||
> like when people start repeating advertising slogans

but without the craft of a good advertising slogan. So worse!

attila-lendvai 2 days ago||
...and way more centralized and powerful.
fsckboy 2 days ago|||
when i was running for 5th grade class president a number of decades ago, my campaign sign slogan was a "no x, no y, just z" snowclone.
anthomtb 2 days ago||
For everyone who is as dumb as I am, the comment pertains to the title.

x=CPU y=Memory Z=4k gates

BoredPositron 3 days ago|
Reminds me of the time we repaired old pinball machines in trade school. Good times.
More comments...