Skip to content

Latest commit

 

History

History
441 lines (385 loc) · 25.6 KB

03-Hardware.md

File metadata and controls

441 lines (385 loc) · 25.6 KB

HARDWARE — We Must Have A Machine To Do Our Work

  • Until we all attain accurate psychic powers, there must be some kind of mechanical or electronic device to do the work for us.

Low Level Hardware Implementations

The Wire & the Battery — 1800's to present

the-wire--the-battery
  • BIG IDEA — A wire and battery can be used to represent a logical "state"

  • Is electricity flowing or not flowing?

  • This is the most basic representation of a state in computing, and the underlying principle of all modern computing.

  • We are using this arrangement to represent a Boolean logic state

    • In Boolean Logic, a state is either true or false, on or off, 1 or 0.
  • Connected or not connected?

    • Problem: we don't really know its state until we measure it somehow (like with a voltmeter or a light bulb)
    • We can feel the wire heat up, but that's awful inconvenient and not very precise.

    Light a bulb with a battery and one wire

    Note: A light bulb is just a very small wire in a vacuum (so it doesn't burn up in 0.1 seconds) that gets white hot and glows when electricity flows through it.

The Simple Switch & Light Bulb — 1830's to present

the-simple-switch
  • BIG IDEA — Adding a switch can be used to represent a changeable logic "state".

    • This is the most basic representation of a "state" in computing.

    • Easier to manipulate for humans than a bare wire.

  • Add visual Feedback - Light on or off (1 or 0)

    • Even though the light has in reality many, many different states constantly changing over time, we can still use it to represent a single state at time: Either on or off.

    • In this way, we can use the light to represent a "bit" of information, which is the most basic unit of information in computing.

    • Simple switches can be used to represent two boolean logic operations: AND and OR

      • Two switches in series represent a Logical AND gate
      • Two switches in parallel represent a Logical OR gate
  • These operations are called "gates," conceptually similar to someone following a path across a fence, you can only pass through a gate if it's open, and you can't pass through if it's closed.

  • Logical Operations & Boolean Arithmetic

    • true = 1 = on = connected

    • false = 0 = off = not connected

    • A Logical "1" and "0" are called a "bit," as in a "binary digit"

    • Two switches in series represent a Logical AND gate

      • AND is the && symbol in most programming languages.
        Truth Table of AND gate
        | A | B | A && B |
        |---|---|--------|
        | 0 | 0 |   0    |
        | 0 | 1 |   0    |
        | 1 | 0 |   0    |
        | 1 | 1 |   1    |
    • Two switches in parallel represent a Logical OR gate

      • OR is the || symbol in most programming languages.
        Truth Table of OR gate
        | A | B | A || B |
        |---|---|--------|
        | 0 | 0 |   0    |
        | 0 | 1 |   1    |
        | 1 | 0 |   1    |
        | 1 | 1 |   1    |
  • Boolean logic requires one more operation to be complete: The logical NOT operation...

    • We need some kind of switch to represent a Logical NOT gate to create any other Boolean logic operation.
      • We need a NOT is the ! symbol in most programming languages.
        Truth Table of NOT gate  <-- WE GOTTA HAVE SOME WAY TO DO THIS, and regular switches won't work.
        | A | !A |
        |---|----|
        | 0 |  1 |
        | 1 |  0 |
    • We need the light bulb to on when the switch is off, and off when the switch is on, BUT HOW TO DO THAT?

The Magnificent Electromagnet — 1825 to present

the-magnificent-electromagnet

The Raucous Relay — 1835 to 1920's

the-raucous-relay

The Voracious Vacuum Tube — 1904 to 1960's

the-voracious-vacuum-tube
  • BIG IDEA — Instead of using a magnetic field to control a switch, we can use a vacuum to control the flow of electricity, in a way that works just like a switch.

    Note:

    While the actual physical electron flow direction is from the "negative" terminal to the "positive" terminal, the "conventional" flow direction of electricity in schematics is considered to go from the "positive" terminal to the "negative" terminal.

    Yes! This is rather confusing at first, and you can give thanks to that ding-dong Ben Franklin for this bit of technical debt we all have to deal with at the beginning of learning electronics.

  • Electricity in a vacuum behaves differently than in normal atmosphere.

    • Electrons can flow freely in a vacuum. I like to think of this as the invention of "nothing."
    • Tubes exploit this behavior of electrons in a vacuum to perform like a switch or an amplifiers.
  • The Tube made for use in logic (Triode) consists of three parts:

    • "Cathode"
      • Essentially a light bulb filament tied to the common "ground/negative" terminal of the power supply.
      • The Negative terminal of the tube is used to "emit" electrons to the anode and complete the circuit.
    • "Anode"
      • Positive terminal of the tube hooked to the "load" and the positive terminal of the power supply.
      • Used to "collect" electrons from the cathode and to indicate "state" and complete the circuit.
    • "Grid"
      • this acts as a switch also called a "valve" when referring to tubes.
  • The Grid can be used to control the flow of electricity between the cathode and anode.

    • ie: when the grid is positively charged, the flow of electricity from cathode to the anode is allowed.
    • ie: when the grid is negatively charged, the flow of electricity from cathode to the anode is deterred.
    • This acts by default like a logical "NOT" gate.
  • The tube can be used to represent any other logic gate.

  • The vacuum tube is voracious because it consumes a lot of power to heat the cathode and generates a lot of excess heat.

The Tiny Transistor - 1957 to present

the-tiny-transistor
  • BIG IDEA — Instead of using an electrically heated wire and vacuum to control the flow of electricity, we can use an economical semiconductor material and reduce energy and size by a factor of 100,000x.

    Very similar behavior to the vacuum tube, but much, much smaller and much, much faster at switching on and off.

  • The Transistor consists of three parts:

    • "Drain"
      • (the "anode" in the vacuum tube.)
      • also known as "collector" or "sink" often connected to "load."
      • (not always "positive" in modern transistors, but usually is.)
    • "Source"
      • (the "cathode" in the vacuum tube)
      • also known as "emitter" often connected to "ground."
      • (not always "negative" in modern transistors, but usually is.)
    • "Gate" (the "Grid" in the vacuum tube.)
      • also known as "base" often connected to the "control."
      • (not always "positive" in modern transistors, but usually is.)
  • The transistor can be used to represent any other logic gate and is the current basis for all modern computing.

  • The transistor is tiny because it is much smaller when compared to a vacuum tube.

  • It can also switch much faster and consume much less power than the vacuum tube.

  • The switching and size limits bumping up against the limits of physics on size and speed. small it can be made.

    At these small sizes, the behavior of electricity at the atomic level starts to become a factor.

  • How to Build Complex Logic Gates from Simple Transistors

The Interchangeable Integrated Chip (IC) — 1959 to present

the-interchangeable-integrated-chip-ic
  • BIG IDEA — We can use photographic techniques to create thousands of transistors on a single chip and radically reduce the costs of manufacture and assembly of computing devices and increase functionality and reliability.

  • This allows creating large groups of transistor logic gates packaged together to perform a specific task.

  • The packages were standardized, allowing for the creation of complex computing devices using interchangeable parts.

  • The Logic Gate "Package"

    • Robert Noyce, inventor of the first monolithic IC holding a photographic layer for an Integrated Circuit.

    • Logic Gate Symbols

    • Typical Early Logic Gate Package - 74HC42 (BCD to Decimal Decoder)

    • Package Schematic for a Quad 2-Input NAND Gate IC (74HC00)

    • Close up of silicon wafer wired to package

    • Single Transistor under an electron microscope

    • Inverter Gate and NAND gate under 50x microscope

    • 7-Segment LED Display Package

    • 7-Segment Display Schematic Common Cathode

    • What is a "BCD (Binary Coded Decimal) to 7 Segment Display Decoder"?

    • 7-Segment Display truth table

    • 7-Segment Display "BCD to 7-Segment Decoder" Schematic "Naive" Implementation

    • Schematic of BCD to Decimal Decoder using Clever Arrangement of NAND gates and Inverters

  • Why are NAND gates special?

    • nand-gates
    • BIG IDEA - NAND gates are known as universal gates, because you can make any other gates out of them.

    • It's the most flexible gate and can be combined to create any other logic gate, ie: AND, OR, NOT, XOR, etc.

      • NOT (inverter) = tie the NAND inputs together, this applies the same input to the 2 NAND’s inputs.
      • AND = NAND gate accepts 2 inputs and placing a NOT gate on the NAND output makes an AND gate.
      • OR = Inverters on each of the NAND gate inputs makes an OR gate.
      • NOR = Take one NAND gate, and place 2 inverters on each of the 2 NAND gate inputs and an inverter on the NAND output, makes a NOR gate.
      • XOR = 4 NAND gates makes an "exclusive OR"XOR gate.
      • XNOR = 4 NAND gates + one NAND inverter makes an "exclusive NOR" XNOR gate.
    • Everything in computers can be accomplished solely with just these three types of gates.

    • Most early semiconductor-based digital electronic calculators were made up of many IC's consisting solely of these NAND gates.

    • From simple NAND gate packages to a somewhat sophisticated 7-segment display using LED's.

      Side-quest: Why do they make the outputs on the 74HC42 (BCD-to=Decimal Driver) active low and not active high?

The Mighty Microprocessor — 1971 to present

the-mighty-microprocessor
  • BIG IDEA — Consolidate all the necessary components from various Integrated Chips required for a computer onto a single chip.

  • Simply groups of different Integrated Chips ➜ All put on one chip.

  • Contains a CPU (Central Processing Unit) and a small amount of ultra-fast memory (called "Registers").

  • The CPU is just a clever and somewhat complex arrangement of logic gates that can perform a series of logical operations.

  • Each part of the CPU is made of millions of the same kinds of logic gates that we've already discussed.

  • The CPU has a "clock" to synchronize the operations of the CPU.

  • It also has a "program counter" to keep track of the current instruction in memory that the CPU is executing.

  • Has an "ALU" (Arithmetic Logic Unit) to perform basic arithmetic and logical operations.

    How does an ALU work?

  • It contains a small amount of "cache" memory (extremely quick memory near the CPU circuits) to speed up access to the main memory.

  • CPUs are where the execution of each instruction happens.

The Configurable Computer

the-configurable-computer
  • BIG IDEA — Instead of hard-wiring all the devices for a computer, define a standardized interface to allow plugging-in lots of different devices to perform a specialized tasks.

  • By arranging the basic electronic components in particular patterns to achieve a specific narrow specialized task, like storing data on some medium, measuring sensors, controlling a motor, displaying an image, etc.

  • Bus (a set of wires that connect the CPU to the rest of the computer)

  • ROM (Read-Only Memory)

    • ROM is used to hold the basic software to start ("boot") the computer (sometimes called "firmware")

    • The values of each memory location are programmed, or "burned" into the ROM and usually cannot be changed.

    • Most ROMs cannot be changed

    • Some changed only once like PROMs (Programmable Read-Only Memory)

    • Some can be changed many times like EPROMs (Erasable Programmable Read-Only Memory) but these changes are slow and require special equipment. There is a limit to the number of times they can be changed.

  • RAM (Random Access Memory)

  • I/O (Input/Output) & Peripherals & Removable Storage & More

    • All just more variations of the same thing.
      • All built up from the same basic logic gates and transistors, or similar technology.
      • Even video cameras, microphones, radios and speakers are just variations of the same basic technology.
    • I/O is just using the same principles to represent logic states and perform logical operations.
    • Often electromagnets are used to control mechanical devices or other machines.
      • The classic example is the "hard drive" which uses a spinning disk and a moving arm to read and write data.
      • The "hard drive" is a "magnetic" storage device, and uses tiny spots of "magnetized" material to represent the "state" of the data.
      • The arm is controlled by software and uses "magnets" to move the arm to the correct position to read and write the data.
      • Some sort of electrified magnet is the usual way that computers interact physically with the world.

    Note that the CCD was invented in an "hour" due to how many other technologies had to be invented first.

  • Putting it all together

  • Continue Reading - Data Structures

  • Back to Index