Now we're going to start to talk about circuits. In the next two lectures, we're going to cover precisely how a computer is built. And you'll be surprised at how simple the basic underlining mechanism of our computers is. We're going to begin by describing some of the basic building blocks, just the elements that we need in order to be able to describe the circuits that build our computers. So, first thing, today we're going to talk about combinational circuits. And specifically, this is a digital circuit. So that's all signals in the circuit are 0 or 1 with no feedback. In the early days of computation, people considered analog circuits which are quite different and vary continuously but nowadays everything is digital. And no feedback, the alternative to that is circuits with loops and that's what we're going to talk about in the next lecture. So for this lecture, there's no feedback and all signals are zero or one and we'll get more specific about this. So why do we have this kind of circuit? Well the fact is that they're very accurate, they're very reliable, we can do a lot with them, they're general purpose and they can be fast and they can be cheap. And that's held for decades, and that's why all our computers are built with this kind of circuit. The basic abstractions that we use are extremely simple, everything is either on or off. And we've talked about that before, that's because it's so easy to map these abstractions on and off to the physical world. Like a switch is on or off or some things that connected to power or not. And then, we have a thing called a wire that propagates an on or off value. So, that's definitely basic construction and the circuit is a wire. And then there's one other thing that we'll talk about at the beginning, called a switch that we use to control the propagation of values through wires. That's it, those are the basic abstractions we work with. And we'll talk about them in detail and then use them to build more complicated circuits. And the fact is that any kind of device that we have nowadays that has any kind of computer inside it is going to be a digital circuit like this, including the brakes in your car. But in particular, what we want to talk about is the microprocessor, the central processing unit of your computer. So what about wires? Well, we're just going to use a really simple representation where a wire is either on, connected to power, or off, not connected to power. We'll draw a power connection as a black dot, anywhere in the circuit that's got a black dot is somehow connected to power. And when we want to indicate the value of a wire, we'll make it thick, so a thick wire is one that's connected to a dot and we interpret that to have the value 1. Thin wires are not connected to power, they're off. We interpret them to have the value 0. If we connected any wire to a wire that's on and that one's on too and similarly for off, so it's a quite intuitive and natural representation. And the power connections are going to be all over the place in our circuit. In real circuits, you might think of it as a punch through to another layer that's connected to power. Usually when we draw our circuits, we think of the information as flowing from the top and the left to the bottom and the right. We try to adhere to those conventions so that it's easier to figure out what's going on in the circuit. Of course, electrically, it doesn't matter what direction we draw things. But you'll see that that convention help makes it easier to understand, a bit easier to understand what's going on. So, that's wires. Now, the basic unit that we construct everything from is called the controlled switch. It's a way to control the propagation of information through wires. The very simplest case involves two connections. So we call one of them the control, that's an input at the top and then the other connection is to output. In this diagram, the gray thing, the gray circle in the middle is the switch. It's got a control input that's off. If the control input is off, then the output is on. So in this case, that output wire's connected to power. The switch is off so it has no impact on that connection from power at the left to the output at the right. But the main thing about a switch is that if you turn the control input on, then it has the effect of blocking the connection from power to the output. That's a controlled switch, by turning the control input off or on, we can control what happens in the output. And we'll talk in a minute about different ways in which that might be realized, but that's a basic abstraction that our computing circuits are built on. A slightly more general case involves three connections where instead of a connection to power, we might have a wire coming through that's maybe the output of another switch. So in that case, if we have the control off, then the output's connected to the input. The output at the left is connected to the, output at the right is connected to the input at the left. If it's off, as shown at the top, then input's off, output's off. As shown at the bottom, input's on, output's on. Data input off, output off, data input on, output on, if the control's off. But if the control's on just as before then it blocks the connection from the data and input on the left to the output. The output is always zero. If the data input is off, the output is off, the data output is on, the data output is also off. The controlled switch just cuts across a wire, and if it's got power in it then it blocks the connection. That's our basic abstraction. It's quite amazing that really everything is built from this. And we'll talk more about that in just a minute. So this is an idealized model that actually comes from what's called a pass transistor in real integrated circuits where the wire that goes across is one material, then the wire that cuts it is a different material. And they have the physical property, that if you turn the control one on, it physically stops the connection between the input at the left, and the output at the right. So we're not going to worry about those physical details, we're going to use this subtract model. because there's actually lots of different ways to build control switches like this. So just as a physical example to give you something grounded in a real world, we'll talk about a relay. And that actually was one of the earliest control switches that was used to build calculating devices. So what a relay is, it's a physical device that controls the switch with a magnet. So it's got the three connections, input, output, and control that we just talked about. But it uses electromagnetic force to pull a contact that cuts the electric flow. So there's our schematic. So from top to bottom, we have a wire that indicates our control wire and it stops, that's how we know it's a control wire. Coming across is the wire that might get switched or not. So if the control is off, then the black square near the top is supposed to indicate a magnet that's off. And there's a spring that's holding a contact down to make sure that we've got a connection going across from left to right. Control's off so that 0 at the top in the schematic. And then if the wire's off at the left, it's off at the right, it's got the same connection if it's on. At the left it's on, at the right that's shown in the little diagram at right. But now if control's on, what happens is the magnet pulls up the contact and breaks the connection. So if that's done, control's on then the connection at right is 0 no matter what the input is. That's the idea of a relay, a physical realization of a controlled switch. So that's our first level of abstraction. Again, there's many different ways to implement switches. But just thinking about the abstract idea of a switch in a wire, that's a model that separates us from the physical world. We can start working in the logical world where we assume that these things operate as we just specified. That's the only assumption that we make, that we have these switches and that the wires connect intuitively as we described. it doesn't matter how the switch is actually implemented. And actually, the basic design that we're going to look at was developed many decades ago and has been effective through many, many different switch technologies. It's the whole purpose of abstraction. We have the idea of a control switch and a wire, we use that to build our computer. And all the computers that we've talked about from the PDP 8 to and so forth to the microprocessor in your computer, are all built on the idea of a controlled switch. Now, the physical thing does dictate the performance. And that's a topic that we don't cover, that's an engineering topic that's certainly important. If you get a smaller switch, you get a faster switch. You get one that draws less power, you get a better computer. And that's really the point, is that with new technology since we only depend on that one abstraction, we immediately, almost immediately get a fast new computer. We don't have to change our design because it's all built on that simple abstraction. If you have a better switch, you have a better computer. And really, often, when you hear that scientists have developed technology that means that computers will be faster, really what it means is that somebody found a better switch. That's the basis of Moore's law that we've talked about. That computers will get bigger and faster on a regular basis is because switches get smaller and faster and better. So, just to drive home the idea that it doesn't matter what the technology is. You can look out on the web and find all kinds of examples where people use switches, there's a pneumatic one at the top that depends on air pressure. Or one depending on water pressure. Or nowadays, you can use a relay. And you're not going to build a computer a billion words with these technologies but they've kind of proved the point that the technology doesn't matter. People have built whole computers out of these kinds of technologies. And actually as I mentioned, the relay was a real world example that was one of the first computational devices was built with the relays. And then vacuum tubes came along which were faster and cheaper and smaller than relays. And then the transistor, and then eventually the integrated circuits where we have materials, two different materials that cross one another and implement our control switch. And nowadays, people talk about atom thick transistors. And really the concept of a transistor is really the concept of our control switch. See, in fact, for the last several decades, most computers have been built with what's called VLSI or Very Large Scale Integration. And again, as I've been saying, it's built by depositing materials of different types on a substrate. In this diagram, blue line for wires, are connecting wires and then the red and green ones have to do with switches. So certain crossing lines are controlled switches. So in the physical world, the key challenge is fabricating the circuits that are going to work reliably. Switch has to work every time, a wire has to be connected every time. And there might be billions of wires and control switches. This is actually a small one. We'll look at a bigger one later on. But we're more interested in the abstract world, we're just trying to understand the behavior of circuits that might have billions of wires and control switches. That's what we're going to be talking about in the next couple of lectures. But one thing that I want to impress on everyone from the beginning, is that really nowadays, there's not that much of a distinction between the circuit and a drawing of a circuit. Actually, ever since VLSI came along, building a computer really is specifying a drawing of a circuit that gets taken to a fabrication facility that takes that drawing and uses it to make these geometric devices with different materials on a substrate. But from a design standpoint, where we're interested in the drawing. And the way that we're going to look at circuits really keeps that in mind. We're always thinking about the space that the circuit elements that we look at occupy and how it directly translates from the logical world to the abstract world because a circuit is s drawing. Now, even with these simple abstractions, and these are just the few that we discussed where we've got our dot is a connection to power, our line, that little tabs that cross a line or our controlled switches and wires might cross or they might be connected. Even with that very simple set of abstractions of the behavior of what goes on can get quite complicated. And we give you a drawing built with these abstractions. It's not immediate how to figure out exactly which wires become connected and which ones don't. And that's why we need to be careful about building our layers of abstraction. To really understand circuit behavior, we're going to start at the beginning and build small devices out of switches, and then bigger devices out of those small devices. That's going to be a very key part of how we get to a design of a complete computer.