Live data from Hacker News

Silon – Adders and Logic Gates in Pure CSS

silon.slaks.net

21–30 of 40 posts

Re: Silon – Adders and Logic Gates in Pure CSS

#21
post #13

Earlier quoted context omitted.

Using a lookup table is a valid way to implement something. It is used often for precalculating expensive functions. (trig tables are very common). This is just one extreme of the runtime-vs-memory trade-off.

On FPGAs, it's actually how most logic functions are implemented. FPGAs are a big grid of SRAM-based lookup tables, some latches and fixed function blocks, and a whole ton of interconnections.

That's correct, typically FPGA logic looks something along the lines of a bunch of logic feeding into a latch the output of which feeds into yet another bunch of logic and so on, and all this synchronized by a clock. The individual lookup tables are quite small, but in the aggregate together with the latches they can perform quite complex functions.

Re: Silon – Adders and Logic Gates in Pure CSS

#24
post #19

Earlier quoted context omitted.

haha, thats a funny thought. I like CSS. I would love for it to have variables so I could consolidate changes and edit them via JS. Sorta like all the CSS-libraries. o.o am i doing it??

I highly recommend checking out LESS -- even if you ignore all of it's features, being able to define variables alone is worth it :)

Yes i have been meaning too

Re: Silon – Adders and Logic Gates in Pure CSS

#25
post #18

Earlier quoted context omitted.

Sure, but if the headline was "CSS can be used to implement a lookup table", it would be much less eye-catching. More to the point, Boolean expressions and truth tables are not equivalent representations that should be treated on an equal footing; there's an exponential blowup involved when converting from one to the other. Just try extending that 4-bit adder to 16 or 32 bits. The functions that can be tractably repr…

The difficulting in actually creating some of these larger lookup tables is, of course, very true. That doesn't mean that sometimes , depending on the problem you're solving, lookup tables can still be a useful (or preferred) implementation method. It is the programmer's job to decide what point on the "using storage" "using CPU time" continuum is appropriate for the current problem. Obviously, larger chained adders…

Yes, but this time it is disappointing. If the website was a tool for learning logic gates, it would be perfectly acceptable and quite clever. However, since the website is saying that it has implemented logic gates in CSS, a natural, if not necessary expectation is that these gates should be composeable, which they are not. Logic gates that can't be fed into each other really strain the definition of a logic gate (its part of the reason that circuits are interesting while a piece of paper with a truth table is not)

Edit: Just to clarify, the disappointment is from being excited that something like this could be wired up the way we initially thought. The result remains cool and clever all the same.

Re: Silon – Adders and Logic Gates in Pure CSS

#26
post #13

Earlier quoted context omitted.

Using a lookup table is a valid way to implement something. It is used often for precalculating expensive functions. (trig tables are very common). This is just one extreme of the runtime-vs-memory trade-off.

On FPGAs, it's actually how most logic functions are implemented. FPGAs are a big grid of SRAM-based lookup tables, some latches and fixed function blocks, and a whole ton of interconnections.

But not a single lookup table. If you can chain lookup tables it's equivalent to any other kind of gate. If you have to process all possible input combinations at once you can't do any meaningful computation.

Re: Silon – Adders and Logic Gates in Pure CSS

#27
post #4

You can implement an adder in CSS? Somehow this reminds me of C++ templates. These things seem to gain power and have new features until they become turing-complete. And beyond...

CSS is already turing complete: - http://stackoverflow.com/questions/2497146/is-css-turing-com... This project doesn't use rule 110, it uses LESS which sorts out the logic while compiling and spits out the results in css.

I still say that doesn't count as long as you have to make the user click on all the cells. CSS by itself is capable of doing a single row of rule 110, but that's not enough.

Re: Silon – Adders and Logic Gates in Pure CSS

#30

Earlier quoted context omitted.

Why?

Because this is hacker news, and this is a really cool CSS hack.

I agree it is a cool hack. I was wondering why you thought it was the coolest thing you'd seen in your life, rather than say this week or maybe even just today.
Post reply on HN