04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

manipulation is one area in which bitwise operations are pretty h<strong>and</strong>y, <strong>and</strong> why I believe<br />

they were included in <strong>Processing</strong>.<br />

OK, but I still haven’t really told you anything about bitwise operations. To begin to underst<strong>and</strong><br />

them, you need to think a little about how numbers are represented on the computer,<br />

<strong>and</strong> to do that you need to go all the way down to the periodic table <strong>and</strong> the<br />

element silicon. (Oh boy.)<br />

Semiconductors<br />

I suspect by now, most of you realize computers groove on zeros <strong>and</strong> ones. Why? Well, this<br />

is actually a pretty interesting story (that I will very highly abridge). The brain of the computer,<br />

or the CPU, is made up of a lot of little data processing units called transistors; you<br />

can actually buy CPUs now that have over 1 billion transistors etched onto a 1-inch-square<br />

silicon chip, with wiring over a thous<strong>and</strong> times thinner than a human hair. (Which maybe<br />

offers some insight into the famous question, “How many angels can fit on the head of a<br />

pin?”) Angels aside, transistors are like little switches that open <strong>and</strong> close, controlling how<br />

electricity flows.<br />

Silicon, a really common <strong>and</strong> cheap element (think s<strong>and</strong> on the beach), has one very significant<br />

property. Its outer shell (we’re on the periodic table now, down at the atomic<br />

level) has four measly electrons that all bond with other nearby silicon atoms, forming<br />

crystal lattice structures.<br />

A somewhat valuable by-product of this tendency to form crystal lattice<br />

structures is the diamond, made from carbon, which is right above silicon on<br />

the periodic table, <strong>and</strong> has a similar property.<br />

Because all four of silicon’s outer electrons form these perfect bonds, there are no free<br />

electrons roaming around, which is not a good thing in regard to electricity, as electricity<br />

requires these free electrons to flow. So silicon, unlike a metal such as copper, is not considered<br />

a conductor. However, it’s not considered an insulator either (like rubber, for<br />

instance). Instead, silicon is classified as a semiconductor. You’ve probably heard the term<br />

semiconductor before, as the entire computer industry is built on semiconductors. So if<br />

silicon can’t conduct electricity, why do we use it, <strong>and</strong> what the heck does this all have to<br />

do with color?<br />

There is a process called doping (no, I’m not contesting Lance Armstrong’s seventh Tour<br />

de France win) that allows silicon to be developed into a controllable conductive material.<br />

The controllable part is what is key here. Using doping, it’s possible, applying the right<br />

amount of current to the silicon transistors, to cause them to conduct electricity; you can<br />

think of the process almost like pushing on a hinged gate—the gate stays shut until<br />

enough force is exerted on it. These relatively simple <strong>and</strong> inexpensive gates are the basis<br />

of computing, <strong>and</strong> ultimately why we have bitwise operations.<br />

Since the gates can only either be open or closed, you can use just two values to represent<br />

the different possible states of the gate: 1 for open <strong>and</strong> 0 for closed. A single transistor<br />

MATH REFERENCE<br />

761<br />

B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!