ROM is a major part of a computer, and even more so in gaming consoles. How exactly do they work, and how can you make them with logic gates/transistors? I'm currently working on many projects, including a calculator and a 1-bit computer. I'm wondering if it can be used in my projects, or if it's simply too expensive in terms of parts. Can you please show me how it works, and if I can use it in my designs?
-
4`How exactly do they work, and how can you make them with logic gates/transistors?` This question is far too vague. There are entire university courses that would answer this question. Is there something specific you're wanting to understand? If you want a starting point, I'd suggest looking into what an ALU does and understand some Assembly. – Feb 27 '20 at 19:55
-
1Your question is too broad, but I have some time to make an answer just to give you the bare minimum. Only really enough to give you a sense of how things are. – DKNguyen Feb 27 '20 at 19:56
-
2Nonvolatile memory can be purchased as chips, or you can make primitive ROM with diodes in a matrix. If you are patient, solder well, and need fewer than (say) 1000 bits the diode method might be practical. If you need more, something like a MT29F128G08CFABBWP-12IT:B which holds 17,179,869,184 x 8 bits might be more practical than buying 128 billion diodes. – Spehro Pefhany Feb 27 '20 at 20:02
-
1ROM is no longer a big thing in gaming consoles. – user253751 Mar 05 '20 at 18:35
3 Answers
There are several ways of making ROMs. The first is a true ROM, a mask ROM, where the contents are determined at the time of device manufacture. A mask ROM consists of a set of bit lines and word lines, interconnected by diodes at each crossing. An address decoder drives one word line based on the input address, and the output data appears on the read lines. The manufacturing process determines which diodes are present or connected to determine the contents of the ROM.
Other types of "ROM" include PROM, EPROM, EEPROM, and Flash. PROM can be built just like ROM, but with fuses or antifuses in series with each diode that are "blown" by the programming hardware to determine the ROM contents. This can only be done once. EPROM, EEPROM, and Flash are all built more or less the same way - with "floating gate" transistors that can store charge for extended periods of time, the only difference is in how they are erased: EPROM devices have no provisions for erase aside from a window to allow in UV light to release the stored charge. Incidentally, an EPROM without a window is also effectively a PROM. EEPROM devices also contain circuitry to drain the stored charge on a byte or word basis. Flash devices are basically higher density EEPROMs that erase on a page or block basis.
How would you build one? Well, you can't buy discrete floating gate transistors, so you can't build your own EPROM, EEPROM, or Flash. You could only realistically build your own ROM with discrete components. To do that, all you need to do is build an address decoder and a large array of diodes. Which diodes are installed determines the ROM contents. You'll probably also want a buffer on the read data and pull-up or pull-down resistors so that bit lines with no diode connected read correctly.
You might also want to add a column decoder and output multiplexer to make the ROM more efficient in terms of component count. For example, a 256*8 ROM can store 2048 bits (and as such can require up to 2048 diodes). If you build it as a 256*8 ROM, you need to drive 256 word lines, but you can use the output word directly. If you build a 64*32 ROM, then you only need to drive 64 bit lines, but you need a 4 to 1 mux to select the output byte you want. Same number of diodes, and you need and output mux, but the address decoder is 1/4 the size.
So they require a huge number of parts, they are quite tedious to make, and they require a soldering iron to re-program.
One possible alternative is to roll back a few years to the era of core memory and build yourself a core rope memory. With one of these, the bit lines pass through all of the cores (well, sort of), and each core represents an entire word of memory. For a 256x8 core rope memory, you could use 256 cores, 8 bit lines, and 256 word lines. Or possibly two sets of 16 select lines, where two must be driven to select a core. Much better than 2048 diodes. Obviously this is rather different from a transistor and diode based ROM, but it would likely require fewer components, and can be reprogrammed by re-threading the bit lines through or around the cores.

- 40,694
- 1
- 68
- 109
-
1I think these types of ROMs are just a wee bit more advanced than what the OP has in mind. People who want to build 1-bit computers tend to be trying to do things from scratch as much as possible. – DKNguyen Feb 27 '20 at 20:55
This is one way to make a simple NAND gate: Note that both input A and input B must be HI to connect Output to GND and override the pullup resistor R1 in order for Output to be LO, otherwise output will be HI.
simulate this circuit – Schematic created using CircuitLab
So how do I use this to make one bit of ROM? I can do this
The "Read_Enable" input is driven HI whenever I want to place the stored data bit on the output. I tie the input line for the Stored Data Input HI or LO depending on what I want to store. Note that since I am using a NAND gate, I would tie the input LO in order to output a HI, and I would tie the input HI in order to output a LO. If I used a AND gate instead of a NAND gate, I would tie the input to the same signal I wanted to output, but an AND gate takes more transistors which would have made my first transistor-level circuit more complicated because I would need to place an extra transistor on the output of my transistor-level NAND gate to turn it into an AND gate:
This would make the thinking easier, but it would make the circuit more complicated.
The next step is to tie a bunch of these together and make it so you have a bunch of bits storage cells connected to the same line, and make it so you could select which bit storage cell you wanted to read from. I used transistor and gates here because it might be easier to understand.
A version of this using regular push-pull AND gates and OR gates might be easier to understand:
But using logic gates is kind of overkill, especially when you need a lot of bits. It's just easiest to understand it with logic gates.
The method shown so far has a read signal for each bit that passes it to the output. This is very similar to a multiplexer where you tie the multiplexer inputs HI or LO depending on the bit you wanted stored, and then use the address lines to connect the output to the input line storing the bit you want to read. This could also be considered a lookup table as well.
But you can see that it can get hectic with so many parts so it can be less parts to do the same thing with a diode instead of transistors.
In this example, you drive one and only one of the Read lines HI to select which bit you want to read. All the others are LO. The bit is stored based on whether or not a diode is actually there. If a diode is there, then when the Read line is driven HI, it will pull the Output HI. But if no diode is there then the resistor will continue to pull the Output LO.
You can make enormous grids like this with many fewer and cheaper parts than logic gates. You can also make it so driving one line HI drives the line for multiple outputs HI so you can read multiple bits at one time in parallel.
In my example, above, there was a pull-down resistor, pull-up diodes and you drove the read line LO. In the example below, it is the oppoposite: there are pull-up resistors, pull-down diodes, and you drive the read lines LO (via the decoder, it drives the active output LO and the inactive outputs are either HI or high impedance).
Taken from: https://www.eeeguide.com/rom-read-only-memory/
Your question was really broad, but hopefully this gives you an idea of how you can make simple read-only memory from scratch. As seen, there's a lot of ways you can approach this and there are stranger, more analog forms of memory as well such as magnetic and rope-core. But it's all the same principle. It's really just about finding a way to tie a signal HI or LO (which represents the stored bit), and then finding an efficient, cheap, and simple way to select and pass that signal to the output. In more analog forms of storage such as rope-core memory, you just try to detect whether something is there or not, whatever that "something" may be rather than tying a signal HI or LO. It's nothing magical.

- 54,733
- 4
- 67
- 153
simulate this circuit – Schematic created using CircuitLab
Figure 1. A simple ROM arrangement using diodes.
Here when an address line (A0, etc.) is pulled high any of the data lines (D0, etc.) fed by diodes will be pulled high. Where the diodes are missing the output would be low (although a pull-down resistor on each data line might be required to make sure). The arrangement on the right, if read sequentially from left to right would return data:
Table 1. ROM data.
DDDDDDDD
76543210
-- --------
A0 10011101
A1 01101111
A2 00010000
A3 11111111
After you've done a few dozen of these you'll see why EPROM was much more successful.
Figure 2. An Intel 1702A EPROM, one of the earliest EPROM types, 256 by 8 bit. The small quartz window admits UV light for erasure. Source: Wikipedia EPROM.
See my answer to EEPROM is a "Read Only Memory," so why can I write to it? for a little more on the topic.

- 168,990
- 12
- 186
- 385
-
1
-
1Nobody makes ROMs the way I have shown because it wouldn't be possible to program them. This is just a very basic way of achieving what you want. See @alex's answer for details on how real ROMs are made. – Transistor Feb 28 '20 at 06:58
-
1
-
1Yes, but before you start you should figure out how many bits of memory you require. Then decide if diodes are the way to go. – Transistor Feb 28 '20 at 16:41