CPSC 101 Notes: 2006 June 12

Disclaimer: you will not be tested on these extra notes on the exam. When there is crucial content, I will preface it with a note saying "Key info"

Today was a "mashup" of the very bottom levels of computer architecture and the computer science connections to vision and touch.

In architecture, we used NAND gates to construct various different circuits. Even though the NAND gates aren't intelligent (or anything like it!), they can compute interesting things when laid out properly. That's a pretty amazing statement when you think about it. NAND gates "know" nothing about addition, and yet we built a circuit from NAND gates and wires that adds 1 to numbers.

Douglas Hofstadter in his book Gödel, Escher, Back: An Eternal Golden Braid challenges us to believe in the possibility of intelligence "emerging" from such simple components. For example, we might ask whether an anthill, as an entity, can be intelligent, even if the individual ants obviously are not. That seems ridiculous.. until Hofstadter also challenges us to imagine a conversation with a single one of our own neurons. How clever do you think one neuron is? Smart enough to hold up a conversation? Well then, how can you (a big network of neurons) be intelligent?

Why did we use NAND gates? That seems so counterintuitive! Why not use AND gates (such things exist!)? For that matter, why not use OR, NOR (Not OR), XOR (the eXclusive OR we built in class), or something else?

There's two reasons..

First, anything that can be built using Boolean logic (the mathematics of 1s and 0s) can be built using NAND gates alone. It turns out that's not true of an AND gate! To prove that AND isn't enough, try constructing a NOT gate from just AND gates and nothing else. Can you do it? It's hard to prove that NAND is enough, but we can take a first step by building AND from NAND gates. Can you do that? (Hint: remember how to build a NOT from NAND gates?) Since we can build an AND using NANDS, we can do anything that can be done with ANDs with NANDs. Since we cannot build a NAND from ANDs, NAND can do more than AND alone.

Second, remember the gates built from water and transistors? The one gate we built from transistors (the technology used in real computer chips) was a NOT gate. It turns out that the most efficient way to use transistors to build a gate almost always results in negation in that gate. That's simply a coincidence (perhaps??) of the physics of transistors. Therefore, it takes only four transistors to build a NAND gate, but it takes six to build an AND. (An AND is essentially a NAND followed by a NOT in transistors.) Since NANDs are actually simpler to build, they make sense to use.

How would you build a NAND? I won't go into lots of detail, but for those with some circuits background, look at the diagram in the slides linked above and then imagine putting two transistors in parallel on the bottom (each wired to one of the inputs) and two in sequence on the top (each wired to one of the inputs).

By the way, the little "bubble" on the output of our NAND gate drawings is used in circuit diagrams to mean negation. So, a plain AND gate would drop the bubble.

In psychology, we mostly discussed vision and touch. Karon MacLean's research group here in UBC CS does really amazing haptic (touch-based) HCI research. Check out some of their groovy haptic research projects! Ron Rensink is the fellow in UBC CS and Psychology who researches change blindness among other aspects of vision and cognition. Want to have more fun with your head? Check out the Change Detection demos Ron points to.

By studying the biology, chemistry, physics, psychology, and sociology of vision and touch, we can learn to design better interfaces. A good example of that is "compressing" images and sounds by dropping unneeded information. Just because a microphone records signals outside the range of human hearing doesn't mean we need to allocate bits to store that information! In HCI, we use such information to design interfaces that work well for the human visual system. For example, we know a fair bit about features that make information in a visual display "pop out" in the human visual process. When we're charting data, we should use those kinds of features to display critical characteristics of the data. As an example, how long does it take you in the following two diagrams to find the one data point that's different from all the others?

An image where a single feature change makes the one unique data point 'pop out'. An image where multiple feature changes keeps the one unique data point from 'popping out'.

Finally, we started talking about neurons. We'll do more of that on Wednesday!


Steve Wolfman
2006/06/14