News for hackers. Stuff that matters.
Re:Project Euler on a Microcontroller by shawnnapora on Friday July 29, 2022 @07:52PM (#32282993)
This is pretty neat! Is there a way to have arbitrary input for the number of cycles and actually emit the answer? It looks like the answer is being read in software from a register, if I understand the .vcd output correctly.
Re:Project Euler on a Microcontroller by victor82 on Friday July 29, 2022 @08:04PM (#32283055)
Well, that code is module without any context (ie: connected to nothig), it just have 2 inputs (clk and rst), and an "output" with the current sum, after it reach the desired value it keep stuck there (until reset).

So as the simulation code shows, it just tick the clock (with the "yield" statement) and read the "output" register and print it.

Of course you could connect this "Project Euler 1 accelerator" to a CPU, a SoC or whatever, or just connect LEDs directly to "output"