DIY RAM Memory- Register Style by Teslaling
Featured
**UPDATE** I also made a CMOS version here: http://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.
 
Remove these adsRemove these ads by Signing Up

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

1-40 of 99Next »
booliminator says: Mar 10, 2013. 4:35 PM
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.
~CableGuy says: Jan 8, 2013. 2:31 PM
How about this?
1s.jpg
robot1398 says: Apr 23, 2011. 8:36 AM
can i use 1.2k ohm instead of 1k ohm
Teslaling (author) says: Apr 23, 2011. 9:27 AM
Yeah, anything higher than 1k should work.
robot1398 says: Apr 23, 2011. 8:37 PM
ok i will post some pics when i am finished
Teslaling (author) says: Apr 24, 2011. 2:05 PM
Cool!
robot1398 says: Apr 22, 2011. 7:56 PM
can i use bc548
i have about 50
jensenr30 says: Mar 3, 2011. 9:04 PM
Check out this schematic! I painstakingly slaved away on my D Latch memory for all the world to see!
here is the schematic.
snapshot (1).jpgD Latch Memory.png
jensenr30 says: Mar 9, 2011. 3:13 PM
With the LED on, it draws an additional 5 mA (Milliamps) as compared to having the LED off.
The circuitry itself draws anywhere from 1 mA to 2 mA depending on the state of the data input. If the data input is HIGH, the circuitry will draw 1 mA more compared to when the data input is LOW

The most this will draw is 7 mA.
The least this will draw is 1 mA.
robot1398 says: Apr 21, 2011. 11:19 PM
can i store data in it
jensenr30 says: Apr 22, 2011. 7:29 AM
it becomes immensely more practical to store bits after I soldered up my design!

Inst'ables.com is not allowing me to post pics in comments right now, so I'll just post some links to them:

http://i137.photobucket.com/albums/q208/rtty_the_pivot/100_9730.jpg
http://i137.photobucket.com/albums/q208/rtty_the_pivot/100_9731.jpg
http://i137.photobucket.com/albums/q208/rtty_the_pivot/100_9730.jpg
Teslaling (author) says: Apr 22, 2011. 11:09 AM
Thats cool!!
jensenr30 says: Apr 22, 2011. 7:46 PM
thx
Teslaling (author) says: Apr 22, 2011. 6:55 AM
How much are you talking?? Bits, bytes, kilobytes, megabytes??? If you want to store more than a few bits or a byte, its not practical.
robot1398 says: Apr 22, 2011. 7:56 AM
ok if i want to store something less than a bit
can i store it
if yes how
Teslaling (author) says: Apr 22, 2011. 11:09 AM
A bit is the smallest piece of information you can store, a 1 or 0.
robot1398 says: Apr 22, 2011. 7:27 PM
you made 3 bits so you can store 3 bits
am i correct
how can you store data in it
jensenr30 says: Apr 22, 2011. 7:47 PM
I only made one. i gave you three pictures of the same thing. so i can only store one bit.
robot1398 says: Apr 22, 2011. 8:50 PM
how do you put data into the circuit
jensenr30 says: Apr 23, 2011. 8:11 PM
If the "D" (data) input is at the desired state, pulse the "Latch" (write) input fairly fast to set the LED (the output) to whatever logic level "D" is.

When i say "pulse the 'latch' input", I mean turn it on and then turn it off.
robot1398 says: Apr 22, 2011. 8:11 PM
ok
i am trying this
i have about 50 bc548s
jensenr30 says: Apr 22, 2011. 7:27 AM
it becomes immensely more practical to store bits after I soldered up my design!

Inst'ables.com is not allowing me to post pics in comments right now, so I'll just post some links to them:

http://i137.photobucket.com/albums/q208/rtty_the_pivot/100_9730.jpg
http://i137.photobucket.com/albums/q208/rtty_the_pivot/100_9731.jpg
http://i137.photobucket.com/albums/q208/rtty_the_pivot/100_9730.jpg
Teslaling (author) says: Mar 9, 2011. 4:33 PM
That's interesting, so it is drawing a lot less current then my circuit at 15-20mA per bit. What ate the values of your resistors? I used 1k ohm for everything, mainly because they were what I had available. If I had a bunch 10K's or 100K's I would have used them instead.
jensenr30 says: Mar 9, 2011. 7:42 PM
            I am using 10 Kohm resistors. If you would like to try one of my AND gates out, (I don't know if they are unique or not) here is the schematic:
===http://i137.photobucket.com/albums/q208/rtty_the_pivot/ANDgate.png===

            I suggest R1 and R2 to have a value of anywhere between 10 Kohm and 100 Kohm.
R3's value has to be less than R2. preferably half the value of R2.

            The reason for the addition of R3 into the gate is to keep the base-emitter leakage in check. If I make input B HIGH, that high current will go through the base and out the emitter of the transistor. This current will ultimately end up at the output (X) of the gate. The LOW current coming through R3 is going to be double the HIGH current of R2 if the value of R2 is double R3.

            From this we can see that the LOW current from R3 and the HIGH current from R2 will both meet once they have gone out the emitter of the transistor. Now that they have met, the signal with more current will take over. Since the LOW signal from R3 is double the current of the HIGH signal from R2, the output will be LOW.
            Alternately, When A is HIGH, it allows a HIGH signal with much more current than the R3 LOW signal to "take over" the emitter as the dominant state, and the end result being a HIGH output (X).
=====thanks for reading!=====
AND gate.png
Teslaling (author) says: Mar 4, 2011. 12:15 PM
Thats awesome! Great Job!!
jensenr30 says: Mar 6, 2011. 7:42 AM
thanks
jensenr30 says: Feb 23, 2011. 7:41 PM
Couldn't I replace the two YES gates (buffer gates) with AND gates?
Teslaling (author) says: Feb 24, 2011. 7:27 PM
You could, but I did some tests with RTL AND Gates and I got some wierd results. Because of the configuration of an RTL AND gate, when one of the inputs is high, say A. Then the output is semi-high, about 2V with a 5V rail. However, if only B goes high, the output is still low. That's why I created that configuration.

If you were to use CMOS or true TTL, then the AND gate would work normally, but with RTL, it doesn't work right.
jensenr30 says: Feb 25, 2011. 6:23 AM
For a larger image of the below schematic, click here
jensenr30 says: Feb 25, 2011. 6:17 AM
You can fix that with a pull-down resistor of less value that the resistor connected to "B". (10,000 < 22,000)
This ensures that even if B is HIGH while A is LOW, the HIGH current given to B will not be more than the LOW current from pull-down resistor. (remember that the current given to the base and collector both go to the emitter)
One AND gate RTL.png
Teslaling (author) says: Feb 25, 2011. 12:22 PM
That might work, but the problem I had was when B went high, the little bit of current, even from a 100k ohm resistor was enough to be amplified into a full 5V signal by the next transistor. Its just one of those things that can easily be fixed on paper, but doesn't work in real life, cuz small signal transistors amplify the current too much. I tried putting a pulldown resistor below the emitter of B, but again, the resistor still created a voltage divider that let some current go on to the next stage, enough that it was amplified into a full 5V about 2 gates down.

The current best solution I've found is to make a NAND gate, and invert the output. But if that circuit works for you, then go for it!
jensenr30 says: Feb 25, 2011. 2:06 PM
Very interesting...
Good chat.
jensenr30 says: Feb 23, 2011. 8:59 AM
Could you upload the schematic file of your transistor memory? I would really appreciate it if you would! I use CadSoft:Eagle too and I'm loving it!
Jmmaroli says: Dec 26, 2010. 1:28 PM
Great Instructable! I built this using logic gate IC's but the only problem is that when the bit is locked at 1, it stays on for a bit and then goes to the 0 state after sometime, could the gates just be leaky or what?
pyrohaz says: Dec 8, 2010. 3:41 AM
Surely for the output stage, using a common emitter stage would be better so it doesn't invert the output?
Teslaling (author) says: Dec 8, 2010. 12:31 PM
I inverted the output because I accidentally connected the LED to ~Q so when D was 0, the output was 1! If you connect the LED to Q, then a common emitter stage would be better.
parukboy says: Dec 2, 2010. 9:03 AM
I don't think I understand the gated buffer properly. Okay heres what I know

D = 1
WE = 1
Q will = 1

THEN

D = 0;
WE = 0
Q will = 1 because when R & S = 0 , Q = 1

BUT

D = 0
WE = 1
Q will = 0

THEN

D = 1;
WE = 0;
Q will = 1 because when R & S = 0, Q = 1

Or have I gone wrong somewhere ?


Teslaling (author) says: Dec 2, 2010. 3:28 PM
I understand your confusion, it is hard to explain because the WE is letting the signal go past when it is 0, and blocks the signal when it is 1. Thats why I referred to it as "active" in the pictures, meaning that it will allow the signal to pass.

When:
D = 1,
WE = 0,
Then:
R = 0,
S = 1,
Q = 1

When:
D = 1,
WE = 1,
Then:
R = last state,
S = last state,
Q = last state

When:
D = 0,
WE = 0,
Then:
R = 1,
S = 0,
Q = 0

When:
D = 0,
WE = 1,
Then:
R = last state,
S = last state,
Q = last state.

When R & S are 0, then Q becomes latched on the last signal input. Remember also that the WE does NOT make the signal 1 when its 1, it lets the data signal pass, so it the data is 0 then the output of the gated buffer is 0.

I hope that this clarified things for you :)
beehard44 says: Nov 15, 2010. 1:55 AM
is it possible to use an ordinary ram stick (i have a few laying around) and use it for analog datalogging?
Teslaling (author) says: Nov 15, 2010. 12:15 PM
You would need to convert the analog signal to digital using an ADC, then be able to write to the ram stick. The biggest problem i see is finding a microcontroller that can interface with a ram stick (if your talking about the ones in computers) they have a lot of pins and are quite fast.
1-40 of 99Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!