Tuesday, May 12, 2009

Boolean algebra

Digital electronics is based on boolean algebra, , it is mathematical binary system, as in decimal system we use digits from 0 to 9 and get the value of a "number" by multiplying every digit with " 10th order for that digit " and then adding all, so in binary we express number using only two digits 1 and 0 and use power of 2, to get the value of number ,
in decmal 987 = 9 x (10^2) + 8 x(10^1) + 7 x (10 ^ 0) = 9 x 100 + 8 x 10 + 7 x1

in binary 101 = 1 x (2^2) + 0 x(2^1) + 1 x (2 ^ 0) = 1 x 4 + 0 x 2 + 1 x1 =4+0+1 =5

Boolean algebra is set of rules of addition , subtraction , OR , AND ,NAND operation for binary digits,

The Beauty of boolean algebra is that you can directly copy it on electronic ciruits , you have just two states "1" or "0" , not like 10 (0-9) , in decimal , and with those two states you can express any mathematical ,physical quantity, so if i consider "1" to be on state of my circuit , then "0" will be off state and vice versa. Now using semconductor devices ciruit could be formed which execute boolean operations like AND , OR , NOT , NAND , you are not giving any "number " to a ciruit for addition , you are applying a combination of high (1) and low (0) ,
to the inputs of ciruit , and the output is a sequence of high and low voltages , the only thing is that it is exactly boolean algebra if you have assumed a high voltage to be boolean "1" , and a low voltage to be "0".

So when in a calculator you press 9 that "high" "low" voltage combination appears on some pins of the inside microcontroller , how you see "9" on the display , microcontroller program , glows those segments of LED , or LCD , which are required for Digit "9" , its not like that there is some unchangeable relation between pressing "9" , and "9" being displayed, that you pressed 9 and that's why 9 is there on display , no !!! it is made like that , if you change the program of microcontroller you may show some other digit for the "9" button ,
All digital electronics is like this , "rules" are made , ciruits which do calculations , are made to imitate boolean algebra, and there are other parts of that system , which take the "boolean output" and control some output device in accordance with that so that humans can interpret them, that is all made by us , for our own interpretation .

No comments: