CS 352 Lecture 3 – Electricity for Computer Scientists
Dear students,Today we step have a look at the foundation of our technology: electricity. Let me preface by admitting that I am no expert in this field. My understanding of this field is patched together through unstructured fiddling; it has many holes and assumptions that threaten its collapse. We discuss it now because this class is about understanding the mysteries of computer hardware, and I’ve seen many people teach architecture but abstract away electricity, leaving me feeling wobbly.
Our time today will first be structured by a series of questions:
- What is electricity?
- What must be true for electricity to flow?
- Why do some materials allow electricity to flow, but others do not? What’s the difference?
- How do we turn electricity into a desired output? For example, how does it light a lightbulb or generate sound?
Then we will move on to a series of design challenges that get us nearer to our goal of building computers:
- How can I design a circuit that always lights an LED?
- How can I design a circuit that lights an LED only when a switch is closed?
- How can I design a circuit that varies an LED’s brightness?
- How can I design a circuit that varies the brightness between two LEDs?
- How can I design a circuit that holds a charge?
- How can I design a 1-switch circuit that lights an LED by default, but turns it off when a switch is closed?
- How can I design a 2-switch circuit that lights an LED only when both switches are closed?
- How can I design a 2-switch circuit that lights an LED when either switch is closed?
- How can I design a 2-switch circuit that lights an LED when at most one switch is closed?
- How can I design a 2-switch circuit that lights an LED when neither switch is closed?
- How can I design a 2-switch circuit that lights an LED when switch A is closed but switch B is open?
If we have time remaining, we’ll review Makefiles by writing one for the alien code we wrote last time.
Here’s your TODO list of things to complete before next class:
- On a 1/4 sheet, design a 3-switch circuit that lights an LED when switch A is closed and either switch B or switch C is closed. Draw a diagram.
See you next class!