Saturday, September 29, 2012

Binary arithmetic, logic gates and electronics.

A few years ago, I had a question occur to me: Computers are composed of many tiny wires, each of which can be considered either on (state 1) or off (state 0). Part of the network of all of these wires are various logic gates. So, if computers are logic gates and wires, how can computers add, subtract, multiply or divide? In other words, how can arithmetic be reduced to logic?

In any case, this question really stuck with me, and eventually I started reading about it. It turns out that it is somewhat easy to understand how adding can be done with logic gates, as long as the numbers are expressed in binary. Tonight I created my first simulator in Excel that will add two four-bit binary numbers by only using logic gates. Maybe I can build the actual machine someday? In any case, this simulator seems to work perfectly. Plus one can tell that it should based on an understanding of binary arithmetic and logic. I hope I build this device someday. I considered a string a dip switches for the input number, and either LED's or a binary display (if I can find one) for the output. Transistor logic gates themselves are easy to find. For the logic gate schematic, you will find something similar on page 75 of "How Computers Do Math."

No comments: