The diagram above shows a 'decoder.' A and B are the inputs to the decoder and I, J, K, and L are the outputs. The truth table for this circuit is shown below.
A B I J K L 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1
Normally closed relay AA is closed. Normally closed relay AB is also closed. Therefore, electricity can travel from the top of the battery, through AA and AB, to light I.
If keys A and B are both pressed, then normally open relays DA and DB are closed (because their electromagnets are powered) and electricity can reach light L.
Similarly, if key A is pressed and key B is not pressed, then normally open relay CA is closed and normally closed relay CB is closed and light K is on.
Finally, if key A is not pressed and key B is pressed, then light J is on.
Wire PO is power. A1 and A0 are address wire 1 and address wire 0. PO has value 1. A1 can have value 1 or 0, and A0 can have value 1 or 0.
Truth Table Generator
In the preceding circuit, keys A and B are the inputs and lights G and H are the outputs. The truth table for the circuit above is shown below.
A B G H 0 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1
For example, if neither A nor B is pressed, then S00 is powered (has value 1) because the normally closed relays AA and AB are then closed. BB is open so S01 is 0, CA is open so S10 is 0, and both DA and DB are open so S11 is 0. Because S00 is powered, AG is closed and electricity can go from the top of the battery (indicated by a triangle), through relay AG, to wire D1 to light G, so G is on. Relay AI is also closed but relay AI's key is not connected to the top of the battery so no electricity gets to light H.
For another example, if both keys A and B are pressed, then A=1 and B=1 and relays DA and DB are closed. That makes S11=1 and closes relays DG and DI. Electricity can go from the top of the battery through DG and D1 to light G and through DI and D0 to light H. Therefore, A=1 and B=1 results in G=1 and H=1 as in the truth table.
D1 and D0 are data wire 1 and data wire 0. D1 can have value 1 or 0 and D0 can be 1 or 0.
ROM (Read-Only Memory) With Enable (EN) Key (D)
The circuit above has the following truth table:
EN A1 A0 D1 D0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 1 1
If key D (EN) is not pressed ('EN' stands for 'enable.'), then EN is 0, so no electricity gets to the electromagnets of AG and AI. Similarly, BG, BI, CG, CI, DG, and DI are open if D (EN) is not pressed. Therefore, if D (EN) is not pressed, then no electricity can get to lights G and H as indicated in the truth table.
If A and B are not pressed (A1=0 and A0=0), then electricity gets to the electromagnet of AE and closes relay AE. If D is then pressed (EN=1), then electricity can go from the top of the battery, through D and through AE to the electromagnets of AG and AI. AG and AI then close and electricity can go from the top of the battery, through AG, to wire D1 and light G.
The truth table above can also be represented as below.
EN A1 A0 D1 D0 0 X X 0 0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 1 1
The X's mean 0 or 1. That is, the row with X's means that if EN is 0, then D1=0 and D0=0 no matter what values A1 and A0 have.
Page 6 . . . Page 1 . . . Page 8