Computer Architecture: From Transistors to Logic Circuits


Transistor Fundamentals and Binary Inputs

  • Transistor Components and Operation:

    • A bipolar junction transistor operates using three primary terminals: Collector, Base, and Emitter.

    • Collector: Receives continuous voltage/power when the computer is powered on. It provides the flow of electrons through the system.

    • Base: Acts as the control mechanism or switch. The voltage state at the base depends on external control, user interactions (e.g., keyboard key presses, mouse clicks), or running software programs.

    • Emitter: Serves as the output path. Current flows through the emitter to yield a binary output state of 11 when conditions at the base and collector are met.

    • Control Mechanics:

      • When the base is supplied with control voltage (Base = 11), the internal switch closes, allowing current to pass through to the emitter, yielding an output voltage defined as binary 11.

      • When the base lacks control voltage (Base = 00), the junction exhibits an effectively infinite resistance (resistance=infinite\text{resistance} = \text{infinite}), blocking electron flow to the emitter and yielding an output of binary 00.

      • The base is not strictly 00 when the computer turns on; background system processes, operating system operations, and display drivers actively drive control bases to 11 or 00 automatically.

  • Binary Data Encoding and Keypresses:

    • Every single character or key pressed on a keyboard (e.g., letters, numbers, special keys) represents 1 byte1\text{ byte} of input data.

    • 1 byte=8 bits1\text{ byte} = 8\text{ bits}, meaning it consists of 88 binary digits (00s and 11s).

    • Processing a single keypress requires 8 transistors8\text{ transistors} working simultaneously to process each of the 8 bits8\text{ bits}.

    • Example (Enter Key Input):

      • Pressing the Enter key inputs the decimal value 1010 into the computer.

      • Decimal 1010 converted to an 8-bit8\text{-bit} binary format is 00001010200001010_2.

      • When pressing Enter, 8 transistors8\text{ transistors} process the input byte 00001010200001010_2 across their respective emitters, producing an output sequence of 0,0,0,0,1,0,1,00, 0, 0, 0, 1, 0, 1, 0.

      • This output sequence is subsequently routed to the intended software process (e.g., email client, programming environment, command prompt).

  • Transistor Integration in Modern Hardware:

    • Modern computers contain billions of micro-transistors.

    • Transistors serve as the foundational physical layer used to generate, process, and direct binary data across system components.

Logic Gates and Hardware Implementations

  • Transition from Transistors to Logic Gates:

    • While individual transistors simply generate binary state signals (00 or 11), controlling, altering, and combining data streams requires logic gates.

    • A logic gate connects multiple transistors together to execute specific boolean logic operations on input signals, producing a single output signal.

  • AND Gate:

    • Implementation: Built by connecting two transistors in series.

    • Operation: Voltage flows through the collector. Both base inputs (Input AA and Input BB) must receive control signals (11) to complete the circuit path.

    • Logic Rule: Output is 11 if and only if both Input A=1A = 1 and Input B=1B = 1. If either input is 00, high internal path resistance blocks output, yielding 00.

  • OR Gate:

    • Implementation: Built by connecting two transistors in parallel.

    • Operation: Current has two distinct parallel paths to pass through toward the output terminal.

    • Logic Rule: Output is 11 if either Input A=1A = 1, Input B=1B = 1, or both inputs are 11. Output is 00 only when both inputs are 00.

  • NOT Gate (Inverter):

    • Implementation: Uses a transistor connected to a direct path to ground with variable internal path resistance.

    • Operation:

      • When Input A=1A = 1, the internal transistor resistance drops to zero (resistance=0\text{resistance} = 0), causing current to flow directly to ground rather than the output terminal, resulting in Output = 00.

      • When Input A=0A = 0, internal resistance to ground is extremely large, forcing current to flow out through the output line, resulting in Output = 11.

    • Logic Rule: Flips the binary input signal (1→01 \rightarrow 0, 0→10 \rightarrow 1).

  • NAND Gate (NOT-AND):

    • Implementation: Inverts the result of an AND gate.

    • Operation: If both inputs are 11, current flows directly to ground, producing an output of 00. If either or both inputs are 00, the path to ground is blocked, forcing current to the output terminal to produce 11.

  • XOR Gate (Exclusive OR):

    • Logic Rule: Yields an output of 11 if inputs are different (A≠BA \neq B). Yields an output of 00 if inputs are identical (A=BA = B).

  • Truth Tables and Proofs:

    • A Truth Table lists all mathematically possible input combinations alongside their corresponding output values.

    • Truth tables serve as definitive mathematical proofs for validating hardware gate logic and circuit behavior.

Binary Number Systems and Bit Calculations

  • Bit Capacities and Range Calculations:

    • 1 bit1\text{ bit} represents 21=22^1 = 2 possible states (00 or 11).

    • To represent NN distinct values or states, the minimum required bits kk satisfies the inequality 2k ≥ N2^k \text{ ≥ } N.

    • Example 1 (31 Distinct States): To represent numbers 11 through 3131 (3131 total values), 5 bits5\text{ bits} are required, as 25=322^5 = 32 total states (00000200000_2 to 11111211111_2).

    • Example 2 (1 Byte / 8 Bits): 1 byte=8 bits1\text{ byte} = 8\text{ bits}. The total number of distinct numerical representations is 28=2562^8 = 256 (ranging from 00 to 255255 in unsigned binary).

  • Hardware and Memory Architecture Calculations:

    • 32 bits32\text{ bits} (4 bytes4\text{ bytes}) can represent 232=4,294,967,2962^{32} = 4,294,967,296 unique integer addresses or states using only 32 transistors32\text{ transistors}.

    • Memory Conversion Constants:

      • 1 Kilobyte (KB)=1,024 bytes=210 bytes1\text{ Kilobyte (KB)} = 1,024\text{ bytes} = 2^{10}\text{ bytes}

      • 1 Megabyte (MB)=1,024 KB=220 bytes1\text{ Megabyte (MB)} = 1,024\text{ KB} = 2^{20}\text{ bytes}

      • 1 Gigabyte (GB)=1,024 MB=230 bytes1\text{ Gigabyte (GB)} = 1,024\text{ MB} = 2^{30}\text{ bytes}

    • 4 Gigabytes (GB)4\text{ Gigabytes (GB)} Memory Bit Computation:

      • 4 GB=4×1,024×1,024×1,024 bytes=22×210×210×210=232 bytes4\text{ GB} = 4 \times 1,024 \times 1,024 \times 1,024\text{ bytes} = 2^2 \times 2^{10} \times 2^{10} \times 2^{10} = 2^{32}\text{ bytes}.

      • Addressing every individual byte within a 4 GB4\text{ GB} memory chip requires exactly 32 address lines32\text{ address lines} (or 32 bits32\text{ bits}).

Circuit Logic and Binary Arithmetic

  • Schematic Symbols for Gate Diagrams:

    • AND Gate: Curved D-shape symbol.

    • OR Gate: Curved pointed shield shape symbol.

    • NOT Gate: Triangle pointing right with an output circle (bubble).

    • NAND / NOR Gates: Standard AND/OR shapes appended with an inverted output circle bubble.

  • Binary Addition Fundamentals:

    • Binary addition follows positional base-2 arithmetic rules with carries occurring upon reaching 2102_{10} (10210_2):

      • 02+02=020_2 + 0_2 = 0_2

      • 02+12=120_2 + 1_2 = 1_2

      • 12+02=121_2 + 0_2 = 1_2

      • 12+12=1021_2 + 1_2 = 10_2 (Sum bit = 00, Carry bit = 11)

    • Example 1 (2-bit Addition): Add 012+11201_2 + 11_2:

      • Column 1 (right): 1+1=01 + 1 = 0 with Carry Out = 11.

      • Column 2 (left): 0+1+1(carry)=1020 + 1 + 1 (\text{carry}) = 10_2 (Sum bit = 00, Carry Out = 11).

      • Final Result = 1002100_2 (Decimal 1+3=41 + 3 = 4).

    • Example 2 (4-bit Addition): Add 01012+001120101_2 + 0011_2:

      • Bit 0: 1+1=01 + 1 = 0, carry 11

      • Bit 1: 0+1+1(carry)=00 + 1 + 1 (\text{carry}) = 0, carry 11

      • Bit 2: 1+0+1(carry)=01 + 0 + 1 (\text{carry}) = 0, carry 11

      • Bit 3: 0+0+1(carry)=10 + 0 + 1 (\text{carry}) = 1

      • Final Result = 100021000_2 (Decimal 5+3=85 + 3 = 8).

  • 1-Bit Full Adder Truth Table:

    • To implement binary addition in hardware circuits, a truth table mapping inputs AA, BB, and Carry-In (CinC_{in}) to output Sum (SS) and Carry-Out (CoutC_{out}) is constructed:

Input AA

Input BB

Input CinC_{in}

Output Sum (SS)

Output Carry-Out (CoutC_{out})

00

00

00

00

00

00

00

11

11

00

00

11

00

11

00

00

11

11

00

11

11

00

00

11

00

11

00

11

00

11

11

11

00

00

11

11

11

11

11

11

  • Note on Single-Bit Sum: The 1-bit addition sum without carry matches the XOR gate truth table exactly.

  • Circuit Logic Analysis Examples:

    • Case 1: Circuit expression (A \text{ AND } B) \text{ OR } C$. If $C = 1$, the output is guaranteed to be 1,regardlessofwhether, regardless of whetherAororBareare0oror1.\n * *Case 2:* Circuit expression (A ext{ AND } B) ext{ AND } (C ext{ AND } D)$. For output to be 11, all four inputs must be set to 11 (A=1,B=1,C=1,D=1A=1, B=1, C=1, D=1).

    • Case 3: Circuit expression (A \text{ OR } B) \text{ AND } (C \text{ OR } D)$. For output to be 1,atleastoneinputinset, at least one input in set{A, B}mustbemust be1ANDatleastoneinputinsetAND at least one input in set{C, D}mustbemust be1.\n\n# Advanced Control Circuits: Multiplexers and Decoders\n\n* **Majority Function Circuit (3 Inputs, 1 Output):**\n * **Objective:** Design a circuit with three inputs (A, B, C)thatoutputs) that outputs1ifatleasttwoinputsareif at least two inputs are1 ("majority rules").\n * **Truth Table:**\n\n| Input A∣Input| InputB∣Input| InputC | Output |\n| :---: | :---: | :---: | :---: |\n| 0∣|0∣|0∣|0 |\n| 0∣|0∣|1∣|0 |\n| 0∣|1∣|0∣|0 |\n| 0∣|1∣|1∣|1 |\n| 1∣|0∣|0∣|0 |\n| 1∣|0∣|1∣|1 |\n| 1∣|1∣|0∣|1 |\n| 1∣|1∣|1∣|1 |\n\n* **Multiplexer (MUX):**\n * **Definition:** A combination circuit that selects one of several data input signals and forwards the selected input to a single output line based on a control signal.\n * **2-to-1 Multiplexer Architecture:**\n * **Inputs:** Data inputs AandandB,andacontrolselectline, and a control select lineS.\n * **Operational Logic:**\n * When Select S = 0,Output=, Output =A(Datafromline(Data from lineB is blocked).\n * When Select S = 1,Output=, Output =B(Datafromline(Data from lineA is blocked).\n * **CPU Application:**\n * Multiplexers implement conditional programming constructs like `if-else` blocks and `while` loop controls.\n * Because CPUs have no massive long-term storage and load instructions sequentially, multiplexers select which instruction path or branch to execute next based on boolean flag evaluations (e.g., checking if loop counter I < 5 is True or False).\n\n* **Decoder Circuit:**\n * **Definition:** A logic circuit that converts an N ext{-bit}binaryinputcodeintoamaximumofbinary input code into a maximum of2^N unique output lines, activating exactly one output line at a time.\n * **2-to-4 Line Decoder Architecture:**\n * **Inputs:** 2 ext{ binary lines}((A, B).\n * **Outputs:** 4 ext{ output lines}((Y_0, Y_1, Y_2, Y_3).\n * **Truth Table:**\n\n| Input A∣Input| InputB∣Output| OutputY_0∣Output| OutputY_1∣Output| OutputY_2∣Output| OutputY_3 |\n| :---: | :---: | :---: | :---: | :---: | :---: |\n| 0∣|0∣|1∣|0∣|0∣|0 |\n| 0∣|1∣|0∣|1∣|0∣|0 |\n| 1∣|0∣|0∣|0∣|1∣|0 |\n| 1∣|1∣|0∣|0∣|0∣|1 |\n\n* **System Scale Applications:**\n * A 3 ext{-input}decoderyieldsdecoder yields2^3 = 8 unique outputs.\n * An 8 ext{-input}decoderyieldsdecoder yields2^8 = 256 unique outputs.\n * A 32 ext{-input}decoderyieldsdecoder yields2^{32} = 4,294,967,296outputs,enablingdirectindexingofeverymemoryaddressinaoutputs, enabling direct indexing of every memory address in a4 ext{ GB} memory chip.

Questions & Discussion

  • Question regarding Collector and Base states during system startup:

    • Prompt: When starting the computer, signal flows through the collector. If nothing is pressed and the computer just turns on, is current still blocked at the base?

    • Response: It depends on system design. It is not always blocked or set to zero because upon booting, the display powers on, the operating system executes, and numerous background system processes actively run. Control bases are driven automatically by running software programs or external hardware controls.

  • Question regarding Enter key data size and transistor counts:

    • Prompt: Pressing any button on a keyboard is one byte, which means eight bits or eight binary numbers. So when pressing Enter, how many transistors work on that?

    • Response: Exactly eight transistors are required to process the eight bits of input data representing the character.

  • Question regarding Truth Tables vs. Logical Graphs:

    • Prompt: Instead of analyzing the logic on a schematic graph, can a truth table be used to check all statements and prove a gate?

    • Response: Yes. A truth table mathematically lists every single possible input combination alongside its resulting output. Testing every combination against expected outputs validates and proves the functional identity of a gate or circuit design.

  • Question regarding Truth Table variable inclusion:

    • Prompt: When constructing a truth table for addition, do we exclude C$$ if there are three variables?

    • Response: All active variables driving inputs must be included in the truth table matrix to map all possible system states.

  • Question regarding Majority Output rules in homework tables:

    • Prompt: In a row with inputs 0 1 1, the output becomes 1. Is that because 1 is the dominant value in that row?

    • Response: Yes. If ones dominate the input set for a row (meaning at least two inputs are set to 1), the output yields 1. If zeros dominate, the output yields 0.