Friday, April 13, 2007

yinyang thoughts (2)



Yin is sitting in his usual demeanor, calmly watching the waves of the sea. Yang is pretty excited like a child, “ What is it Yang, you seem pretty pumped up” questions Yin. “Yin I learned a lot today. Everything in the world of computers depend upon a simple logic called the Boolean Logic: True or False or rather a 1 or 0.” Yin ponders for a minute and nodding his head says “ Umm I understand….Its like the real world where everything depends on only two things truth or untruth. Yang goes on… “ There are seven simple gates I learned about, using them we can build any digital component you can imagine
” Like seven gates to heaven …. Sounds interesting… please go on“ says Yin

There are three primary gates, NOT, AND and OR gates. The NOT gate is called the inverter meaning if the input is 1 the output is 0 and vice versa. The AND gate peforms a logical “and “ operation on two inputs meaning if input A is 1 and input B is 1 the output Q is 1. But if input A is 1 and B is 0 or A is 0 and B is one or A is 0 and B is 0 resluts in a output 0. Where as the OR gate is like the logical “or” operation meaning if A is 1 or B is 1 (or both are 1) then the output Q is 1.

These are the three and its easy to know the other two gates called the NOR and the NAND gates. “Wait a minute says Yin “ . “I think I got it, does it mean t negates the output of OR gate and AND gates respectively “. “Exactly says Yang”. “There are two more called the XOR and XNOR gates. The output of XOR is 1 only if A or B is 1 and not both. XNOR gives a 1 only if both A and B are same meaning they should be either both a 0 or both a 1. “

“ Now with these basic gates adders, multipliers can be created and all the mathematical operations can be performed “. “But the most important thing you can do with these gates is make it hold on to its value meaning we can create memory out of these. A circuit which does this is generally referred as a “flip flop”. “Fascinating, Its like how we cling on to our past forgetting the now, may be there are millions of flip flops in our head says Yin ”.

“Yin it’s even more fascinating when you find out that the physical implementation of these gates is on a submicroscopic transistor etched onto silicon chips. And there are millions and millions of them on a single chip.”

"Yang I am reminded of a Zen story when you talked about the flip flop, the circuit which holds on to its value." says Yin and starts narrating the story as Yang listens attentively.

There were two monks, one old and the other young, crossing a river to reach their monastery on the other side of the bank. As they were wading through the neck deep water, the monks hear cries for help. They notice a young girl struggling against the current in the river. The Younger monk comes to her rescue and lifts her in his arms and takes her safely to the bank. The monks then retire in their monastery. Its night and the younger monk notices the older one being perturbed. He asks him the reason. The old monk tells him that he should not have done that. The younger monk asks him what. The old monk tells him being a monk he should not have carried her in his arms, for this the younger monk replies " I left her at the bank and you are still carrying her ". The old monk realizes his folly and apologizes to the younger one.

"Did you get the story Yang " quizzes Yin. "Yeah , that machines can have memory but we as humans should live in the "Now" and not carry our past". "Exactly says Yin".

Yang is in a hurry to leave. "Sorry Yin I can't wait to learn more, tomorrow I would tell you how computers work ". Yin looks at Yang and smiles "you are like the waves of the ocean excited to reach the shore, But remember you like the waves you too would calm down soon." Yang does not trouble his head to comprehend what Yin said and leaves in a hurry as Yin settles down calmly to watch the waves of the sea.