i am going to show you how to make some 4-bit RAM memory along with a controller, allowing you to save several different nibbles of information in the same system.
I will warn you now, i live in the UK and use European electronic symbols so if you dont understand anything don't hesitate to ask!
Step 1: System Planning
Step 2: Flip-flops
we are using flip flops, as the clock allows a short pulse to freeze the input at D to the output at Q untill the next clock pulse. for example, i could make the input at D be high, and then pulse the clock high for a short period of time (for a D type flip flop it is the rising edge, not the pulse that triggers the clock) then the output, Q, would become high. it will remain high untill either the reset input goes high, or the input at D is low and the clock is pulsed again. for the Ram we will use the D input to input the bit to be written to the memory, and Q as the output for reading the stored bit. to write a bit to the memory we will need to pulse high at the clock to create a rising edge (or a falling edge if you have falling edge triggered flipflops.
The second picture shows a simple RAM system made only from flip-flops. for some projects this will be more than sufficient so fell free to stop reading here :)
there are however some disadvantages of using this simple RAM system. it has seperate input and outputs, which, when using breadboards and pcb's, where space is a large factor, this is an inefficient use of wiring. for a single module of RAM it is fine, but when you start to get multiple modules you start to use lots of space in just wiring. in the next step we will ad an extra component to the RAM, and we will only have one data bus for both inputs and outputs
Step 3: Tristates
The third picture shows the same system but implemented with Tristates (or if you dont have tristates you could use an AND gate with a diode). this way is much better as we now only have a single wire for inputs and outputs, and you really see the benefits of using the tristates in pictures 4 and 5.
Step 4: RAM Controller
The second picture shows my RAM controller. when a Rising edge is present at the clock of the first flip-flop, the counter counts up by one (as d is connected to NOT Q). for each pulse it counts up by one. when the counter output is 11, the output of the reset logic becomes high, making the reset inputs of the counter high. this makes the counter reset back to 00. the counter output controlls which output that the de-multiplexers are connected to. for example, if the counter output is 01 then the de-multiplexer would be connected to the output second from the top (where the arrow points in the diagram is allways the multiplexer state at 00). you no only have one read and one write input - plus the counter input. you could - if you dont mind the RAM allways reading its contents to the output except when writing make the Write input equal to 'NOT Read' with a not gate (or a NAND gate with both inputs tied together if you are using NAND logic)
Now we have the RAM controller we have got a fully functioning one and a half bytes of 4-bit RAM! imagine trying to make enough for a modern computer this way D:
Step 5: The End
I hope you have enjoyed my first instructable and found it informative. i actually quite enjoyed writing it and it is good revision for my upcoming exams. when i assembled my RAM in my coursework it worked flawlessly first time, which i was very pleased with because if it had not i would have had to spend a VERY long time fault finding. i hope that some of you wil try to make your own RAM, there is something satisfying about building something which can remember stuff you tell it ;3.