Hello world, I’m Carrie Anne, and welcome to Crash Course Computer Science!
Hello world!我是 Carrie Anne,欢迎收看计算机科学速成课!
Over the course of this series, we’re going to go from bits, bytes, transistors and logic gates,all the way to Operating Systems, Virtual Reality and Robots!
在这个系列中,我们会学习 Bits(位),Bytes(字节),晶体管, 逻辑门,一直到操作系统,虚拟现实和机器人!
We’re going to cover a lot, but just to clear things up, we ARE NOT going to teach you how to program.Instead, we’re going to explore a range of computing topics as a discipline and a technology.
我们要学很多东西,但预先说明,我们 不会 教你怎么编程,我们会从高层次上纵览一系列计算机话题。
Computers are the lifeblood of today’s world. If they were to suddenly turn off, all at once,the power grid would shut down, cars would crash, planes would fall, water treatment plants would stop, stock markets would freeze, trucks with food wouldn’t know where to deliver, and employees wouldn’t get paid.
计算机是当今世界的命脉。如果突然关掉所有的计算机,电网会关闭,车辆会相撞,飞机会坠毁,净水厂会关闭,证券市场会停止运作,装满食物的卡车不知运往何方,员工得不到薪水。
Even many non-computer objects like DFTBA shirts and the chair I’m sitting on-are made in factories run by computers.
甚至很多和计算机无关的东西,例如 DFTBA 的 T 恤和我现在坐的椅子也都是在计算机管理的工厂中制造的。
Computing really has transformed nearly every aspect of our lives. And this isn’t the first time we’ve seen this sort of technology-driven global change.
计算机改变了我们生活中几乎所有方面,我们也不是第一次遇到推动全球发展的科技了。
Advances in manufacturing during the Industrial Revolution brought a new scale to human civilization - in agriculture, industry and domestic life.
工业革命中生产能力的提高,大幅提升了农业,工业,畜牧业的规模。
Mechanization meant superior harvests and more food, mass produced goods,cheaper and faster travel and communication, and usually a better quality of life.
机械化导致更好的收成,更多的食物,商品可以大批量生产,旅行和通讯变得更便宜更快,生活质量变得更好。
And computing technology is doing the same right now。from automated farming and medical equipment,to global telecommunications and educational opportunities,and new frontiers like Virtual Reality and Self Driving Cars.
计算机和工业革命有一样的影响。从自动化农业和医疗设备,到全球通信和教育机会,还有 虚拟现实 和 无人驾驶汽车 等新领域。
We are living in a time likely to be remembered as the Electronic Age.And with billions of transistors in just your smartphones, computers can seem pretty complicated,but really, they’re just simple machines。that perform complex actions through many layers of abstraction.
现在这个时代很可能会被后人总结成 “信息时代”。你的智能手机中有数十亿个晶体管,看起来好像很复杂,但实际上它是很简单的机器。通过一层层的抽象 来做出复杂操作。
So in this series, we’re going break down those layers,and build up from simple 1’s and 0’s, to logic units, CPUs,operating systems, the entire internet and beyond.
在这个系列中,我们会一层层讲解,从最底层的1和0,到逻辑门,CPU,操作系统,整个互联网,以及更多~~
And don’t worry, in the same way someone buying t-shirts on a webpage,doesn’t need to know how that webpage was programmed,or the web designer doesn’t need to know how all the packets are routed,or router engineers don’t need to know about transistor logic。
不用担心,正如在网上买T恤的人 不用知道网站代码是怎么写的,设计师不用知道数据包是怎么传输的,设计路由器的工程师不用理解晶体管的逻辑。
this series will build on previous episodes but not be dependent on them.By the end of this series, I hope that you can better contextualize computing’s role both in your own life and society,and how humanity’s (arguably) greatest invention is just in its infancy,with its biggest impacts yet to come.
本系列中每个视频会接着上集继续讲,但并不依赖前面的视频。等这个系列结束后,希望你能了解计算机在你的人生 以及社会中扮演什么角色,以及这个人类史上最伟大的发明(可以这样说啦)是怎么开始的,它对未来还会有更大的影响。
But before we get into all that, we should start at computing’s origins,because although electronic computers are relatively new, the need for computation is not.
但深入之前,我们应该从计算的起源讲起,虽然电子计算机才出现不久,但人类对计算的需求早就有了。
The earliest recognized device for computing was the abacus, invented in Mesopotamia around 2500 BCE.It’s essentially a hand operated calculator,that helps add and subtract many numbers. It also stores the current state of the computation, much like your hard drive does today.
公认最早的计算设备是 算盘发明于”美索不达米亚”,大约公元前 2500 年。它是手动计算器,用来帮助加减数字。它存储着当前的计算状态,类似于如今的硬盘。
The abacus was created because,the scale of society had become greater than what a single person could keep and manipulate in their mind. There might be thousands of people in a village or tens of thousands of cattle.
人们制造算盘是因为社会的规模已经超出个人心算的能力,一个村庄可能有上千个人和上万头牛。
There are many variants of the abacus, but let’s look at a really basic version with each row representing a different power of ten.So each bead on the bottom row represents a single unit, in the next row they represent 10, the row above 100, and so on.
算盘有很多变种,但我们来看一个基础版,每行代表 10 的不同次方,最底下那行,一个珠子代表 10 的 0 次方,也就是 1。再上面一行是 10 的 1 次方(也就是 10) 再上面一行是 10 的 2 次方 (以此类推)。
Let’s say we have 3 heads of cattle represented by 3 beads on the bottom row on the right side. If we were to buy 4 more cattle we would just slide 4 more beads to the right for a total of 7. But if we were to add 5 more after the first 3 we would run out of beads,so we would slide everything back to the left,slide one bead on the second row to the right, representing ten,and then add the final 2 beads on the bottom row for a total of 12.
假设最底部的 3 颗珠子,代表 3 头牛。假设再买 4 头牛,只需要向右移动 4 颗珠子,共 7 个珠子。但如果再买 5 头,珠子就不够用了。所以把所有珠子移回左边,在第二排把 1 颗珠子向右移动,代表 10,然后最底下那行,向右移动 2 颗珠子,代表 12。
This is particularly useful with large numbers. So if we were to add 1,251。we would just add 1 to the bottom row, 5 to the second row, 2 to the third row, and 1 to the fourth row. we don’t have to add in our head and the abacus stores the total for us.
这种方法处理大数字很有效,假设要表示 1251。从下往上:第一行移 1 个,第二行移 5 个,第三行移 2 个,第四行移 1 个。我们不用记在脑子里,算盘会记住。
Over the next 4000 years, humans developed all sorts of clever computing devices, like the astrolabe, which enabled ships to calculate their latitude at sea. Or the slide rule, for assisting with multiplication and division.
在接下来 4000 年,人类发明了各种巧妙的计算设备。比如星盘,让船只可以在海上计算纬度,或计算尺,帮助计算乘法和除法。
And there are literally hundred of types of clocks created that could be used to calculate sunrise, tides, positions of celestial bodies, and even just the time.
人们还创造了上百种时钟用来算日出,潮汐,天体的位置,或纯粹拿来计时。
Each one of these devices made something that was previously laborious to calculate much faster, easier, and often more accurate.it lowered the barrier to entry, and at the same time, amplified our mental abilities -take note, this is a theme we’re going to touch on a lot in this series.
这些设备让原先很费力的事变得更快,更简单,更精确。他们降低了门槛,加强了我们的能力。记笔记!(敲黑板)这个系列会多次提到这一点。
As early computer pioneer Charles Babbage said:”At each increase of knowledge, as well as on the contrivance of every new tool, human labour becomes abridged.”
计算机先驱 Charles Babbage 说过:”随着知识的增长和新工具的诞生,人工劳力会越来越少”
However, none of these devices were called “computers”. The earliest documented use of the word “computer” is from 1613, in a book by Richard Braithwait. And it wasn’t a machine at all - it was a job title.
然而,这些设备那时都不叫 “计算机”。最早使用 “计算机” 一词的文献 来自 1613 年的一本书,作者 Richard Braithwait。然而指的不是机器,而是一种职业。
Braithwait said,”I have read the truest computer of times,and the best arithmetician that ever breathed, and he reduceth thy dayes into a short number”.
Braithwait 说:”我听说过的计算者里最厉害的,能把好几天的工作量大大缩减”
In those days, computer was a person who did calculations, sometimes with the help of machines, but often not. This job title persisted until the late 1800s, when the meaning of computer started shifting to refer to devices.
那时, “Computer” 指负责计算的人。”Computer” 偶尔会用机器帮忙,但大部分时候靠自己。这个职位一直到 1800 年代还存在,之后 “Computer” 逐渐开始代表机器。
Notable among these devices was the Step Reckoner, built by German polymath Gottfried Leibniz in 1694. Leibniz said: “… it is beneath the dignity of excellent men to waste their time in calculation. when any peasant could do the work just as accurately with the aid of a machine.”
其中”步进计算器”最有名,由德国博学家 戈特弗里德·莱布尼茨 建造于 1694 年。莱布尼茨说过 “… 让优秀的人浪费时间算数简直侮辱尊严,农民用机器能算得一样准”
It worked kind of like the odometer in your car, which is really just a machine for adding up the number of miles your car has driven. The device had a series of gears that turned; each gear had ten teeth, to represent the digits from 0 to 9.
“步进计算器”有点像汽车里的里程表,不断累加里程数。它有一连串可以转动的齿轮,每个齿轮有十个齿,代表数字0到9。
Whenever a gear bypassed nine, it rotated back to 0 and advanced the adjacent gear by one tooth. Kind of like when hitting 10 on that basic abacus.
每当一个齿轮转过 9,它会转回 0,同时让旁边的齿轮前进 1 个齿,就像算盘超过 10 一样。
This worked in reverse when doing subtraction, too. With some clever mechanical tricks, the Step Reckoner was also able to multiply and divide numbers.
做减法时,机器会反向运作.利用一些巧妙的机械结构,步进计算器也能做乘法和除法。
Multiplications and divisions are really just many additions and subtractions. For example, if we want to divide 17 by 5, we just subtract 5, then 5, then 5 again, and then we can’t subtract any more 5’s… so we know 5 goes into 17 three times, with 2 left over.
乘法和除法 实际上只是多个加法和减法。举例,17除以5,我们只要减5,减5,再减5,直到不能再减 5,就知道了 17=5x3+2。
The Step Reckoner was able to do this in an automated way, and was the first machine that could do all four of these operations. And this design was so successful it was used for the next three centuries of calculator design.
步进计算器 可以自动完成这种操作,它是第一台能做”加减乘除”全部四种运算的机器,它的设计非常成功,以至于沿用了 3 个世纪。
Unfortunately, even with mechanical calculators, most real world problems required many steps of computation before an answer was determined. It could take hours or days to generate a single result.
不幸的是,即使有机械计算器,许多现实问题 依然需要很多步,算一个结果可能要几小时甚至几天。
Also, these hand-crafted machines were expensive, and not accessible to most of the population. So, before 20th century, most people experienced computing through pre-computed tables assembled by those amazing “human computers” we talked about.
而且这些手工制作的机器非常昂贵,大部分人买不起。所以在 20 世纪以前,大部分人会用预先算好的计算表,这些计算表由之前说的 “人力计算器” 编撰。
So if you needed to know the square root of 8 million 6 hundred and 75 thousand 3 hundred and 9, instead of spending all day hand-cranking your step reckoner, you could look it up in a huge book full of square root tables in a minute or so.
如果你想知道 867,5309 的平方根,与其花一整天来手摇 “步进计算器”,你可以花一分钟在表里找答案
Speed and accuracy is particularly important on the battlefield, and so militaries were among the first to apply computing to complex problems. A particularly difficult problem is accurately firing artillery shells,
速度和准确性在战场上尤为重要,因此军队很早就开始用计算解决复杂问题。如何精确瞄准炮弹是一个很难的问题!
which by the 1800s could travel well over a kilometer (or a bit more than half a mile). Add to this varying wind conditions, temperature, and atmospheric pressure, and even hitting something as large as a ship was difficult.
19世纪,这些炮弹的射程可以达到 1 公里以上(比半英里多一点),因为风力,温度,大气压力会不断变化,想打中船一样大的物体也非常困难。
Range Tables were created that allowed gunners to look up environmental conditions and the distance they wanted to fire, and the table would tell them the angle to set the canon. These Range Tables worked so well, they were used well into World War Two.
于是出现了射程表,炮手可以查环境条件和射击距离。然后这张表会告诉他们,角度要设成多少,这些射程表很管用,二战中被广泛应用。
The problem was, if you changed the design of the cannon or of the shell, a whole new table had to be computed, which was massively time consuming and inevitably led to errors.
问题是如果改了大炮或炮弹的设计,就要算一张新表。这样很耗时而且会出错。
Charles Babbage acknowledged this problem in 1822 in a paper to the Royal Astronomical Society entitled: “Note on the application of machinery to the computation of astronomical and mathematical tables”.
Charles Babbage 在 1822 年写了一篇论文,向皇家天文学会指出了这个问题。标题叫: “机械在天文与计算表中的应用”。
Let’s go to the thought bubble.
让我们进入思想泡泡
Charles Babbage proposed a new mechanical device called the Difference Engine, a much more complex machine that could approximate polynomials.
a much more complex machine that could approximate polynomials.
Charles Babbage 提出了一种新型机械装置叫 “差分机”。一个更复杂的机器,能近似多项式.
Polynomials describe the relationship between several variables like range and air pressure, or amount of pizza Carrie Anne eats and happiness. Polynomials could also be used to approximate logarithmic and trigonometric functions, which are a real hassle to calculate by hand.
多项式描述了几个变量之间的关系,比如射程和大气压力,或者 Carrie Anne 要吃多少披萨才开心。多项式也可以用于近似对数和三角函数,这些函数手算相当麻烦。
Babbage started construction in 1823, and over the next two decades, tried to fabricate and assemble the 25,000 components, collectively weighing around 15 tons. Unfortunately, the project was ultimately abandoned.
Charles Babbage 在 1823 年开始建造差分机,并在接下来二十年,试图制造和组装 25,000 个零件,总重接近 15 吨,不幸的是,该项目最终放弃了。
But, in 1991, historians finished constructing a Difference Engine based on Babbage’s drawings and writing, and it worked!
但在 1991 年,历史学家根据 Charles Babbage 的草稿做了一个差分机,而且它还管用!
But more importantly, during construction of the Difference Engine, Babbage imagined an even more complex machine - the Analytical Engine. Unlike the Difference Engine, Step Reckoner and all other computational devices before it.
但更重要的是,在差分机的建造期间,Charles Babbage 构想了一个更复杂的机器 - 分析机。不像差分机,步进计算器 和以前的其他计算设备
the Analytical Engine was a “general purpose computer”. It could be used for many things, not just one particular computation; it could be given data and run operations in sequence; it had memory and even a primitive printer. Like the Difference Engine, it was ahead of its time, and was never fully constructed.
分析机是 “通用计算机”,它可以做很多事情,不只是一种特定运算。甚至可以给它数据,然后按顺序执行一系列操作。它有内存 甚至一个很原始的打印机,就像差分机,这台机器太超前了,所以没有建成。
However, the idea of an “automatic computer”, one that could guide itself through a series of operations automatically, was a huge deal, and would foreshadow computer programs.
然而,这种 “自动计算机” 的概念-计算机可以自动完成一系列操作,是个跨时代的概念,预示着计算机程序的诞生。
English mathematician Ada Lovelace wrote hypothetical programs for the Analytical Engine, saying, “A new, a vast, and a powerful language is developed for the future use of analysis.” For her work, Ada is often considered the world’s first programmer.
英国数学家 Ada Lovelace 给分析机写了假想的程序,她说:”未来会诞生一门全新的,强大的,专为分析所用的语言”。因此 Ada 被认为是世上第一位程序员。
The Analytical Engine would inspire, arguably, the first generation of computer scientists, who incorporated many of Babbage’s ideas in their machines. This is why Babbage is often considered the “father of computing”.
分析机激励了(可以这么讲)第一代计算机科学家。这些计算机科学家 \N 把很多 Charles Babbage 的点子融入到他们的机器,所以 Charles Babbage 经常被认为是 “计算之父”
Thanks! Thought Bubble
谢啦!思想泡泡
So by the end of the 19th century, computing devices were used for special purpose tasks in the sciences and engineering, but rarely seen in business, government or domestic life.
到了 19 世纪末,科学和工程领域中的特定任务 会用上计算设备,但公司,政府,家庭中很少见到计算设备。
However, the US government faced a serious problem for its 1890 census that demanded the kind of efficiency that only computers could provide.
然而,美国政府在 1890 年的人口普查中面临着严重的问题,只有计算机能提供所需的效率。
The US Constitution requires that a census be conducted every ten years, for the purposes of distributing federal funds, representation in congress, and good stuff like that. And by 1880s, the US population was booming, mostly due to immigration. That census took seven years to manually compile and by the time it was completed, it was already out of date. and it was predicted that the 1890 census would take 13 years to compute. That’s a little problematic when it’s required every decade!
美国宪法要求 10 年进行一次人口普查,目的是分配联邦资金,国会代表,等等。到 1880 年代,美国人口迅速增长,大部分因为移民。人口普查要七年时间来手工编制,等做完都过时了.而且 1890 年的人口普查,预计要 13 年完成! 但人口普查可是 10 年一次啊!
The Census bureau turned to Herman Hollerith, who had built a tabulating machine. His machine was “electro-mechanical”. it used traditional mechanical systems for keeping count, like Leibniz’s Step Reckoner - but coupled them with electrically-powered components.
人口普查局找了 Herman Hollerith,他发明了打孔卡片制表机。他的机器是 “电动机械的”,用传统机械来计数。结构类似莱布尼茨的乘法器,但用电动结构连接其他组件。
Hollerith’s machine used punch cards which were paper cards with a grid of locations that can be punched out to represent data. For example, there was a series of holes for marital status. If you were married, you would punch out the married spot,
Hollerith 的机器用打孔卡,一种纸卡,上面有网格,用打孔来表示数据。举个例子,有一连串孔代表婚姻状况,如果你结婚了,就在 “结婚” 的位置打孔。
then when the card was inserted into Hollerith’s machine, little metal pins would come down over the card. if a spot was punched out, the pin would pass through the hole in the paper and into a little vial of mercury, which completed the circuit. This now completed circuit powered an electric motor, which turned a gear to add one, in this case, to the “married” total.
当卡插入 Hollerith 的机器时,小金属针会到卡片上。如果有个地方打孔了,针会穿过孔,泡入一小瓶汞,联通电路。电路会驱动电机,然后给 “已婚” 的齿轮 + 1。
Hollerith’s machine was roughly 10x faster than manual tabulations, and the Census was completed in just two and a half years. saving the census office millions of dollars.
Hollerith 的机器速度是手动的 10 倍左右,使人口普查在短短两年半内完成,给人口普查办公室省了上百万美元。
Businesses began recognizing the value of computing, and saw its potential to boost profits by improving labor- and data-intensive tasks, like accounting, insurance appraisals, and inventory management.
企业开始意识到计算机的价值,可以提升劳动力以及数据密集型任务来提升利润,比如会计,保险评估和库存管理等行业。
To meet this demand, Hollerith founded The Tabulating Machine Company, which later merged with other machine makers in 1924 to become The International Business Machines Corporation or IBM。which you’ve probably heard of.
为了满足这一需求,Hollerith 成立了制表机器公司。这家公司后来在 1924 年与其它机械制造商合并成为了 “国际商业机器公司”,简称 IBM。你可能听过 IBM。
These electro-mechanical “business machines” were a huge success, transforming commerce and government, and by the mid-1900s, the explosion in world population and the rise of globalized trade demanded even faster and more flexible tools for processing data,setting the stage for digital computers,
这些电子机械的 “商业机器” 取得了巨大成功,改变了商业和政府. 到了 1900 年代中叶,世界人口的爆炸和全球贸易的兴起,要求更快,更灵活的工具来处理数据,为电子计算机的发展奠定了基础。