您的位置:首页 > 理论基础

笔记1_算法,程序设计,语言等_哈佛_计算机科学cs50_David J. Malan

2015-08-31 16:43 513 查看

1.从0开始计数,而不是1的原因

数字系统被简化为只有0与1的基本思想,无论0还是1都占据一个位数,都有和它相关的权数。自然,我们就从0开始计数。否则就浪费了一个比特位。

比特(BIT)是binary digit的简写,从0到1的数字,而bi表示2.所以就有两个数字,因此bit诞生了。

ASCII码,可以表示键盘上的字符。

8个bit是一个byte,可以表达256个可能的字符,可以包含整个美式键盘中的字符,包括大小写字母和一连串标点。对于其他语言,当涉及更多字符时就会有其他的编码体系。

当敲击键盘上的字母A时,在计算机二进制存储中为01000001,就表明键入了A。

RAM暂时存放正在使用的程序和文件,而且会加快电脑速度;硬盘是程序和文件永久存储的地方

2.计算机采用二进制的原因

主要是因为当我们用一台实体机运行计算机时,二进制很容易用开或者关的概念来表示。

计算机的硬盘只是一个大的铁容器,它由若干磁盘组成,这些金属电路板和它们的上面都是看不到的很小的磁性粒子,如果触碰他们或打开硬盘戳弄它,你就破坏了它,因为改变了他们的排列顺序,就损坏了数据。一个磁性粒子很容易代表0或1,只要一个有南北极磁性物体。电脑硬盘完全是有一簇按照这种方式排列的磁性粒子。

The hard drive is where your PC stores most of its permanent data.To do that the data travels from ARM along with software signals that tell the hard drive how to store that data.The hard drive dircuits translate those signals to voltage fluctuatios. These
in turn control the hard drive's moving parts.Some of the few moving parts left in the modern computer.Some of the few moving parts left in the modern computer.Some of the signals control a motor which spins metal-coded platters. Your data is actually stored
on these platters. Other signals move the read/write heads to read or write data on the platters.This machinery is so precise that a human hair coudn't even pass between the heads and spinning platters, yet it all works in terrfic speeds.

3.如何把电磁信号转换为0和1

When a brief pulse of electricity is sent to the read/write head it flipson a tiny electromagnet for a fraction of a second. The magnet creates a field which changes the polarity of a tiny, tiny portion of the metal particles which coat each platter's surface.A
patterned series of these tiny charged berries on the disk represents a single bit of data in the binary number system used by computers.Now , if the current is sent one way through the read/write head, the area is polarized in one direction. If the current
is sent in the opposite direction, the polarization is reversed.

How do you get data off the hard disk?Just reverse the process. So as the particles on the disk that get the current in the read/write head moving put together millions of these magnetized segments and you've got a file.Now, the pieces of a single file may
be scanning all the hard drive's platters, patterns——the mess of papers on your desk. So the special active file keeps track of whatever you missed.

4.当格式化一个软盘或硬盘时会发生什么?

事实上,没有什么改变。格式化或者分区通常只是修改了几个或几千字节有价值的信息。最终的结果是电脑不知道文件或者文件夹在哪里存着,但是组成这些文件的字节还在原来的地方存储着

5.关于碎片整理

硬盘驱动器有时需要这么做,因为当开始对硬盘驱动器进行读写时,保存一个文件到磁盘的某处,现代操作系统允许文件进行分块处理,最后文件变成分片的,操作系统根据文件的地址,能找到文件的地址,这也导致了潜在速度变慢。在硬件性能如此好的今天,碎片处理显得并不是那么的重要。

6.读取磁盘里的数据

硬盘驱动器里面有一个电路板,因此它本身知道如何该上下左右移动,安装到电脑上的驱动软件,操作系统通过驱动软件电脑才能知道如何与这个硬件进行通信。正是因为这个驱动软件,操作系统才能根据数据在磁盘中的存储情况,通过发送上下左右移动的指令读取磁盘里的数据

7.固态硬盘(SSD)的优点和工作原理

固态硬盘是发展方向,固态硬盘就像紧凑型闪存或SD卡。几年来我们可以在相机的存储设备里存入千兆字节,甚至不久以后可以存入兆兆字节。设备里没有移动部件,一般的说,这些设备存取速度更快,因为他们没有移动部件。即使一个硬盘驱动器的转速达到每分钟7200次,甚至更快,仍然比光速慢。因此,当你拥有一个设备,无论它是否是纯电子的,数据位并不能以现实中的光速传输,这对一个设备来说太快了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: