I do not have any in-depth knowledge of electrical engineering, but I would like to understand the purpose of a transistor in a microprocessor. There's usually some talk of Moore's law and that transistors somehow increase computation speed, but it's not clear to me exactly how these transistors are used. I figure it has something to do with pipelining. For example, when a CPU reads some instruction from memory, how are the operations required for that instruction performed with transistors?
What is the function of a transistor in a microprocessor
microprocessortransistors
Related Solutions
There are many people who have built computers out of discrete transistors, ICs, relays, and even vacuum tubes. They range from 4-bit machines all the way up to 32-bit. The 4-bitters of course will be the simplest you can build and do anything. The very first microprocessor was Intel's 4-bit 4004.
I would start by searching Google for "home-brew 4-bit computers" (without the quotes).
Here's a board from a transistorized 4-bit computer:
As far as memory goes, some of these projects which otherwise are using discrete transistors "cheat" and use SRAM chips. They are incredibly cheap for moderate amounts of memory, 32KB is $3.28 and requires no clocks and no refresh.
Even if the rest of your computer uses relays, using them for memory will be prohibitively expensive.
If you can get by with 1K bits, you could build one with transistorized flip-flops; 2048 2N3904's will cost 3¢ apiece ($60 altogether, plus the other components which will be even cheaper -- resisters for 1/2 a cent etc). You can get PCB's made for $10 apiece, then hire a kid to stuff them.
Relay computers date all the way back to the late 1930's, and one of the first was the Harvard Mark I. It's where the name Harvard architecture comes from (separate program space and data, compared to von Neumann architecture that combines the two).
The most famous home-brew relay computer is one built by Harry Porter.
Check out the videos of the computer running. Reminds me of an old electromechanical telephone exchange.
Here's a portion of another home-brew relay computer called Zusie:
Lots of blinking lights.
And finally, here's a link to a video of a 4-bit adder, made up of 24 relays. Adders like this are the heart of the ALU (arithmetic logic unit) in a computer.
To User16307: Yesterday I already have tried to answer your question (role of Q2 and why pnp?), however some forum members heavily disagreed. I understand that you feel confused now - and, therefore, I think it is best for you to draw a picture of your own. For this purpose, in the following I have listed some references, which may be helpful:
1) R.C. Jaeger, Microelectronic Circuit Design: "Alternating npn with pnp transistors from stage-to-stage is common in dc-coupled designs"
2) Sedra and Smith, Fig. 7.43, 7.44, 7.49 („..the pnp transistor provides the essential function of shifting the dc level..“.)
3) Univ. of Berkeley: (pages 5...7 ): „By using complementary devices, active level shifting can be combined with amplification“.
http://www-inst.eecs.berkeley.edu/~ee105/fa14/lectures/Lecture22-Multistage%20Amplifiers%282%29.pdf
4) https://wiki.analog.com/university/courses/electronics/text/chapter-10:
Fig. 10.1.4 („By using complementary devices, active level shifting can be combined with amplification“)
5) Carleton Univ, Calif.: Fig. 12-11 http://www.doe.carleton.ca/~rmason/Teaching/486-a.pdf
6) Mass. Inst. of Tech.
http://ocw.mit.edu/resources/res-6-010-electronic-feedback-systems-spring-2013/textbook/MITRES_6-010S13_chap07.pdf Fig. 7-21 (identical to Roberge: Operational Amplifiers, p.280)
7) Ferranti Semiconductor (March 1974), (picture given at the top).
Best Answer
It would be pretty hard to design a modern microcontroller from the transistor level. Transistors are used to make logic gates, as the lowest level building blocks. The most simple gate is the NOT gate, which inverts the input level: a logic 0 becomes a 1, and vice versa. The NOT gate is built with 2 transistors:
The top transistor conducts if its input (the small dot) is low, the bottom transistor (no dot) if its input is high. So if you apply a high input the bottom transistor conducts, acting as a switch, and switch the output Q to Vss (that's your -), or low level. We've inverted the input. Other gates are based on that. Take the NAND gate for instance. It has two or more inputs, and the output is low if all inputs are high. In all other cases the input is high.
This is a 2-input NAND gate, you still can see some of the inverter in it. If both inputs are high the bottom transistors both conduct, and the output is made low through its connection with Vss. If either of the inputs is low at least one of the top transistors conducts and output will be made high through its connection with Vdd (that's your +). We've got a working NAND gate. And so it goes on, we can build an XOR gate using 4 NAND gates, and other more complex logic is built from a combination of building blocks. You need a building block to create a register function: a part which can hold its state, like a memory.
If an instruction wants to read from RAM there's first the instruction decoder. Through a combination of gates it derives a number of signals it needs to execute the instruction. One of those will be to pass the RAM address to be read to the adress bus. (Busses are channels of signals, an address bus for an 8-bit controller may for instance have 16 parallel wires. Busses are a way to get things organized. Without them the controller's design would become very inefficient.) Another signal will activate the RD line (for "read"), which signals the RAM that it should place the data on the databus. Yet another signal will latch that data in a register.
An important thing is timing. You can't latch the data if you haven't given the RAM the time to place it on the bus. All done by the same logic, from building blocks which in turn are built from transistors.
There's nothing else than transistors and their connections. Transistors by themselves won't increase speed. What is true, however, is that technological improvements allow for faster transistors, and faster transistors means faster computation. Some of these improvements are unique technology steps, which you can do only once. But scaling is another factor, and they've kept repeating that since the first ICs were designed. 40 years ago an IC would typically have a 5 to 8 \$\mu\$m feature size. Today we can produce down to 22nm feature size. (DNA has a 15nm diameter.) With smaller feature size the physical properties of the transistor change allowing it to switch faster. Moore saw in this continuing scaling a trend, which became known as Moore's Law. This can't go on forever without having to take a leap in the used technology. In the 80s it was feared that the then used technology would have its limits at around 200nm to 300nm, because the lithographic process may not work at wavelengths below visible light. But lithography is still the technology used by today's steppers.