From atoms to ALU

Construct your own ALU from the ground up: atom -> transistor -> AND/OR/NOT gate -> ALU. CrashCourse on youtube: atoms-to-transistor, transistors-to-AND-gate, AND-gates-to-ALU

9 flashcards · Computer Science · by lakesare

  1. We have some silicon atoms. How to create a transistor?

    Pure silicon has 4 valence electrons. Let's dope silicon with some material: having 5 valence electrons to get n-type semiconductor, having 3 valence electrons to get p-type semiconductor. Now let's join them, resulting in a PNP transistor.

  2. How does a transistor function?

    After some small voltage is applied to the base, current starts flowing from collector to emitter (or sometimes the other way). It acts as a switch.

  3. We have transistors. Create a NOT gate.

    We only need one transistor. Input will be at base, output will be at collector, and emitter will be connected to the ground. If we apply current to the base (input: true), current will start flowing through the transistor into the ground, avoiding a harder path to the output (output: false). If we don't apply current to the base (input: false), current won't go through transistor, and will go straight to the output (output: true).

  4. We have transistors. Create an AND gate.

    2 inputs are at bases of 2 transistors, emitter of one transistor is connected to the collector of another. Current won't flow if either of bases are not having current applied to them.

  5. We have transistors. Create an OR gate.

    If A or B are true - output is true, if both A and B are true - output is still true.

  6. We have AND, OR, NOT, XOR gates. Create a circuit for adding two bits (=> Half Adder).

    XOR returns perfect SUMs for us, but we need to make sure CARRY returns a proper bit too. Since we need it 0 for every inputs but 1&1, we can utilize AND gate.

  7. We have Half Adders. Create a Full Adder.

  8. You have Half and Full adders. Create a circuit adding 8 bits to other 8 bits (=> Ripply Carry Adder). (Yay! You basically created an ALU!)

  9. Memory latches (flip-flops) can be created by AND/OR/NOT gates too. How?

    By feeding output of some gates back to input.