What's a basic capability? Let's take a little look at an instruction set This is the dividing line between hardware and software A little farther down: Adding instructions moves this line Removing an instruction would move it too Example: If you removed all multiply, you could use add and a loop Or in some cases bit shifts A little bit of electrical engineering: Did I bring a capacitor? Water analogy: Pretty common, ok to differentiate volts and amps Voltage (measured in volts): Potential. Think of it like pressure. Current (measured in amps): Think of it like "gallons per minute". Power (measured in watts): Volts * Amps = Watts Resistance (measured in ohms): Need voltage to overcome resistance Ohm's Law: V = IR Power: P = IV You can substitute on equation into the other! Example: P = V^2 / R Another example: Eliminate V, look at power and current Line losses and voltage for power transmission Put another way: Why are car battery cables so big? Alright, think about a space heater with 10 ohms of resistance: 115 Volts / 10 Ohms = 15 Amps 15 Amps * 115 Volts = 1,725 Watts Let's grab a power supply and take a look A weird effect of moving electrons: Magnetic fields Electromagnets and speakers Generating electricity: Movement of conductors in a magnetic field An electric motor and a generator are very similar An example I learned about recently: Electric guitar pickups These use a string vibrating in a magnetic field The magnetic field magnitizes the string The vibrating string induces current in the coil, at low voltage 100-300 mv, according to Wikipedia with "citation needed" Will that blow up my old stereo amps? So, putting nylon strings on an electric guitar should prevent it from working Note: There are various types of guitars that react to vibration in other ways Electromechanical components: Relays are a good example Use electricity to flip a switch! Also: Electric motors, sprinkler valves, etc. AC vs. DC: Not the band named after a sewing machine AC adapter Like computer components, frequency is measured in hertz RMS voltage We use AC in outlets because it's easy to convert between voltages Transformers (not the robots): Iron core, with different numbers of coils for each side Yes, this does mean the sides are not actually connected AC Phases: In the USA, houses receive split phase power at 60HZ Two "hot" wires, 180 degree phase difference Neutral, 0 volt wire, can be used with either phase Ground, also 0 volt, wired to the neutral at the panel Use 1 phase + neutral for about 110-120 volts, or both phases for about 220-240 A lot of "220" gear uses mostly 110 volt components This is a varient of single-phase power (don't call it two phase) Inductive power theft: Surely by this point, you'll have thought of this one! Alright, suppose you're building a high-end audio amp: A natural problem: 60HZ buzz DC would be better! Step 1: Transformer, for the correct voltage Step 2: Full-wave bridge rectifier, to form a consistent polarity Explanation on wikipedia Step 3: Capacitor, to smooth it out A big one with a lot of current capacity would be best Discount store audiophile trick: Buy by the pound Did we get it? There's probably still some noise, but hopefully we did our best The transformer will induce currents in metal pieces around it Input stages are particularly sensitive to this If the user turns the volume all the way up, they'll probably hear a buzz Cheating: Use a battery Kinda serious here, some headphone amps do this Note that there's a lot more to an amp than just power delivery It's also possible to pick up buzz from cables Solution 1: Higher signal voltage That way, the buzz is insignificant Solution 2: Digital signal As long as we don't flip 1's and 0's, it'll be perfect But it'll add extra digital to analog conversions! Digital, and resistance to interference: We could enjoy the perfection Or push it to the brink of failure! This is the usual approach, and the point of overclocking We saw diodes and capacitors. A couple other components: Resistor: Has a specified number of ohms Fuse: Small wire, low resistance, but melts when too much current flows Inductor: Stores energy in a magnetic field Like a capacitor, but for current Ignition coils A very central component: Transistors Three connections Base: "switch" input, allows power to flow from collector to emitter Collector: Input power Emitter: Output Kinda like a relay, but without the isolation NOT binary. A little power to the base allows a little from collector to emitter This makes it useful for analog electronics Like an amplifier! But, we need to go a different direction, toward digital electronics A note about that though: I have a "digital" amp in my living room The controls are digital The amplification process is analog I play music on my computer that arrives digitally from Spotify It's possible to manipulate volume, etc. digitally Eventually, it reaches my headphone amp (still digital) The headphone amp converts it to an analog signal The headphones are purely analog Only 0 and 1: For logic circuit diagrams we'll do: 0 means "low enough" 1 means "high enough" What's "enough"? More than something Larger something: Bigger switching delay, more power use Smaller something: Smaller switching delay, but could it be too small to detect? So it depends on the application. CPU voltage is usually less than 2. We'll consider transistors to be "on" or "off" If you set the frequency too high, they might not have finished changing... At some level, all electronics is analog Next series: Gates! We'll talk about computer parts first.