×

We use cookies to help make LingQ better. By visiting the site, you agree to our cookie policy.


image

CrashCourse: Computer Science, Registers and RAM: Crash Course Computer Science #6

Registers and RAM: Crash Course Computer Science #6

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

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

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

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

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

That's where computer memory comes in!

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

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

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

Condolences.

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

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

the power stays on.

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

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

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

single.. bit of information.

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

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

INTRO

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

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

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

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

and see what happens.

First, let's set both inputs to 0.

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

If we were to flip input A to 1.

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

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

both of its inputs are now 1.

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

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

So now we've got a circuit that records a “1” for us.

Except, we've got a teensy tiny problem - this change is permanent!

No matter how hard we try, there's no way to get this circuit to flip back from a 1

to a 0.

Now let's look at this same circuit, but with an AND gate instead.

We'll start inputs A and B both at 1.

1 AND 1 outputs 1 forever.

But, if we then flip input A to 0, because it's an AND gate, the output will go to 0.

So this circuit records a 0, the opposite of our other circuit.

Like before, no matter what input we apply to input A afterwards, the circuit will always output 0.

Now we've got circuits that can record both 0s and 1s.

The key to making this a useful piece of memory is to combine our two circuits into what is

called the AND-OR Latch.

It has two inputs, a "set" input, which sets the output to a 1, and a "reset" input, which

resets the output to a 0.

If set and reset are both 0, the circuit just outputs whatever was last put in it.

In other words, it remembers a single bit of information!

Memory!

This is called a “latch” because it “latches onto” a particular value and stays that way.

The action of putting data into memory is called writing, whereas getting the data out

is called reading.

Ok, so we've got a way to store a single bit of information!

Great!

Unfortunately, having two different wires for input – set and reset – is a bit confusing.

To make this a little easier to use, we really want a single wire to input data, that we

can set to either 0 or 1 to store the value.

Additionally, we are going to need a wire that enables the memory to be either available

for writing or “locked” down --which is called the write enable line.

By adding a few extra logic gates, we can build this circuit, which is called a Gated Latch

since the “gate” can be opened or closed.

Now this circuit is starting to get a little complicated.

We don't want to have to deal with all the individual logic gates... so as before, we're

going to bump up a level of abstraction, and put our whole Gated Latch circuit in a box

-- a box that stores one bit.

Let's test out our new component!

Let's start everything at 0.

If we toggle the Data wire from 0 to 1 or 1 to 0, nothing happens - the output stays at 0.

That's because the write enable wire is off, which prevents any change to the memory.

So we need to “open” the “gate” by turning the write enable wire to 1.

Now we can put a 1 on the data line to save the value 1 to our latch.

Notice how the output is now 1.

Success!

We can turn off the enable line and the output stays as 1.

Once again, we can toggle the value on the data line all we want, but the output will

stay the same.

The value is saved in memory.

Now let's turn the enable line on again use our data line to set the latch to 0.

Done.

Enable line off, and the output is 0.

And it works!

Now, of course, computer memory that only stores one bit of information isn't very

useful -- definitely not enough to run Frogger.

Or anything, really.

But we're not limited to using only one latch.

If we put 8 latches side-by-side, we can store 8 bits of information like an 8-bit number.

A group of latches operating like this is called a register, which holds a single number,

and the number of bits in a register is called its width.

Early computers had 8-bit registers, then 16, 32, and today, many computers have registers

that are 64-bits wide.

To write to our register, we first have to enable all of the latches.

We can do this with a single wire that connects to all of their enable inputs, which we set to 1.

We then send our data in using the 8 data wires, and then set enable back to 0, and

the 8 bit value is now saved in memory.

Putting latches side-by-side works ok for a small-ish number of bits.

A 64-bit register would need 64 wires running to the data pins, and 64 wires running to

the outputs.

Luckily we only need 1 wire to enable all the latches, but that's still 129 wires.

For 256 bits, we end up with 513 wires!

The solution is a matrix!

In this matrix, we don't arrange our latches in a row, we put them in a grid.

For 256 bits, we need a 16 by 16 grid of latches with 16 rows and columns of wires.

To activate any one latch, we must turn on the corresponding row AND column wire.

Let's zoom in and see how this works.

We only want the latch at the intersection of the two active wires to be enabled,

but all of the other latches should stay disabled.

For this, we can use our trusty AND gate!

The AND gate will output a 1 only if the row and the column wires are both 1.

So we can use this signal to uniquely select a single latch.

This row/column setup connects all our latches with a single, shared, write enable wire.

In order for a latch to become write enabled, the row wire, the column wire, and the write

enable wire must all be 1.

That should only ever be true for one single latch at any given time.

This means we can use a single, shared wire for data.

Because only one latch will ever be write enabled, only one will ever save the data

-- the rest of the latches will simply ignore values on the data wire because they are not

write enabled.

We can use the same trick with a read enable wire to read the data later, to get the data

out of one specific latch.

This means in total, for 256 bits of memory, we only need 35 wires - 1 data wire, 1 write

enable wire, 1 read enable wire, and 16 rows and columns for the selection.

That's significant wire savings!

But we need a way to uniquely specify each intersection.

We can think of this like a city, where you might want to meet someone at 12th avenue

and 8th street -- that's an address that defines an intersection.

The latch we just saved our one bit into has an address of row 12 and column 8.

Since there is a maximum of 16 rows, we store the row address in a 4 bit number.

12 is 1100 in binary.

We can do the same for the column address: 8 is 1000 in binary.

So the address for the particular latch we just used can be written as 11001000.

To convert from an address into something that selects the right row or column, we need

a special component called a multiplexer -- which is the computer component with a pretty cool

name at least compared to the ALU.

Multiplexers come in all different sizes, but because we have 16 rows, we need a 1 to

16 multiplexer.

It works like this.

You feed it a 4 bit number, and it connects the input line to a corresponding output line.

So if we pass in 0000, it will select the very first column for us.

If we pass in 0001, the next column is selected, and so on.

We need one multiplexer to handle our rows and another multiplexer to handle the columns.

Ok, it's starting to get complicated again, so let's make our 256-bit memory its own component.

Once again a new level of abstraction!

It takes an 8-bit address for input - the 4 bits for the column and 4 for the row.

We also need write and read enable wires.

And finally, we need just one data wire, which can be used to read or write data.

Unfortunately, even 256-bits of memory isn't enough to run much of anything, so we need

to scale up even more!

We're going to put them in a row.

Just like with the registers.

We'll make a row of 8 of them, so we can store an 8 bit number - also known as a byte.

To do this, we feed the exact same address into all 8 of our 256-bit memory components

at the same time, and each one saves one bit of the number.

That means the component we just made can store 256 bytes at 256 different addresses.

Again, to keep things simple, we want to leave behind this inner complexity.

Instead of thinking of this as a series of individual memory modules and circuits, we'll

think of it as a uniform bank of addressable memory.

We have 256 addresses, and at each address, we can read or write an 8-bit value.

We're going to use this memory component next episode when we build our CPU.

The way that modern computers scale to megabytes and gigabytes of memory is by doing the same

thing we've been doing here -- keep packaging up little bundles of memory into larger, and

larger, and larger arrangements.

As the number of memory locations grow, our addresses have to grow as well.

8 bits hold enough numbers to provide addresses for 256 bytes of our memory, but that's all.

To address a gigabyte – or a billion bytes of memory – we need 32-bit addresses.

An important property of this memory is that we can access any memory location, at any

time, and in a random order.

For this reason, it's called Random-Access Memory or RAM.

When you hear people talking about how much RAM a computer has - that's the computer's memory.

RAM is like a human's short term or working memory, where you keep track of things going

on right now - like whether or not you had lunch or paid your phone bill.

Here's an actual stick of RAM - with 8 memory modules soldered onto the board.

If we carefully opened up one of these modules and zoomed in, The first thing you would see

are 32 squares of memory.

Zoom into one of those squares, and we can see each one is comprised of 4 smaller blocks.

If we zoom in again, we get down to the matrix of individual bits.

This is a matrix of 128 by 64 bits.

That's 8192 bits in total.

Each of our 32 squares has 4 matrices, so that's 32 thousand, 7 hundred and 68 bits.

And there are 32 squares in total.

So all in all, that's roughly 1 million bits of memory in each chip.

Our RAM stick has 8 of these chips, so in total, this RAM can store 8 millions bits,

otherwise known as 1 megabyte.

That's not a lot of memory these days -- this is a RAM module from the 1980's.

Today you can buy RAM that has a gigabyte or more of memory - that's billions of bytes

of memory.

So, today, we built a piece of SRAM - Static Random-Access Memory – which uses latches.

There are other types of RAM, such as DRAM, Flash memory, and NVRAM.

These are very similar in function to SRAM, but use different circuits to store the individual

bits -- for example, using different logic gates, capacitors, charge traps, or memristors.

But fundamentally, all of these technologies store bits of information in massively nested

matrices of memory cells.

Like many things in computing, the fundamental operation is relatively simple.. it's the

layers and layers of abstraction that's mind blowing -- like a russian doll that

keeps getting smaller and smaller and smaller.

I'll see you next week.

Credits


Registers and RAM: Crash Course Computer Science #6

Hi, I'm Carrie Anne and welcome to Crash Course Computer Science. 안녕하세요, 전 Carrie Anne이고, 컴퓨터 과학 특강에 온 것을 환영해요.

So last episode, using just logic gates, we built a simple ALU, which performs arithmetic 지난 에피소드에서,

and logic operations, hence the ‘A' and the ‘L'. ALU의 'A'는 산술(Arithmetic)이고, 'L'은 논리(Logic)입니다.

But of course, there's not much point in calculating a result only to throw it away 하지만 계산한 결과가 버려진다면 아무 소용이 없지요.

- it would be useful to store that value somehow, and maybe even run several operations in a row. 계산 결과가 어떻게든 저장되어야지 유용하게 쓰일 수 있습니다.

That's where computer memory comes in! 그래서 컴퓨터 메모리가 필요합니다.

If you've ever been in the middle of a long RPG campaign on your console, or slogging 게임기에서 긴 RPG 게임을 하던 도중이나,

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

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

Condolences. 애도를 표합니다.

But the reason for your loss is that your console, your laptop and your computers make 이런 일이 일어나는 이유는 콘솔 게임기, 노트북이나 컴퓨터가

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

the power stays on.

Another type of memory, called persistent memory, can survive without power, and it's 지속성 메모리 (Persistent Memory)라고 불리는 다른 유형의 메모리는 전력 공급없이도 살아남을 수 있습니다.

used for different things; We'll talk about the persistence of memory in a later episode. 이건 다른 데에 사용되니까, 다른 강의에서 메모리의 지속성에 대해 이야기 할게요.

Today, we're going to start small - literally by building a circuit that can store one.. 오늘 우리는 작은것부터 시작할거에요.

single.. bit of information.

After that, we'll scale up, and build our very own memory module, and we'll combine 그리고 나서 크기를 키워서 우리 만의 메모리 모듈을 만들겁니다.

it with our ALU next time, when we finally build our very own CPU! 그런 다음 이 메모리를 ALU와 합치고, 최종적으로 우리만의 CPU를 만들거에요.

INTRO

All of the logic circuits we've discussed so far go in one direction - always flowing 지금까지 배웠던 모든 논리 회로는 오직 한 방향으로만 진행했습니다. 항상 앞으로만 갔지요.

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

But we can also create circuits that loop back on themselves. 하지만 우리는 스스로 되돌아 오는 (loop back) 회로도 만들 수 있습니다.

Let's try taking an ordinary OR gate, and feed the output back into one of its inputs 일반적인 OR게이트를 살펴보죠.

and see what happens. 무슨 일이 일어나는지 봅시다.

First, let's set both inputs to 0. 먼저, 모든 입력을 0으로 합니다.

So 0 OR 0 is 0, and so this circuit always outputs 0. 0 OR 0는 0이니까, 이 회로는 항상 0을 출력하겠네요.

If we were to flip input A to 1. 만약 입력 A를 1로 바꾼다면

1 OR 0 is 1, so now the output of the OR gate is 1. 1 OR 0은 1, 그래서 출력은 1이 됩니다

A fraction of a second later, that loops back around into input B, so the OR gate sees that 짧은 시간 후에, 입력 B로 신호가 돌아와서,

both of its inputs are now 1. OR게이트의 모든 입력이 1이 됩니다.

1 OR 1 is still 1, so there is no change in output. 1 OR 1 역시 1이니까, 출력에 변화가 없죠

If we flip input A back to 0, the OR gate still outputs 1. 이젠 입력 A를 0으로 뒤집어도, OR게이트는 여전히 1을 출력합니다.

So now we've got a circuit that records a “1” for us. 따라서 "1"을 기록하는 회로를 얻은 겁니다

Except, we've got a teensy tiny problem - this change is permanent! 다만, 아주 조그만 문제가 있습니다. 이후에 다시 바뀌지 않는다는 거에요..

No matter how hard we try, there's no way to get this circuit to flip back from a 1 아무리 노력해도 1에서 0으로로 바꿀 방법이 없습니다.

to a 0. 아무리 노력해도 1에서 0으로로 바꿀 방법이 없습니다.

Now let's look at this same circuit, but with an AND gate instead. 이번엔 AND게이트를 가지고 같은 회로를 살펴보죠.

We'll start inputs A and B both at 1. 입력 A와 B가 모두 1일 때부터 시작합시다.

1 AND 1 outputs 1 forever. 1 AND 1은 1을 영원히 출력합니다.

But, if we then flip input A to 0, because it's an AND gate, the output will go to 0. 하지만 A를 0으로 바꾸면, AND게이트기 때문에 출력이 0으로 바뀔 겁니다.

So this circuit records a 0, the opposite of our other circuit. 그래서 이 회로는 0을 기록합니다. 아까랑 반대로요.

Like before, no matter what input we apply to input A afterwards, the circuit will always output 0. 전처럼, 이후에 A가 뭐가 됐든 출력은 항상 0이 됩니다.

Now we've got circuits that can record both 0s and 1s. 이제 우리는 0과 1을 기록할 수 있는 회로를 얻었습니다.

The key to making this a useful piece of memory is to combine our two circuits into what is 이것을 쓸만한 메모리 조각으로 만드는 비결은 두 회로를 합치는 겁니다.

called the AND-OR Latch. 이것을 AND-OR 래치(자물쇠 또는 걸쇠의 의미) 라고 합니다.

It has two inputs, a "set" input, which sets the output to a 1, and a "reset" input, which 이 래치는 2개의 입력을 갖고 있습니다. 출력을 1로 만드는 "set"입력과,

resets the output to a 0.

If set and reset are both 0, the circuit just outputs whatever was last put in it. 모든 입력이 0이 된다면, 회로는 마지막에 넣은 것을 출력합니다.

In other words, it remembers a single bit of information! 다시 말하면, 한 비트의 정보를 기억하는거죠!

Memory! 메모리!!

This is called a “latch” because it “latches onto” a particular value and stays that way. 이것을 래치(자물쇠 또는 걸쇠)라고 하는데, 특정한 값을 "붙잡아서" 유지하는 성질 때문이에요.

The action of putting data into memory is called writing, whereas getting the data out 메모리에 데이터를 넣는 동작을 "쓰기, writing"이라고 하고,

is called reading.

Ok, so we've got a way to store a single bit of information! 좋아요. 우리는 한 비트의 정보를 저장하는 법을 알았습니다

Great! 엄청나군요!

Unfortunately, having two different wires for input – set and reset – is a bit confusing. 아쉽게도, set과 reset 두 개의 입력이 있어서 혼동되지요.

To make this a little easier to use, we really want a single wire to input data, that we 좀더 사용하기 쉽게, 데이터를 입력하는 선 하나만 있으면 좋을텐데요.

can set to either 0 or 1 to store the value. 0과 1만 설정하면 그 값을 저장할 수 있도록요.

Additionally, we are going to need a wire that enables the memory to be either available 추가로 메모리 쓰기를 가능하게 하거나 그럴 수 없게 잠궈버릴 수 있는 신호가 필요합니다.

for writing or “locked” down --which is called the write enable line.

By adding a few extra logic gates, we can build this circuit, which is called a Gated Latch 논리 게이트 몇 개 추가해서 원하는 회로를 만들 수 있습니다.

since the “gate” can be opened or closed. "문(gate)"을 열거나 닫을 수 있다는 뜻이지요.

Now this circuit is starting to get a little complicated. 이제 회로가 좀 복잡해지기 시작하네요

We don't want to have to deal with all the individual logic gates... so as before, we're 각 논리회로를 일일이 다루기 싫으니

going to bump up a level of abstraction, and put our whole Gated Latch circuit in a box

-- a box that stores one bit. 하나의 비트를 저장하는 상자로요

Let's test out our new component! 자, 새로운 부품을 테스트해보죠!

Let's start everything at 0. 모두 0으로 만들고 시작해봅시다.

If we toggle the Data wire from 0 to 1 or 1 to 0, nothing happens - the output stays at 0. 0에서 1로, 1에서 0으로 데이터 선을 바꿔도 아무 일도 일어나지 않고 출력은 0을 유지합니다.

That's because the write enable wire is off, which prevents any change to the memory. write enable 선이 꺼져 있기 때문이죠. 이건 메모리가 바뀌는 것을 막는 것입니다.

So we need to “open” the “gate” by turning the write enable wire to 1. write enable 선을 1로 바꾸어 "Gate"를 "열어"줍시다.

Now we can put a 1 on the data line to save the value 1 to our latch. 이제 래치에 값 1을 저장하도록 데이터 선에 1을 넣을 수 있게 되었네요.

Notice how the output is now 1. 어떻게 1이 출력되는지 주목하세요.

Success! 성공!

We can turn off the enable line and the output stays as 1. 이제 출력이 1로 유지 되도록 enable 선을 끕시다.

Once again, we can toggle the value on the data line all we want, but the output will 다시 한번 데이터 선의 값을 원하는 데로 바꿔 보면,

stay the same.

The value is saved in memory. 값이 메모리에 저장된 겁니다

Now let's turn the enable line on again use our data line to set the latch to 0. 이제 enable 선을 다시 켜고, 데이터 선을 사용해서 래치를 0으로 세팅해봅시다.

Done. 됐네요

Enable line off, and the output is 0. enable 선을 끄고, 출력은 0입니다.

And it works! 제대로 작동하죠.

Now, of course, computer memory that only stores one bit of information isn't very 물론 컴퓨터 메모리가 한 비트만 저장할 수 있다면 그건 정말로 쓸모가 없죠.

useful -- definitely not enough to run Frogger. 프로거(80년대 PC 게임)를 돌리기에도 절대로 충분하지 않습니다.

Or anything, really. 아니면 아무것도 못돌리든가요.

But we're not limited to using only one latch. 래치를 딱 한개만 사용하라는 법은 없지요.

If we put 8 latches side-by-side, we can store 8 bits of information like an 8-bit number. 래치 8개를 옆으로 나란히 두면, 8비트 숫자 같은 8비트의 정보를 저장할 수 있게 됩니다.

A group of latches operating like this is called a register, which holds a single number, 이렇게 작동하는 래치 그룹을 "레지스터(register)"라고 부릅니다.

and the number of bits in a register is called its width. 그리고 레지스터의 비트 수는 "너비(width)"라고 부릅니다.

Early computers had 8-bit registers, then 16, 32, and today, many computers have registers 초기의 컴퓨터는 8 비트 레지스터를 가지고 있었고 16, 32 순으로 커져, 요즘 대부분의 컴퓨터는 레지스터가

that are 64-bits wide. 64 비트의 너비를 가집니다

To write to our register, we first have to enable all of the latches. 레지스터에 쓰기 위해, 먼저 모든 래치를 켜야 합니다.

We can do this with a single wire that connects to all of their enable inputs, which we set to 1. 선 하나를 모든 래치의 enable 입력에 연결하고 1로 세팅합시다.

We then send our data in using the 8 data wires, and then set enable back to 0, and 그런 뒤에 8개의 데이터 선을 이용하여 데이터를 보내고 enable을 다시 0으로 되돌립니다

the 8 bit value is now saved in memory. 그러면 8 비트 값은 메모리에 저장됩니다.

Putting latches side-by-side works ok for a small-ish number of bits. 래치를 나란히 놓아서 적은 수의 비트를 처리하는 것은 문제가 없습니다.

A 64-bit register would need 64 wires running to the data pins, and 64 wires running to 64 비트 레지스터는 64개의 데이터 입력을 위한 선들과 64개의 출력을 위한 선이 필요하겠지요.

the outputs. 64 비트 레지스터는 64개의 데이터 입력을 위한 선들과 64개의 출력을 위한 선이 필요하겠지요.

Luckily we only need 1 wire to enable all the latches, but that's still 129 wires. 다행히 모든 래치의 enable 선은 1개만 있어도 됩니다. 그래도 선 129개가 필요하지요.(1+64+64)

For 256 bits, we end up with 513 wires! 256 비트 레지스터는 선이 513개나 필요합니다.

The solution is a matrix! 해결 방법은 매트릭스(행렬)를 사용하는 겁니다.

In this matrix, we don't arrange our latches in a row, we put them in a grid. 매트릭스에서는 래치를 일렬로 배열하지 않고 격자로 배열합니다.

For 256 bits, we need a 16 by 16 grid of latches with 16 rows and columns of wires. 256비트 레지스터를 위해서는 16개의 행과 16개 열로 된 16x16개 격자로 구성합니다.

To activate any one latch, we must turn on the corresponding row AND column wire. 래치 하나를 활성화 하려면 해당하는 행과 열을 같이 켜줘야 합니다.

Let's zoom in and see how this works. 확대해서 어떻게 동작하는지 보지요.

We only want the latch at the intersection of the two active wires to be enabled, enable된 두 선의 교점에 있는 래치만 동작시키고,

but all of the other latches should stay disabled. 나머지는 동작하지 않도록 해야지요.

For this, we can use our trusty AND gate! 그러기 위해서, 믿음직한 AND 게이트를 사용합니다.

The AND gate will output a 1 only if the row and the column wires are both 1. AND 게이트는 열과 행이 모두 1이 되어야 1을 출력해서,

So we can use this signal to uniquely select a single latch. 단 하나의 래치만 선택할 수 있는 신호로 사용할 수가 있는 것이지요.

This row/column setup connects all our latches with a single, shared, write enable wire. 이렇게 행/열을 설치하기 때문에 모든 래치에 write enable을 선 하나로 공통으로 연결할 수 있습니다.

In order for a latch to become write enabled, the row wire, the column wire, and the write 하나의 래치가 쓰기 가능해지려면, 행, 열, 그리고 write enable 선이 모두 1이 되어야만 합니다.

enable wire must all be 1. 하나의 래치가 쓰기 가능해지려면, 행, 열, 그리고 write enable 선이 모두 1이 되어야만 합니다.

That should only ever be true for one single latch at any given time. 그래서 주어진 시간에 오직 하나의 래치만 작동합니다.

This means we can use a single, shared wire for data. 이 얘기는 데이터에 단일 공유 회선을 사용한다는걸 의미해요.

Because only one latch will ever be write enabled, only one will ever save the data 오직 한 개의 래치만 쓰기가 가능해지고, 데이터를 저장할 수 있기 때문이죠.

-- the rest of the latches will simply ignore values on the data wire because they are not 나머지 래치들은 단순히 데이터 선의 값들을 무시해버립니다.

write enabled.

We can use the same trick with a read enable wire to read the data later, to get the data 같은 방법으로 하나의 read enable 선을 사용해서 하나의 래치를 콕 찍어서 데이터를 읽어올 수 있습니다.

out of one specific latch. 같은 방법으로 하나의 read enable 선을 사용해서 하나의 래치를 콕 찍어서 데이터를 읽어올 수 있습니다.

This means in total, for 256 bits of memory, we only need 35 wires - 1 data wire, 1 write 정리하면, 256비트 메모리를 위해서 총 35개의 선만 사용하면 됩니다.

enable wire, 1 read enable wire, and 16 rows and columns for the selection.

That's significant wire savings! 엄청나게 선의 수를 줄일 수가 있지요.

But we need a way to uniquely specify each intersection. 각 교차점을 정확하게 지정할 수 있는 방법이 필요합니다.

We can think of this like a city, where you might want to meet someone at 12th avenue 여러분이 12th avenue, 8th street에서 누군가를 만난다고 해보죠.

and 8th street -- that's an address that defines an intersection. 12th avenue 그리고 8th street. 이게 교차로를 나타내는 주소 입니다.

The latch we just saved our one bit into has an address of row 12 and column 8. 12번째 행, 8번째 열의 주소에 있는 래치에 하나의 비트를 저장했다고 합시다.

Since there is a maximum of 16 rows, we store the row address in a 4 bit number. 최대 16개 행이 있으니까, 행 주소를 4비트로 표현합니다.

12 is 1100 in binary. 12는 이진수로 1100입니다.

We can do the same for the column address: 8 is 1000 in binary. 열 주소도 마찬가지입니다. 8은 이진수로 1000이죠.

So the address for the particular latch we just used can be written as 11001000. 이렇게 특정 래치를 나타내는 주소를

To convert from an address into something that selects the right row or column, we need 특정한 행이나 열을 선택한 주소로 변환하기 위해서는

a special component called a multiplexer -- which is the computer component with a pretty cool 멀티플렉서라고 하는 특별한 부품이 필요합니다. 꽤 멋진 이름을 가진 컴퓨터 부품이죠.

name at least compared to the ALU.

Multiplexers come in all different sizes, but because we have 16 rows, we need a 1 to 멀티플렉서는 어떤 크기도 가능하지만, 여기서는 행이 16개니까,

16 multiplexer. 1 to 16 멀티플렉서가 필요합니다.

It works like this. 이렇게 작동합니다.

You feed it a 4 bit number, and it connects the input line to a corresponding output line. 4비트 숫자를 입력하고, 입력선을 그에 해당하는 출력 선에 연결합니다.

So if we pass in 0000, it will select the very first column for us. 0000을 넣으면, 제일 첫 열을 선택할 겁니다.

If we pass in 0001, the next column is selected, and so on. 0001을 넣으면, 그 다음 열을 선택할거구요. 다른 수도 만찬 가지입니다.

We need one multiplexer to handle our rows and another multiplexer to handle the columns. 행을 담당하는 멀티플렉서와 열을 담당하는 멀티플렉서가 필요합니다.

Ok, it's starting to get complicated again, so let's make our 256-bit memory its own component. 좋아요, 다시 복잡해지기 시작하는 군요. 256 비트 메모리를 하나의 부품으로 만듭시다.

Once again a new level of abstraction! 한 번 더 새로운 추상화 레벨!

It takes an 8-bit address for input - the 4 bits for the column and 4 for the row. 8비트 주소를 입력으로 받습니다. 4비트는 행을 4비트는 열을 나타내지요.

We also need write and read enable wires. write와 read enable이 필요하고요.

And finally, we need just one data wire, which can be used to read or write data. 마지막으로 데이터 선 하나가 있어야죠. 이 선으로 데이터 읽기, 쓰기를 할 겁니다.

Unfortunately, even 256-bits of memory isn't enough to run much of anything, so we need 아쉽게도, 256 비트 메모리라고 할지라도 뭔가를 하기에는 충분하지 않습니다.

to scale up even more! 그래서 더 확장해볼 거에요.

We're going to put them in a row. 이것들을 한 열로 붙여봅니다.

Just like with the registers. 레지스터 같이요.

We'll make a row of 8 of them, so we can store an 8 bit number - also known as a byte. 8개를 일렬로 세웠으니 , 8비트의 숫자를 저장할 수가 있습니다.

To do this, we feed the exact same address into all 8 of our 256-bit memory components 그럴려면, 8개 모든 256비트 메모리에 정확히 똑같은 주소를 동시에 입력합니다.

at the same time, and each one saves one bit of the number.

That means the component we just made can store 256 bytes at 256 different addresses. 즉, 방금 만든 부품은 256개의 주소에 256 바이트를 저장할 수 있다는 거죠.

Again, to keep things simple, we want to leave behind this inner complexity. 이렇게 복잡한건 치워 버리고, 다시 한번 간단하게 만들어 봅시다.

Instead of thinking of this as a series of individual memory modules and circuits, we'll 일렬로 연결된 메모리 모듈과 회로로 생각하는 대신에,

think of it as a uniform bank of addressable memory. 주소로 지정 가능한 메모리의 일정한 분할단위 (뱅크) 라고 생각합시다.

We have 256 addresses, and at each address, we can read or write an 8-bit value. 256개의 주소가 있고, .

We're going to use this memory component next episode when we build our CPU. 이 메모리를 다음 강의에서 만들어 볼 CPU에 사용할 겁니다.

The way that modern computers scale to megabytes and gigabytes of memory is by doing the same 요즘 컴퓨터에서 메모리를 메가바이트와 기가바이트로 확장하는 방법도 여기서 배운 것과 동일합니다.

thing we've been doing here -- keep packaging up little bundles of memory into larger, and

larger, and larger arrangements. 작은 메모리 묶음을 크고 크고 더 큰 배열로 묶는 거에요.

As the number of memory locations grow, our addresses have to grow as well. 메모리 위치의 수가 증가하면, 주소도 증가해야 됩니다.

8 bits hold enough numbers to provide addresses for 256 bytes of our memory, but that's all. 8비트의 주소는 256바이트의 메모리에 나타내기에 충분하지만, 그게 다죠.

To address a gigabyte – or a billion bytes of memory – we need 32-bit addresses. 기가바이트 (십억 바이트) 메모리의 주소를 나타내려면 32비트 주소가 필요합니다.

An important property of this memory is that we can access any memory location, at any 오늘 배운 메모리의 중요한 특성은

time, and in a random order.

For this reason, it's called Random-Access Memory or RAM. 그래서 임의 접근 메모리 (Random Access Memory), RAM이라고 부르는 것입니다.

When you hear people talking about how much RAM a computer has - that's the computer's memory. 컴퓨터에 얼마나 큰 RAM을 달았는지 얘기하는 것은 컴퓨터 메모리를 말하는 것입니다.

RAM is like a human's short term or working memory, where you keep track of things going RAM은 인간의 단기 또는 활동 중인 기억과 비슷합니다. 사람은 일들이 잘 되고 있는지 계속 추적하고 있어야지요.

on right now - like whether or not you had lunch or paid your phone bill.

Here's an actual stick of RAM - with 8 memory modules soldered onto the board. 이게 진짜 막대기 모양의 RAM입니다. 보드에 8개의 메모리가 납땜되어있죠.

If we carefully opened up one of these modules and zoomed in, The first thing you would see 메모리 모듈 한 개를 조심 스럽게 열어서 확대해 보면,

are 32 squares of memory.

Zoom into one of those squares, and we can see each one is comprised of 4 smaller blocks. 이 사각형 하나를 확대하면, 4개의 블럭을 볼 수가 있지요.

If we zoom in again, we get down to the matrix of individual bits. 다시 한번 확대하면, 각각 비트의 행렬이 나옵니다.

This is a matrix of 128 by 64 bits. 이것은 128 x 64 비트 행렬 입니다.

That's 8192 bits in total. 총 8192 비트입니다.

Each of our 32 squares has 4 matrices, so that's 32 thousand, 7 hundred and 68 bits. 32개의 사각형이 각각 4개의 행렬을 갖고 있으니까, 3만 2천 7백 68 비트

And there are 32 squares in total. 사각형이 32개니까,

So all in all, that's roughly 1 million bits of memory in each chip. 이 칩에는 대략 백 만 비트가 있군요. (32768*32=1,048,576)

Our RAM stick has 8 of these chips, so in total, this RAM can store 8 millions bits, RAM 스틱에 이런 칩이 8개 있으니까, 총 8백만 비트 또는 1 메가바이트를 저장할 수 있습니다.

otherwise known as 1 megabyte. RAM 스틱에 이런 칩이 8개 있으니까, 총 8백만 비트 또는 1 메가바이트를 저장할 수 있습니다.

That's not a lot of memory these days -- this is a RAM module from the 1980's. 이 메모리는 요즘 쓰이는 것이 아니고, 1980년대에 쓰이던 모듈입니다.

Today you can buy RAM that has a gigabyte or more of memory - that's billions of bytes 요즘에는 기가바이트 이상의 메모리를 살 수 있습니다.

of memory. 오늘 우리는 래치를 이용해서 SRAM (Static Random Access Memory) 한 조각을 만들어 보았습니다.

So, today, we built a piece of SRAM - Static Random-Access Memory – which uses latches.

There are other types of RAM, such as DRAM, Flash memory, and NVRAM. DRAM, Flash 메모리, NVRAM과 같이 다른 종류의 램도 있습니다.

These are very similar in function to SRAM, but use different circuits to store the individual SRAM과 기능은 거의 유사합니다. 각각의 비트를 저장하는 회로에 차이가 있는 거지요.

bits -- for example, using different logic gates, capacitors, charge traps, or memristors.

But fundamentally, all of these technologies store bits of information in massively nested 그러나 근본적으로, 이 모든 기술은 메모리 셀이 대량으로 포개진 행과 열 안에서

matrices of memory cells. 정보 비트를 저장하는 기술들입니다.

Like many things in computing, the fundamental operation is relatively simple.. it's the 컴퓨팅의 많은 부분과 마찬가지로 기본적인 동작은 상대적으로 간단해요.

layers and layers of abstraction that's mind blowing -- like a russian doll that 놀랄만한 추상화의 단계, 단계들이 있지요.

keeps getting smaller and smaller and smaller.

I'll see you next week. 다음 주에 봅시다.

Credits