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.
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.
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/
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/