Memory & Storage: Crash Course Computer Science #19
CrashCourse
0:03 Hi, I'm Carrie Anne, and welcome to Crash Course Computer Science!
0:05 We’ve talked about computer memory several times in this series,
0:08 and we even designed
0:09 some in Episode 6.
0:11 In general, computer memory is non-permanent.
0:13 If your xbox accidently gets unplugged and turns off,
0:16 any data saved in memory is lost.
0:17 For this reason, it’s called volatile memory.
0:20 What we haven’t talked so much about this series is storage,
0:23 which is a tad different.
0:24 Any data written to storage, like your hard drive,
0:26 will stay there until it’s over-written
0:28 or deleted, even if the power goes out.
0:30 It’s non-volatile.
0:31 It used to be that volatile memory was fast and non-volatile storage was slow,
0:35 but as computing technologies have improved,
0:37 this distinction is becoming less true, and the
0:40 terms have started to blend together.
0:41 Nowadays, we take for granted technologies like this little USB stick,
0:45 which offers gigabytes of memory, reliable over long periods of time,
0:49 all at low cost, but this wasn’t always true.
0:52 INTRO The earliest computer storage was paper punch cards,
1:03 and its close cousin, punched paper tape.
1:05 By the 1940s,
1:06 punch cards had largely standardized into a grid of 80 columns and 12 rows,
1:10 allowing for a maximum of 960 bits of data to be stored on a single card.
1:15 The largest program ever punched onto cards,
1:17 that we know of, was the US Military’s Semi-Automatic
1:19 Ground Environment, or SAGE,
1:21 an Air Defense System that became operational in 1958.
1:24 The main program was stored on 62,500 punchcards,
1:28 roughly equivalent to 5 megabytes of data,
1:30 that’s the size of an average smartphone photo today.
1:34 Punch cards were a useful and popular form of storage for decades,
1:37 they didn’t need power, plus paper was cheap and reasonably durable.
1:40 However, punchcards were slow and write-once, you can’t easily un-punch a hole.
1:44 So they were a less useful form of memory,
1:46 where a value might only be needed for a fraction
1:48 of a second during a program's execution, and then discarded.
1:51 A faster, larger and more flexible form of computer memory was needed.
1:55 An early and practical approach was developed by J.
1:57 Presper Eckert, as he was finishing
1:59 work on ENIAC in 1944.
2:01 His invention was called Delay Line Memory, and it worked like this.
2:05 You take a tube and fill it with a liquid, like mercury.
2:07 Then, you put a speaker at one end and microphone at the other.
2:10 When you pulse the speaker, it creates a pressure wave.
2:13 This takes time to propagate to the other end of the tube,
2:16 where it hits the microphone,
2:17 converting it back into an electrical signal.
2:19 And we can use this propagation delay to store data!
2:22 Imagine that the presence of a pressure wave is
2:24 a 1 and the absence of a pressure wave
2:26 is a 0.
2:27 Our speaker can output a binary sequence like 1010 0111.
2:30 The corresponding waves will travel down the tube,
2:33 in order, and a little while later,
2:35 hit the microphone, which converts the signal back into 1’s and 0’s.
2:38 If we create a circuit that connects the microphone to the speaker,
2:41 plus a little amplifier to
2:43 compensate for any loss, we can create a loop that stores data.
2:46 The signal traveling along the wire is near instantaneous,
2:49 so there’s only ever one
2:50 bit of data showing at any moment in time.
2:53 But in the tube, you can store many bits!
2:55 After working on ENIAC, Eckert and his colleague John Mauchly,
2:58 set out to build a bigger and
2:59 better computer called EDVAC, incorporating Delay Line Memory.
3:03 In total, the computer had 128 Delay Lines, each capable of storing 352 bits.
3:09 That’s a grand total of 45 thousands bits of memory, not too shabby for 1949!
3:15 This allowed EDVAC to be one of the very earliest Stored-Program Computers,
3:18 which we talked about in Episode 10.
3:20 However, a big drawback with delay line memory is that
3:22 you could only read one bit of data
3:24 from a tube at any given instant.
3:26 If you wanted to access a specific bit,
3:27 like bit 112, you’d have to wait for it to come
3:29 around in the loop,
3:31 what’s called sequential or cyclic-access memory, whereas we really
3:34 want random access memory, where we can access any bit at any time.
3:38 It also proved challenging to increase the density of the memory,
3:41 packing waves closer together meant they were more easily mixed up.
3:44 In response, new forms of delay line memory were invented,
3:47 such as magnetostrictive delay
3:48 lines.
3:49 These delay lines use a metal wire that could be twisted,
3:51 creating little torsional waves
3:52 that represented data.
3:54 By forming the wire into a coil,
3:56 you could store around 1000 bits in a 1 foot by 1 foot square.
3:59 However, delay line memory was largely obsolete by the mid 1950s,
4:03 surpassed in performance, reliability and cost by a new kid on the block:
4:07 magnetic core memory which was constructed
4:09 out of little magnetic donuts, called cores.
4:11 If you loop a wire around this core….
4:13 and run an electrical current through the wire,
4:15 we can magnetize the core in a certain direction.
4:17 If we turn the current off, the core will stay magnetized.
4:20 If we pass current through the wire in the opposite direction,
4:24 the magnetization direction, called polarity, flips the other way.
4:27 In this way, we can store 1’s and 0’s!
4:29 1 bit of memory isn’t very useful,
4:31 so these little donuts were arranged into grids.
4:34 There were wires for selecting the right row and column,
4:36 and a wire that ran through every
4:37 core, which could be used to read or write a bit.
4:40 Here is an actual piece of core memory!
4:42 In each of these little yellow squares,
4:44 there are 32 rows and 32 columns of tiny cores,
4:47 each one holding 1 bit of data.
4:49 So, each of these yellow squares could hold 1024 bits.
4:53 In total, there are 9 of these,
4:55 so this memory board could hold a maximum of 9216 bits, which
4:59 is around 9 kilobytes.
5:00 The first big use of core memory was MIT’s Whirlwind 1 computer,
5:05 in 1953, which used
5:06 a 32 by 32 core arrangement.
5:08 And, instead of just a single plane of cores,
5:10 like this, it was 16 boards deep, providing
5:13 roughly 16 thousand bits of storage.
5:15 Importantly, unlike delay line memory, any bit could be accessed at any time.
5:19 This was a killer feature,
5:20 and magnetic core memory became the predominant Random Access
5:23 Memory technology for two decades,
5:24 beginning in the mid 1950s even though it was typically
5:28 woven by hand!
5:29 Although starting at roughly 1 dollar per bit,
5:31 the cost fell to around 1 cent per bit
5:34 by the 1970s.
5:35 Unfortunately, even 1 cent per bit isn’t cheap enough for storage.
5:39 As previously mentioned,
5:40 an average smartphone photo is around 5 megabytes in size, that’s
5:44 roughly 40 million bits.
5:45 Would you pay 4 hundred thousand dollars to store a photo on core memory?
5:50 If you have that kind of money to drop,
5:52 did you know that Crash Course is on Patreon?
5:54 Right?
5:54 Wink wink.
5:55 Anyway,
5:55 there was tremendous research into storage technologies happening at this time.
5:59 By 1951, Eckert and Mauchly had started their own company,
6:02 and designed a new computer called
6:04 UNIVAC, one of the earliest commercially sold computers.
6:07 It debuted with a new form of computer storage: magnetic tape.
6:10 This was a long, thin and flexible strip of magnetic material, stored in reels.
6:15 The tape could be moved forwards or backwards
6:17 inside of a machine called a tape drive.
6:19 Inside is a write head,
6:20 which passes current through a wound wire to generate a magnetic
6:23 field, causing a small section of the tape to become magnetized.
6:26 The direction of the current sets the polarity,
6:28 again, perfect for storing 1’s and 0’s.
6:30 There was also a separate read head could detect the polarity non-destructively.
6:34 The UNIVAC used half-inch-wide tape with 8 parallel data tracks,
6:38 each able to store 128
6:40 bits of data per inch.
6:41 With each reel containing 1200 feet of tape,
6:44 it meant you could store roughly 15 million
6:46 bits– that’s almost 2 megabytes!
6:48 Although tape drives were expensive,
6:50 the magnetic tape itself was cheap and compact, and for
6:53 this reason, they’re still used today for archiving data.
6:56 The main drawback is access speed.
6:58 Tape is inherently sequential,
7:00 you have to rewind or fast-forward to get to data you
7:03 want.
7:03 This might mean traversing hundreds of feet of tape to retrieve a single byte,
7:07 which is slow.
7:08 A related popular technology in the 1950s and 60s was Magnetic Drum Memory.
7:13 This was a metal cylinder– called a drum–
7:15 coated in a magnetic material for recording data.
7:18 The drum was rotated continuously,
7:19 and positioned along its length were dozens of read and write heads.
7:23 These would wait for the right spot to rotate underneath
7:25 them to read or write a bit of data.
7:27 To keep this delay as short as possible,
7:30 drums were rotated thousand of revolutions per minute!
7:32 By 1953, when the technology started to take off,
7:35 you could buy units able to record 80,000
7:37 bits of data– that’s 10 kilobytes,
7:40 but the manufacture of drums ceased in the 1970s.
7:43 However,
7:43 Magnetic Drums did directly lead to the development of Hard Disk Drives, which
7:47 are very similar, but use a different geometric configuration.
7:50 Instead of large cylinder, hard disks use, well… disks… that are hard.
7:54 Hence the name!
7:55 The storage principle is the same,
7:56 the surface of a disk is magnetic, allowing write and
7:59 read heads to store and retrieve 1’s and 0’s.
8:01 The great thing about disks is that they are thin,
8:04 so you can stack many of them together,
8:06 providing a lot of surface area for data storage.
8:08 That’s exactly what IBM did for the world's first computer with a disk drive:
8:12 the RAMAC 305.
8:13 Sweet name BTW.
8:14 It contained fifty, 24-inch diameter disks,
8:16 offering a total storage capacity of roughly
8:19 5 megabytes.Yess!!
8:20 We’ve finally gotten to a technology that can store a single smartphone photo!
8:25 The year was 1956.
8:27 To access any bit of data,
8:28 a read/write head would travel up or down the stack to the right
8:31 disk, and then slide in between them.
8:34 Like drum memory, the disks are spinning,
8:35 so the head has to wait for the right section
8:38 to come around.
8:39 The RAMAC 305 could access any block of data,
8:42 on average, in around 6/10ths of a second,
8:44 what’s called the seek time.
8:46 While great for storage, this was not nearly fast enough for memory,
8:49 so the RAMAC 305 also
8:50 had drum memory and magnetic core memory.
8:53 This is an example of a memory hierarchy,
8:55 where you have a little bit of fast memory,
8:57 which is expensive, slightly more medium-speed memory,
9:00 which is less expensive, and then
9:02 a lot of slowish memory, which is cheap.
9:04 This mixed approach strikes a balance between cost and speed.
9:07 Hard disk drives rapidly improved and became commonplace by the 1970s.
9:11 A hard disk like this can easily hold 1 terabyte of data
9:14 today– that’s a trillion bytes– or roughly 200,000 five megabyte photos!
9:19 And these types of drives can be bought online for as little as 40 US dollars.
9:23 That’s 0.0000000005 cents per bit.
9:29 A huge improvement over core memory’s 1 cent per bit!
9:32 Also, modern drives have an average seek time of under 1/100th of a second.
9:36 I should also briefly mention a close cousin of hard disks,
9:39 the floppy disk, which is basically
9:41 the same thing, but uses a magnetic medium that’s, floppy.
9:44 You might recognise it as the save icon on some of your applications,
9:47 but it was once
9:48 a real physical object!
9:50 It was most commonly used for portable storage,
9:52 and became near ubiquitous from the mid 1970s
9:54 up to the mid 90s.
9:56 And today it makes a pretty good coaster.
9:58 Higher density floppy disks, like Zip Disks,
10:00 became popular in the mid 1990s, but fell
10:03 out of favor within a decade.
10:04 Optical storage came onto the scene in 1972,
10:07 in the form of a 12-inch “laser disc.”
10:09 However, you are probably more familiar with its later,
10:12 smaller, are more popular cousin,
10:13 the Compact Disk, or CD, as well as the DVD which took off in the 90s.
10:17 Functionally,
10:18 these technologies are pretty similar to hard disks and floppy disks, but
10:21 instead of storing data magnetically,
10:23 optical disks have little physical divots in their
10:25 surface that cause light to be reflected differently,
10:27 which is captured by an optical sensor, and
10:30 decoded into 1’s and 0’s.
10:31 However, today, things are moving to solid state technologies,
10:34 with no moving parts,
10:35 like this hard drive and also this USB stick.
10:38 Inside are Integrated Circuits, which we talked about in Episode 15.
10:41 The first RAM integrated circuits became available in 1972 at 1 cent per bit,
10:46 quickly making magnetic core memory obsolete.
10:49 Today, costs have fallen so far,
10:51 that hard disk drives are being replaced with non-volatile,
10:54 Solid State Drives, or SSDs, as the cool kids say.
10:57 Because they contain no moving parts,
10:58 they don’t really have to seek anywhere, so SSD
11:01 access times are typically under 1/1000th of a second.
11:04 That’s fast!
11:05 But it’s still many times slower than your computer’s RAM.
11:08 For this reason, computers today still use memory hierarchies.
11:11 So, we’ve come along way since the 1940s.
11:14 Much like transistor count and Moore’s law,
11:16 which we talked about in Episode 14, memory
11:18 and storage technologies have followed a similar exponential trend.
11:21 From early core memory costing millions of dollars per megabyte,
11:24 we’re steadily fallen,
11:25 to mere cents by 2000, and only fractions of a cent today.
11:29 Plus, there’s WAY less punch cards to keep track of.
11:31 Seriously,
11:32 can you imagine if there was a slight breeze in that room containing the
11:34 SAGE program?
11:36 62,500 punch cards.
11:38 I don’t even want to think about it.
11:39 I'll see you next week.