Early Programming: Crash Course Computer Science #10
Summary
TLDR本集《计算机科学速成课》由Carrie Anne主持,深入探讨了计算机程序如何被加载到计算机内存中。节目首先回顾了计算机如何使用复杂电路进行数据存储和检索,以及执行操作的过程。随后,介绍了早期纺织机械的编程需求,特别是Joseph Marie Jacquard在1801年展示的可编程纺织机,它通过穿孔卡片来定义布料的图案。这种穿孔卡片的方式,不仅在后来的人口普查中得到应用,也成为了早期编程的一种形式。随着时间的推移,商业机器的功能不断增强,但编程方式依然复杂。直到20世纪40年代末,电子存储器的出现使得程序可以完全存储在计算机内存中,形成了所谓的存储程序计算机。节目还介绍了冯·诺依曼架构,它将程序和数据统一存储在单一共享内存中。此外,还提到了穿孔卡片和纸带等数据输入输出方式,以及面板编程等早期编程方法。最后,节目预告了下一集将讨论编程语言,为观众揭示了计算机科学发展的历程。
Takeaways
- 💾 计算机程序是如何被加载到计算机内存中的,这并非魔法,而是计算机科学的一部分。
- 🧵 在计算机发展之前,编程需求就已经存在,如纺织制造业中的可编程织布机。
- 📇 约瑟夫·玛丽·雅卡尔在1801年发明了一种可编程的纺织机,使用穿孔卡片来定义布料的每一行图案。
- 📊 穿孔卡片成为了一种廉价、可靠、相对人类可读的方式来存储数据,并在1890年的人口普查中被使用。
- 🔢 早期的制表机虽然能够进行计算,但它们并非真正的计算机,因为它们的操作是固定的,不能编程。
- 🔌 在20世纪20年代,通过控制面板上的插座和电缆,程序员可以激活不同的机器功能,这些控制面板也被称为插线板。
- 🚀 随着电子存储器在1940年代末到50年代变得可行,程序可以完全存储在计算机的内存中,这导致了存储程序计算机的诞生。
- 🌐 冯·诺依曼架构将程序和数据统一存储在单一共享内存中,这是现代计算机的基础架构。
- 🏛️ 1948年,曼彻斯特大学建造了第一个冯·诺依曼架构的存储程序计算机,绰号为“婴儿”。
- 📚 穿孔卡片在20世纪80年代之前被广泛用于计算机数据的输入和输出。
- 🔵 早期计算机编程是专家的领域,需要对底层硬件有深入的了解。
- 🔠 为了简化编程,人们开始寻求更简单的方法来编写程序,这引导了编程语言的发展。
Q & A
计算机程序是如何进入计算机内存的?
-计算机程序需要被加载到计算机的内存中。这通常不是通过魔法,而是通过计算机科学的方法实现的。早期,程序通过穿孔卡片读取器输入,后来发展到使用电子内存,使得程序可以完全存储在计算机的内存中,方便程序员修改和CPU快速访问。
约瑟夫·玛丽·雅卡尔是如何改进纺织机的?
-约瑟夫·玛丽·雅卡尔开发了一种可编程的纺织机,通过穿孔卡片来定义布料每一行的图案。卡片上的孔洞决定织布机上的纱线是抬高还是降低,从而形成不同的图案。
穿孔卡片是如何帮助进行人口普查的?
-在1890年的人口普查中,穿孔卡片被用来存储每个人的数据,如种族、婚姻状况、孩子数量、出生国家等。人口普查工作人员会在卡片上适当位置打孔,卡片被送入制表机后,每个孔洞都会使得对应答案的运行总数增加一。
早期的制表机与真正的计算机有什么区别?
-早期的制表机功能固定,不能编程,它们只能进行单一的操作——制表。与之相比,真正的计算机是可编程的,可以根据不同的程序执行不同的任务。
什么是控制面板(plug board)?
-控制面板是早期计算机用来触发不同计算功能的一种方式。程序员通过在面板上插入电缆来传递值和信号,因此也被称为插线板。这种方式编程非常复杂,需要重新布线以运行不同的程序。
冯·诺依曼架构是什么?
-冯·诺依曼架构是一种将程序和数据统一存储在单一共享内存中的计算机架构。它以数学家和物理学家约翰·冯·诺依曼命名,其特征包括一个包含算术逻辑单元、数据寄存器、指令寄存器和指令地址寄存器的处理单元,以及一个存储数据和指令的内存。
世界上第一台冯·诺依曼架构的存储程序计算机是什么时候建造的?
-世界上第一台冯·诺依曼架构的存储程序计算机是在1948年由曼彻斯特大学建造的,绰号为“婴儿”(Baby)。
为什么穿孔卡片在计算机早期历史中非常重要?
-穿孔卡片是将编程数据加载到计算机内存中的一种方式。它们也被用于将数据从计算机输出,通过在程序结束时将结果打印到穿孔卡片上,然后这些卡片可以由人工分析或加载到另一个程序中进行进一步计算。
什么是打孔纸带,它与穿孔卡片有何不同?
-打孔纸带是穿孔卡片的近亲,其基本思想相同,但是数据是连续存储在一条纸带上,而不是单独的卡片上。
面板编程是如何进行的?
-面板编程是通过控制台面板上的大量开关和按钮来编程和控制计算机的一种方式。与物理插线板相比,面板编程可以通过操作开关和按钮来激活某些功能,并且有指示灯显示内存中不同功能和值的状态。
早期计算机编程为什么是专家的领域?
-早期计算机编程需要对底层硬件有深入的了解,比如处理器的操作码和寄存器位。这意味着编程是困难和繁琐的,即使是专业的工程师和科学家也难以充分利用计算所能提供的优势。
为什么需要更简单的编程语言?
-为了简化告诉计算机如何执行任务的过程,需要一种更简单的编写程序的方式。这导致了编程语言的发展,使得非专业人士也能更容易地使用计算机。
Outlines
📚 计算机程序的起源与存储
Carrie Anne在Crash Course Computer Science中介绍了计算机如何工作,包括使用复杂电路存储和检索内存中的值,以及执行操作,如加法。她提到了操作序列,即计算机程序,并探讨了程序如何加载到计算机内存中。早期的编程需求出现在纺织制造业,Joseph Marie Jacquard在1801年开发了可编程的纺织机,使用穿孔卡片来定义布料的图案。穿孔卡片后来被用于1890年的人口普查,每个卡片存储一个人的数据。早期的制表机虽然能够进行计数,但它们不是可编程的计算机。随着时间的推移,商业机器的功能不断增强,但编程仍然复杂。到了20世纪40年代,电子存储器变得可行,程序可以完全存储在计算机的内存中,这导致了存储程序计算机的出现,即冯·诺依曼架构计算机。
📋 早期计算机编程与数据输入
尽管电子计算机内存的出现极大地提高了编程的便利性,但在计算机运行之前,仍然需要将编程数据加载到计算机中。为此,使用了穿孔卡片。几乎所有的计算机直到1980年代都配备了穿孔卡片阅读器,可以逐个读取穿孔卡片,并将卡片内容写入计算机内存。如果加载了一叠穿孔卡片,阅读器会将它们全部顺序加载到内存中。此外,穿孔卡片不仅用于将数据输入计算机,还用于将数据从计算机中输出。在程序结束时,结果可以被写入穿孔卡片。除了穿孔卡片,还有打孔纸带,这是一种连续的打孔方式。早期计算机编程通常是专家的领域,需要对底层硬件有深入的了解。随着时间的推移,人们需要一种更简单的编程方式,这引出了下一集将要讨论的编程语言。
Mindmap
Keywords
💡计算机程序
💡存储程序计算机
💡冯·诺依曼架构
💡打孔卡片
💡打孔纸带
💡面板编程
💡Altair 8800
💡汇编语言
💡电子管计算机
💡CPU
💡内存
Highlights
计算机程序是如何进入计算机内存的,这并非魔法,而是计算机科学的一部分。
在计算机发展之前,编程机器的需求就已经存在,最著名的例子是在纺织制造业。
Joseph Marie Jacquard在1801年开发了一种可编程的纺织机,被认为是编程最早的形式之一。
穿孔卡片是存储数据的一种廉价、可靠且相对易读的方式。
1890年的人口普查使用了穿孔卡片来帮助统计数据。
早期的制表机并不是真正的计算机,它们的操作是固定的,不能编程。
20世纪20年代,插线板变得可互换,使得编程更加舒适,并允许不同的程序插入机器。
ENIAC,世界上第一台通用电子计算机,使用了大量的插线板,即使在纸上完全设计出程序后,物理连接ENIAC并运行程序可能需要三周时间。
随着1940年代末到50年代电子存储器变得可行,程序可以完全存储在计算机的内存中。
存储程序计算机(stored-program computers)可以将程序容易地由程序员更改,并快速地被CPU访问。
冯·诺依曼架构将程序和数据统一到单个共享内存中,以冯·诺依曼命名,他是曼哈顿计划和几台早期电子计算机的杰出数学家和物理学家。
1948年,曼彻斯特大学建造了第一台冯·诺依曼架构的存储程序计算机,绰号为“Baby”。
穿孔卡片直到1980年代仍被广泛用于计算机,用于将数据加载到计算机内存中。
美国空军的SAGE防空系统是已知最大的穿孔卡片程序,使用了62,500张穿孔卡片,相当于大约5兆字节的数据。
穿孔纸带是穿孔卡片的近亲,其概念相同,但是连续的而不是单独的卡片。
50年代和60年代的计算机通常配有巨大的控制台,上面有大量的开关和按钮,以及指示灯显示内存中不同功能和值的状态。
Altair 8800是第一款商业上成功的家用计算机,业余计算机爱好者可以通过面板上的开关输入程序。
编程早期计算机是专家的领域,需要对底层硬件有深入的了解,这意味着编程是困难和繁琐的。
需要一种更简单的方式告诉计算机做什么,一种更简单的编程方式,这引出了下一期将讨论的编程语言。
Transcripts
Hi, I'm Carrie Anne and welcome to Crash Course Computer Science.
Over the last few episodes,
We've talked a lot about the mechanics of how computers work.
How they use complex circuits to save and retrieve values from memory,
and perform operations on those values,
like adding two numbers together.
We've even briefly talked about sequences of operations,
which is a computer program.
What we haven't talked about
is how a program gets into a computer.
You might remember in episode 7 and 8 ,
when we stepped through some simple example programs for the CPU that we had created.
For simplicity, we just waved our hands
and said that the program was already magically in memory.
But in reality, programs have to be loaded into a computer's memory.
It's not magic. It's computer science.
[Theme Music]
The need to programme machines existed way before the development of computers.
The most famous example of this was in textile manufacturing.
if you just wanted to weave a big red tablecloth,
you could simply feed red thread into a loom and let it run.
But what about if you wanted the cloth to have a pattern like stripes or plaid?
Workers would have to periodically reconfigure the loom as dictated by the pattern,
but this was labor intensive which made patterned fabrics expensive.
In response, Joseph Marie Jacquard developed a programmable textile loom,
which he first demonstrated in 1801.
The pattern for each row of the cloth was defined by a punched card.
The presence or absence of a hole in the card determined
if a specific threat was held high or low in the loom.
Such that the cross thread called the weft passed above or below the thread.
To vary the pattern across rows these punch cards were arranged in long chains,
forming a sequence of commands for the loom.
Sound familiar?
Many consider Jacquard's loom to be one of the earliest forms of programming.
Punched cards, turned out to be a cheap , reliable,
fairly human readable way to store data.
Nearly a century later,
punch cards were use to help tabulate the 1890 newest census
which we talked about in episode 1.
Each card held an individual person's data.
Things like race,
marital status,
number of children,
country of birth, and so on.
For each demographic question,
a census worker would punch out a hole of the appropriate position.
When a card was fed into the tabulating machine,
a hole would cause the running total for that specific answer to be increased by one.
In this way you could feed the
entire county's worth of people
and at the end you'd have running totals for all of the questions that you asked.
It is important to note here that early tabulating machines
were not truly computers as they can only do one thing-tabulate.
Their operation was fixed and not programmable.
Punished cards stored data, but not a program.
Over the next 60 years, these business machines grew in capability,
adding features to subtract, multiply, divide,
and even make simple decisions about when to perform certain operations.
To trigger these functions appropriately,
so that different calculations could be performed,
a programmer accessed a control panel.
This panel was full of little sockets, into which a programmer would plug cables
to pass values and signals between different parts of the machine.
For this reason they were also called plug boards.
Unfortunately, this meant having to rewire the machine each time a different program needed to be run.
And so by the 1920s, these plug boards were made swappable.
This not only made programming a lot more comfortable,
but also allowed for different programs to be plugged into a machine.
For example, one board might be wired to calculate sales tax, while another helps with payroll.
But plug boards were fiendishly complicated to program.
This tangle of wires is a program for calculating a profit loss summary,
using an IBM 402 accounting machine, which were popular in the 1940s.
And this style of plug board programming wasn't unique to electromechanical computers.
The world's first General-Purpose electronic computer,
the Eniac, completed in 1946, used a ton of them.
Even after a program had been completely figured out on paper,
physically wiring up the Eniac and getting the program to run could take upwards of three weeks.
Given the enormous cost of these early computers, weeks of downtime simply to switch programs
was unacceptable and the new, faster, more flexible way to programme machines was badly needed.
Fortunately by the late 1940s and into the 50s, electronic memory was becoming feasible.
As costs fell, memory size grew.
Instead of storing a program as a physical plug board of wires, it became possible to store a program entirely in a computer's memory.
Where it could be easily changed by programmers and quickly accessed by the CPU.
These computers were called stored-program computers.
With enough computer memory, you could store not only the program you wanted to run,
but also any data your program would need.
Including new values it created along the way,
Unifying the progrmming data into a single shared memory is called the von Neumann architecture.
Named after John von Neumann, a prominent mathematician and physicist,
who worked on the Manhattan project and several early electronic computers.
And once said, "I'm thinking about something much more important than bombs, I'm thinking about computers".
The hallmarks of a von Neumann computer are a processing unit containing an arithmetic logic unit,
data registers, an instruction register, and an instruction address register.
And finally, a memory to store both data and instructions.
Hopefully, this sounds familiar, because we actually built a von Neumann computer in episode 7.
The very first von Neumann architecture stored program computer
was constructed in 1948 by the University of Manchester, nicknamed "Baby".
And even the computer you are watching this video right now uses the same architecture.
Now electronic computer memory is great and all,
but you still have to load the programming data in to the computer before it can run.
And for this reason, punch cards were used.
Let's get to the Thought Bubble.
Well into the 1980s, almost all computers had a punch card reader.
Which could suck in a single punch card at a time and write the contents of the card into the computer's memory.
If you loaded in a stack of punch cards, the reader would load them all into memory sequentially, as a big block.
Once the programming data were in memory, the computer would be told to execute it.
Of course, even simple computer programs might have hundreds of
instructions, which meant that programs were stored as stacks of punch cards.
So if you ever have the misfortune of accidentally dropping your program on the floor,
it could take you hours, days, or even weeks to put the code back in the right order.
A common trick was to draw a diagonal line on the side of the card stack called striping,
so you'd have at least some clue how to get it back into the right order.
The largest program ever punched into punch cards was the US Air Force's sage air defense system, completed in
1955. At its peak, the product is said to have employed
20% of the world's programmers. Its main control program was stored on a whopping
62,500 punch cards, which is equivalent to roughly 5 megabytes of data.
Pretty underwhelming by today's standards.
And punch cards weren't only useful for getting data into computers, but also getting data out of them.
At the end of a program, results could be written out of computer memory and onto punch cards by, well, punching cards.
Then this data could be analyzed by humans or loaded into a second program for additional computation.
Thanks, Thought Bubble.
A close cousin to punch cards was punched paper tape,
which is basically the same idea, but continuously instead of being on individual cards.
And of course, we haven't talked about hard drives, CD-Roms, DVDs, USB thumb drives, and other similar goodies.
We'll get to those more advanced types of data storage in a future episode.
Finally, in addition to plug boards and punch paper,
there was another common way to program and control computers pre-1980: panel programming.
Rather than having to physically plug in cables to activate certain functions, this could also be done with huge panels full of switches
and buttons. And there were indicator lights to display the status of various functions and values in memory.
Computers of the 50s and 60s often featured huge control consoles that look like this.
Although it was rare to input a whole program using just switches, it was possible.
And early home computers made for the hobbyist market used switches extensively, because most home users couldn't afford expensive
peripherals like punch card readers. The first commercially successful home computer was the Altair 8800, which sold in two versions:
preassembled and as a kit. The kit, which was popular with amateur computing enthusiasts, sold for the then unprecedented low price of around
$400 in 1975 or about $2,000 in 2017.
To program 8800 you'd literally toggle the switches on the front panel to enter the binary Op codes for the instruction you wanted.
Then you press the deposit button to write that value into memory.
Then in the next location in memory, you toggle the switches again for your next instruction, deposit it and so on.
When you had finally entered your whole program into memory, you would toggle the switches, move back
to memory address zero, press the run button, and watch the little lights blink. That was home computing in 1975, wow.
Whether it was plug board switches or punched paper
Programming these early computers was the realm of experts. Either professionals who did this for a living, or technology enthusiasts.
You needed intimate knowledge of the underlying hardware,
So things like processor Op codes and register wits to write programs.
This meant programming was hard and tedious. And even professional engineers and scientists struggle to take full advantage of what computing could offer.
What was needed was a simpler way to tell computers what to do; a simpler way to write programs.
And that brings us to programming languages which we'll talk about next episode. See you next week.
Crash Course Computer Science is produced in association with PBS Digital Studios.
At their channel you can check out a playlist of shows like Braincraft,
Coma Niddy and PBS Infinite Series. This episode was filmed at the Chad and Stacey Emigholz studio in Indianapolis, Indiana
And it was made with the help of all these nice people and our wonderful graphics team is Thought Cafe.
Thanks for the Random Access Memories, I''ll see you next time.
Ver más vídeos relacionados
![](https://i.ytimg.com/vi/rL8X2mlNHPM/hq720.jpg)
Intro to Algorithms: Crash Course Computer Science #13
![](https://i.ytimg.com/vi/FZGugFqdr60/hq720.jpg)
The Central Processing Unit (CPU): Crash Course Computer Science #7
![](https://i.ytimg.com/vi/4RPtJ9UyHS0/hq720.jpg)
Keyboards & Command Line Interfaces: Crash Course Computer Science #22
![](https://i.ytimg.com/vi/RU1u-js7db8/hq720.jpg)
The First Programming Languages: Crash Course Computer Science #11
![](https://i.ytimg.com/vi/7Jr0SFMQ4Rs/hq720.jpg)
Screens & 2D Graphics: Crash Course Computer Science #23
![](https://i.ytimg.com/vi/26QPDBe-NB8/hq720.jpg)
Operating Systems: Crash Course Computer Science #18
5.0 / 5 (0 votes)