What can be done with NAND gates? We can learn and we can teach computers to learn. To learn we need memory. The smallest bit of memory is called a "BIT" and it can only learn a single thing: It can learn on or off and not forget when we stop teaching it. This next circuit is one type of a bit, called an "RS Flip Flop". The name comes from Reset and Set (which are the two input wires) and Flip Flop which sort of says what it does. Like a card on a table, it can flip or flop one way or the other, but which ever way it lands, it will stay that way.
Note the the first NAND gate in the upper left: It has both it's input hooked to the button. This is a trick that makes the NAND gate into a NOT gate. We could have just put a NOT gate here, but we wanted to show you how any gate can be made from NAND gates. This NAND / NOT gate is here to make the button into a "normally on" type of button. The output of the NAND / NOT gate (at the wire with "/S" over it) is on until the button is pushed, then it goes off for a moment.
The /S just means "NOT Set". A lot of circuits are labled with a "/" before a line to show that they are on most of the time.
Look at the output of the top right NAND gate (the gate is labled "A" and the wire is labled "Q" ). If the Set button is pressed, /S is low, and Q MUST be high. Why? Because if any input to a NAND gate is low, the output will be high. If Q is on, the top input to the lower right NAND gate (labled "B") is on. Now, if the Reset button is not pressed, the "/R" wire must also be high. So both inputs to B are on and the output of B will go OFF. That makes the lower input to "A" off and it "locks" the circuit in the Set position. Now if the Set button is up (off), even though /S is on, the lower input to A keeps that gate on.
You can run through the Reset switch the same way. If Reset is pressed, /R is low so B must be high so A will be low (/S is high) so the top input to B locks it on even when Reset is released and /R comes back on.
If that doesn't make sense yet, keep pressing the buttons while you read the above text again and again until it clicks.
Remy says to remind you that all computer memory is made from bits. 8 Bits are a BYTE and 1 Mega Byte is about 1 million Bytes. FLASH memory is a short name for the real name: NAND FLASH.
Also:
See also:
What would happen if both the Set and Reset buttons were pressed at the same time?
Comments:
| file: /techref/logic/RSFlipFlop.htm, 3KB, , updated: 2009/10/29 08:41, local time: 2009/11/21 22:52,
38.107.191.101:LOG IN
|
| ©2009 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://piclist.com/techref/logic/RSFlipFlop.htm"> Digital Logic, Logic Tutorial, RS Flip Flop, 7474, 7476,7479</A> |
| Did you find what you needed? |
|
Support the PICList by honoring its finest. |
Robotics nuts!Check out http://www.verinet.com/~dlc/ email: dlc@verinet.com... This guy ROCKS! He has made (and sells but also releases code, docs, etc...) for a number of cool little robotic modules including whiskers, IR proximity detect and remote control, Sonar proximity detect, PWM, Servo, compass. Most of these use the little PIC 12C508 controller which costs basically nothing and is soooo tiny.The 4 servos, 2400 baud serial servo controller is a wonder of magic and he sells the programmed chip for $8. Wow! |
.