CrashCourse · @crashcourse
Registers and RAM: Crash Course Computer Science #6
Uploaded June 8, 2017 · Length 12:17
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.
- 0:03
Hi, I’m Carrie Anne and welcome to Crash Course Computer Science.
- 0:05
So last episode, using just logic gates, we built a simple ALU, which performs arithmetic
- 0:11
and logic operations, hence the ‘A’ and the ‘L’.
- 0:13
But of course, there’s not much point in calculating a result only to throw it away
- 0:17
- it would be useful to store that value somehow, and maybe even run several operations in a row.
- 0:22
That's where computer memory comes in!
- 0:24
If you've ever been in the middle of a long RPG campaign on your console, or slogging
- 0:28
through a difficult level on Minesweeper on your desktop, and your dog came by, tripped
- 0:32
and pulled the power cord out of the wall, you know the agony of losing all your progress.
- 0:36
Condolences.
- 0:38
But the reason for your loss is that your console, your laptop and your computers make
- 0:42
use of Random Access Memory, or RAM, which stores things like game state - as long as
- 0:46
the power stays on.
- 0:47
Another type of memory, called persistent memory, can survive without power, and it’s
- 0:51
used for different things; We'll talk about the persistence of memory in a later episode.
- 0:55
Today, we’re going to start small - literally by building a circuit that can store one..
- 1:00
single.. bit of information.
- 1:01
After that, we’ll scale up, and build our very own memory module, and we’ll combine
- 1:05
it with our ALU next time, when we finally build our very own CPU!
- 1:10
INTRO
- 1:19
All of the logic circuits we've discussed so far go in one direction - always flowing
- 1:23
forward - like our 8-bit ripple adder from last episode.
- 1:26
But we can also create circuits that loop back on themselves.
- 1:29
Let’s try taking an ordinary OR gate, and feed the output back into one of its inputs
- 1:34
and see what happens.
- 1:35
First, let’s set both inputs to 0.
- 1:37
So 0 OR 0 is 0, and so this circuit always outputs 0.
- 1:41
If we were to flip input A to 1.
- 1:44
1 OR 0 is 1, so now the output of the OR gate is 1.
- 1:48
A fraction of a second later, that loops back around into input B, so the OR gate sees that
- 1:52
both of its inputs are now 1.
- 1:54
1 OR 1 is still 1, so there is no change in output.
- 1:58
If we flip input A back to 0, the OR gate still outputs 1.


