Introduction: DIY RAM Memory- Register Style
**UPDATE** I also made a CMOS version here: https://www.instructables.com/id/DIY-CMOS-RAM-Memory/
If you have ever looked at a microcontroller's datasheet, you have probably seen something about registers. Registers are little one or two byte memory storage units in microcontrollers. The register in this instructable can hold 3 bits of data (b/c I ran out of room on my breadboards) using transistors. I did this to prove that I can, however, its not practical as an 8 bit register requires 64 transistors, about 64 resistors and lots of space.
The register is a neat device. It can recieve data when the enable input is, in my circuit, low and it can then latch and save the data even it the data line is changing. My circuit is not the conventional D-type latch because it used more transistors than I had.
Step 1: Materials
The materials for this project are quite simple as it is a prototype kind of project.
8 NPN transistors for each bit - mine is 3 bits (do the math)
8 resistors for each bit - 1K for the supply connection and 1K or more for signal. get a few more (you will need some more)
A pushbutton switch - N.O.
A DIP switch - at least 4 switches
A solderless breadboard - if you dont have one then your missing out because these things are great
An LED for each register to display the stored bit
Some wire
Pliers are a great help for placing wires in tight places
Step 2: What's Going On?
The basis of the circuit is the SR Flip Flop. This flip flop circuit uses 2 inputs, Set and Reset, to control 2 outputs, Q and ~Q (not Q). When the Set line goes high, Q will go high and stay high even after Set goes low. If, however, Reset goes high, then Q will go low and ~Q will go high.
Now the question becomes how do we make all of this happen with only one input? We do this by connecting the data line to the Set input and connecting it to the Reset line through an inverter.
So far, when Data is high, Set is high and Reset is low so Q is high. If Data goes low, then Set goes low and Reset goes high making Q go low and ~Q go high. Now we have another problem. The register changes states when the Data does, it doesn't latch like we want it to. How do we fix this? By adding a Write Enable. We can do this by adding a gated buffer. It acts as a switch so if the switch line goes high or low the buffer will either turn off or on, respectively. Now, even when the data line can change states, the data can remain the same.
Step 3: The Circuit
So now that you know what is going on, we can begin to construct the circuit. When starting the construction, I would recommend placing the NOR gate transistors on the board first. it makes things much easier as you go along. The output transistor is needed because there isn't enough power to drive the led brightly. If you notice, it is an inverter in the circuit diagram, however, whether or not you have to invert the signal going to the led is based on which NOR gate you take the output from. If the led's state is opposite of that of the data input, then you must either change which NOR gate you take the signal from, or change the transistor's output (inverted, or non-inverted).
Step 4: You're Finished
Now, you should have a working register! If you don't check your wiring very closely, any mistake could produce very undesirable results.
If your are familiar with registers, you may be asking why I didn't go with the conventional D-Flip Flop or D-Latch. The main reason is that I wanted to challenge myself. I did't want to get online and look up a circuit, i wanted to design my onw. I would also need another transistor for each bit in order to make a D-Flip Flop. So in my opinion, i made an efficient circuit.
I will be remaking the circuit with MOSFETs in a CMOS arrangement so check it out when I finish it!!
***Check out my "macroelectronic" 4 bit calculator, https://www.instructables.com/id/4-Bit-Binary-Adder-Mini-Calculator/
82 Comments
Question 2 years ago
how does this thing work?
Answer 2 years ago
i dont know
Tip 2 years ago
i used a 5v regulator for a stable 5v
2 years ago
i understand how it works, but i would like more explanation on how to build it.
3 years ago
Hi, it's cool application but I wanna ask that why you didn't use bistable multivibrator instead of two NOR gate ? Cause you can use only 2 BJT to construct RS flip-flop.
6 years ago
how do you program this?
Reply 5 years ago
has no MCU , you dont need to program this. Its all done through hardware
7 years ago
I don't really understand this circuit. Where would you connect the resistors and the switches and the LEDs. How would the LED glow, indicating the previous state and present state, as in a shift register.
8 years ago on Step 3
I don't get the transistor that is connected to the led because the emitter is connected and also the collector to the led.If i connect the ground to the emitter which is negative and if i connect the positive to the collector it is going to be short circuited.I hope you will understand what i mean.
10 years ago on Step 4
This is really cool and I built one on my breadboard following your schematic. (I only build 1 bit, just the minimum following your schematic.) Just to be sure, when i power up the circuit my LED is in an 1 state. When I push the momentary switch the LED remains in its current state. When I switch the DIP-Switch to the other position, and press the momentary-save switch, the led goes to the 0 state. And the same happens in the opposite 0 to 1 state. Im really trying to understand logic gates and computers more deeply and flip flops are new to me. Is what i described proper operation? Thanks so much.
10 years ago on Step 2
How about this?
12 years ago on Introduction
can i use 1.2k ohm instead of 1k ohm
Reply 12 years ago on Introduction
Yeah, anything higher than 1k should work.
Reply 12 years ago on Introduction
ok i will post some pics when i am finished
Reply 12 years ago on Introduction
Cool!
12 years ago on Introduction
can i use bc548
i have about 50
12 years ago on Introduction
So how much and how large would a 4GB cluster be?
Reply 12 years ago on Introduction
Well 4GB*1024*1024*1024*8=34,359,738,368 bits!!! And if 1 bit takes up a small breadboard (the small one from Radio Shack) then its gonna take up a huge amount of space!!!!! Also each bit uses about 20 mA (in my circuit) so it would take 687,194,767.36 Amps of current!
Reply 12 years ago on Introduction
So it's a better idea to buy a premade stick? Lol.
Reply 12 years ago on Introduction
It's more practical to buy a stick if you're looking for more memory. But it's better to build if you're looking for experience and a challenge.
PS, I briefly considered the same thing about making my own memory too, but figured there must be a reason why no one is really doing that. lol