Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The memory chips respond by sending the contents of the selected memory cell over the data bus to the CPU.

What does that ROM memory cell _physically look like_? How do we physically manipulate it to contain a 1 or a 0 (absence of something)?



Each type of memory has a somewhat different design, but generally, the address lines will control a pair of demultiplexers, one which activates a single row in a rectangular grid of memory cells, and one which reads a single column. (Old DRAM chips had separate RAS and CAS — row address select and column address select — phases.) Each memory cell in that row puts its value onto its column line, and the column portion of the address determines which column line is routed to the output pin and fed back to the data bus. Multiply everything by 16 for a 16-bit memory bus.

The memory cell itself might be a handful of transistors forming a bistable flipflop (for SRAM), or it might be a capacitor and transistor (for DRAM), or a floating gate and transistor (for EPROM), or just a wire and transistor (for mask-ROM).


For (much) more detail I can recommend Drepper’s “What every developer should know about memory” paper. Don’t be afraid by its publication date, it is still very very relevant.


There are several types of ROM available. The type you would find in most 8-bit computers from Atari, Apple, Commodore, Radio Shack, etc. would be chips pre-programmed (aka a Mask Read-Only Memory) at a factory with the contents, such that each bit is set high or low and cannot be changed at all.

Then there's PROM (Programmable Read-Only Memory), which is "empty" (either all 0, or all 1, I don't know the full details) but can be programmed once and that's it. Then there's EPROM (Erasable Programmable Read-Only Memory), which can be erased (by exposing the actual chip to UV light), then reprogrammed. Then there is EEPROM (Electrically Erasable Programmable Read-Only Memory) which can be electrically erased and reprogrammed. For each type of ROM, once programmed, it good for years, if not forever.

The programming of a PROM, EPROM or EEPROM usually consists of applying a higher than normal voltage to the chip on certain pins and is usually done in a separate device. How these chips works internally (how the gates are arranged, erased, programmed, etc.) is not something I know (being into software). This is just stuff I picked up over the years.


my understanding is that there is a thin trace (a fuse) at each cell. in order to program it, the address lines are manipulated to select the word, and a programming voltage is applied (for some reason I remember 18v, but it really could be anything), that draws a large current across the fused and blows it.

on a die, you wouldn't go through that trouble, you would just directly synthesize the zeros and ones.

but we don't really use ROMs that much anymore, they are usually persistent and programmable


Many modern microcontrollers have programmable fuses for security reasons.


Internally? Imagine a grid of wires where each address is one vertical wire and each bit of the output is one horizontal wire. The output wires have resistors pulling them up to 5V. To select an entry in the ROM you pull its corresponding vertical wire to ground.

Now here's the clever bit - there are diodes between the vertical and horizontal wires. When you pull a vertical wire to ground it pulls all the horizontal wires connected through diodes to ground, putting a 0 on those pins.

In a real "mask programmmed" ROM the grid is more square, so there are a lot of horizontal lines grouped in 8 bit bytes.

In an EPROM the diode is replaced by a little MOSFET. By applying a high voltage to its gate it'll stay charged basically forever, switching on and forming a "0" in the output.


A peer mentioned different types of memory and flip flops. I’d search for JK flip flop or D flip flop/latch for conceptual pointers. Those can be used to build up register files. The logic gates used to build flip flops/latches use things like NMOS/CMOS/PMOS - different kind of metal oxide seniconductor logic based on substrate. The differing behavior affects how you arrange circuits (voltage source, ground, etc) to provide desired logic from inputs (keywords: pull down/pull up network). Once you have logic and memory, you can build control units and things like arithmetic logic (look up von Neumann/Harvard architecture).

I’m not an expert in modern hardware, but these are the basic principles I recollect. Happy to be corrected if this answer is dated :)


The standard decomposition is

--The instruction set is the lowest level of user-visible software. The instruction set is implemented (in principle) by microcode.

--Microcode (if present) is a bunch of hardwired logic signals that cause data to move between subunits of the CPU in response to instructions. Register transfer specifications govern the design at this level.

--A CPU is a collection of subunits including registers, arithmetic units, and logic gates.

--Registers are collections of flip-flops.

--Arithmetic units are made of logic gates.

--Flip-flops are made from logic gates in feedback configurations to make them stateful. State machine theory governs the design of these circuits.

--Logic gates are stateless and made of transistors. Boolean algebra governs the design at this level.

--Transistors are made of NMOS or PMOS or bipolar silicon junctions. Device physics and electrical properties govern this level.

This abstraction hierarchy is useful when learning, but in the real world the abstraction layers are much blurrier: Everything's really just transistors, stateless stuff often has invisible state, electrical considerations matter at every level, etc.


I found this video a long time ago about this and it's a great way to understand it if you're a visual learner

https://www.youtube.com/watch?v=7J7X7aZvMXQ&t=5s


This is an excellent video of exactly how RAM works. Now to find one for the various types of ROM!



For RAM, but I was asking about ROM. Since [type]ROM keeps its state for a long-term (looks like some manufactures claim 200 years shelf life under optimal conditions), I'd imagine it wouldn't use capacitors holding an electrical charge that require any form of refresh like RAM.




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

Search: