CrashCourse · @crashcourse

Registers and RAM: Crash Course Computer Science #6

Uploaded June 8, 2017 · Length 12:17

Registers and RAM: Crash Course Computer Science #6

Summary

Learn how to build circuits that store single bits of information using logic gates, leading to the creation of registers and RAM.

  • computer memory basics
  • how latches work
  • building a memory module
  • registers and RAM
  • computer science fundamentals

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:03

    Hi, I’m Carrie Anne and welcome to Crash Course Computer Science.

  2. 0:05

    So last episode, using just logic gates, we built a simple ALU, which performs arithmetic

  3. 0:11

    and logic operations, hence the ‘A’ and the ‘L’.

  4. 0:13

    But of course, there’s not much point in calculating a result only to throw it away

  5. 0:17

    - it would be useful to store that value somehow, and maybe even run several operations in a row.

  6. 0:22

    That's where computer memory comes in!

  7. 0:24

    If you've ever been in the middle of a long RPG campaign on your console, or slogging

  8. 0:28

    through a difficult level on Minesweeper on your desktop, and your dog came by, tripped

  9. 0:32

    and pulled the power cord out of the wall, you know the agony of losing all your progress.

  10. 0:36

    Condolences.

  11. 0:38

    But the reason for your loss is that your console, your laptop and your computers make

  12. 0:42

    use of Random Access Memory, or RAM, which stores things like game state - as long as

  13. 0:46

    the power stays on.

  14. 0:47

    Another type of memory, called persistent memory, can survive without power, and it’s

  15. 0:51

    used for different things; We'll talk about the persistence of memory in a later episode.

  16. 0:55

    Today, we’re going to start small - literally by building a circuit that can store one..

  17. 1:00

    single.. bit of information.

  18. 1:01

    After that, we’ll scale up, and build our very own memory module, and we’ll combine

  19. 1:05

    it with our ALU next time, when we finally build our very own CPU!

  20. 1:10

    INTRO

  21. 1:19

    All of the logic circuits we've discussed so far go in one direction - always flowing

  22. 1:23

    forward - like our 8-bit ripple adder from last episode.

  23. 1:26

    But we can also create circuits that loop back on themselves.

  24. 1:29

    Let’s try taking an ordinary OR gate, and feed the output back into one of its inputs

  25. 1:34

    and see what happens.

  26. 1:35

    First, let’s set both inputs to 0.

  27. 1:37

    So 0 OR 0 is 0, and so this circuit always outputs 0.

  28. 1:41

    If we were to flip input A to 1.

  29. 1:44

    1 OR 0 is 1, so now the output of the OR gate is 1.

  30. 1:48

    A fraction of a second later, that loops back around into input B, so the OR gate sees that

  31. 1:52

    both of its inputs are now 1.

  32. 1:54

    1 OR 1 is still 1, so there is no change in output.

  33. 1:58

    If we flip input A back to 0, the OR gate still outputs 1.