Hacker News new | past | comments | ask | show | jobs | submit login

It's funny I was wondering recently if there is a fundamental difference between logic and memory. I mean it's obvious that memory devices can do logic, since after all Boolean tables are just data in the end, aren't they? And reciprocally transistors can be used to store memory (with a flip-flop for instance).

So is it true? Are logic and memory fundamentally equivalent?




Theoretically yes. One is stateful and the other is not, but you can always simulate one with the other. Practically no. DRAM is built with capacitors as its storage elements. Each bit has no feedback and requires refresh, which makes it slow. But it only requires one transistor per bit, so it's cheap and every bit takes up very little physical space. Static RAM, OTOH, (registers and fast cache) is built out of flip-flops. It has feedback so it doesn't need refreshing and it's fast. But every bit requires 4 or more transistors, so it's physically large per bit and expensive.


Can you elaborate on this:

>"Static RAM, OTOH, (registers and fast cache) is built out of flip-flops. It has feedback so it doesn't need refreshing and it's fast"

DRAM also has feedback no? I mean thats what differentiates is from combinatorial circuits correct?

I understand SRAM is flip flops vs single bit transistors. I guess I'm not sure why you are saying it has feedback to differentiate SRAM(registers) from DRAM.


The individual bits of DRAM don't use internal feedback; they work by storing charge on a capacitor that slowly leaks away. Their outputs don't help them maintain their state (except during a refresh cycle, and in that sense one could say they use feedback). The flip-flops in SRAM always have internal feedback that causes them to a) switch state quickly and b) maintain their state after switching. This is an example of positive feedback, as opposed to the more well-known negative feedback used in control systems. I was trying to say that there's more than one way to save state, and it's state that distinguishes memory from combinational logic, not feedback. https://en.m.wikipedia.org/wiki/Memory_cell_(binary)


I see, sure, that makes perfect sense. Thanks for clarifying.


As long as you're talking about non-sequential logic, then yes. You could describe any ROM data as a boolean expression mapping address to data lines, and you can iterate through all possible inputs of a boolean expression to generate an equivalent ROM image.


I've done exhaustive iteration like this to generate truth tables (with feedback -- sone outputs wired to inputs) from a bunch of C if statements for controlling room combining in audio systems that supported truth tables but not code. It does work.


Those LUT's have implied indexing internally, I suspect something akin to indexing is essential.

Logic functions can be composed using any one of: NAND, NOR, XOR, IMPLY, or other units like full-adders etc.

All memory depends on some form of persistance and/or refreshing.

Sometimes this is a physical phenomenon like magnetism or electrical compatence or after-glow in a willian's tube. Short-lived effects need to be refreshed.

Sometimes there is a feedback loop that continuously sustains latching, such as flip-flops.

Magnetic core memory could be less transient than say, a mercury delay line, but needed to be rewriten after being read.

But regarding your question, I think so. If it is possible to impliment one with the other (but memory usually has internal indexing).


Indexing is just multiplexing (more properly demultiplexing) and multiplexing/demultiplexing is just more combinatorial logic.


Yeah. But for a function with parameters there needs to be a way to associate values with parameters. There are different ways to do that, but even a static global would be accessed by address.


At the gate level, "accessing by address" is demultiplexing. It selects one of n output lines with log2(n) input signals. https://en.m.wikipedia.org/wiki/Multiplexer#Digital_demultip...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: