《深入理解计算机系统》的原文摘录

  • 那些表示的数并不是均匀分布的--越靠近原点处他们越稠密 (查看原文)
    孔明 2013-03-20 17:37:05
    —— 引自第72页
  • OF: (a < 0 == b < 0) && (t < 0 != a<0) (查看原文)
    孔明 2013-06-09 10:35:29
    —— 引自第124页
  • Two’s complement versus Ones’ complement. The term “two’s complement” arises from the fact that for nonnegative x we compute a w-bit representation of −x as 2^w-x (a single two). The term “ones’ complement” comes from the property that we can compute −x in this notation as [111 . . . 1] − x (multiple ones). (查看原文)
    Ryutlis 2013-06-19 22:30:02
    —— 引自第63页
  • Unsigned arithmetic can be viewed as a form of modular arithmetic. Unsigned addition is equivalent to computing the sum modulo 2w. This value can be computed by simply discarding the high-order bit in the w+1-bit representation of x + y. (查看原文)
    Ryutlis 2013-06-20 20:53:24
    —— 引自第80页
  • 现代微处理器取得的了不起的功绩之一是:它们采用复杂而奇异的微处理器结构,其中,多条指令可以并行地执行,同时又呈现一种简单地顺序执行指令的表象。 (查看原文)
    孔明 2013-06-21 20:39:37
    —— 引自第340页
  • Given that integer multiplication is much more costly than shifting and adding, many C compilers try to remove many cases where an integer is being multiplied by a constant with combinations of shifting, adding, and subtracting. (查看原文)
    Ryutlis 2013-06-22 12:08:38
    —— 引自第93页
  • Each DRAM chip is connected to some circuitry, known as the memory controller, that can transfer w bits at a time to and from each DRAM chip. To read the contents of supercell (i, j ), the memory controller sends the row address i to the DRAM, followed by the column address j . The DRAM responds by sending the contents of supercell (i, j ) back to the controller. The row address i is called a RAS (Row Access Strobe) request. The column address j is called a CAS (Column Access Strobe) request. Notice that the RAS and CAS requests share the same DRAM address pins. One reason circuit designers organize DRAMs as two-dimensional arrays instead of linear arrays is to reduce the number of address pins on the chip. For example, if our example 128-bit DRAM were organized as a linear array of 16 ... (查看原文)
    Ryutlis 2013-06-23 12:13:08
    —— 引自第563页
  • In a program with good temporal locality, a memory location that is referenced once is likely to be referenced again multiple times in the near future. In a program with good spatial locality, if a memory location is referenced once, then the program is likely to reference a nearby memory location in the near future (查看原文)
    Ryutlis 2013-06-23 19:58:48
    —— 引自第587页
  • . Programs that repeatedly reference the same variables enjoy good temporal locality. . For programs with stride-k reference patterns, the smaller the stride the better the spatial locality. Programs with stride-1 reference patterns have good spatial locality. Programs that hop around memory with large strides have poor spatial locality. . Loops have good temporal and spatial locality with respect to instruction fetches. The smaller the loop body and the greater the number of loop iterations, the better the locality. (查看原文)
    Ryutlis 2013-06-23 20:31:35
    —— 引自第589页
  • 源程序实际上就是一个由0和1组成的位序列,8个位被组织成一组,称为字节。每个字节表示程序中某个文本字符。 (查看原文)
    hao 2013-06-26 09:59:11
    —— 引自第18页
  • 部分现代系统都使用ASCII标准来表示文本字符,这种方式实际上就是用一个惟一的单个字节大小的整数值来表示每个字符。 系统中所有信息---包括磁盘文件,存储器中的程序,存储器中存放的用户数据以及网络上传送的数据,都是一串味表示的。区分不同对象的唯一方法是我们读到这些数据对象时的上下文。 (查看原文)
    hao 2013-06-26 09:59:11
    —— 引自第18页
  • 1.预处理阶段-------预处理器根据字符#开头的命令修改原始的C程序。(.c文件变成.i文件) 2.编译阶段-----------将文本文件.i翻译成.s,它包含一个汇编语言程序。 3.汇编阶段----------汇编器将.s文件翻译成机器指令,把这些指令打包成一种叫做可重定位目标程序的格式,并将结果保存在目标文件.o中。.o文件时二进制文件,它的字节编码是机器语言指令而不是字符 4.链接阶段-----------比如我们的.c源程序有printf,它是标准库里面的,printf函数的实现存在于一个名为printf.o的单独预编译好了的目标文件中,而这个文件必须以某种方式合并到我们的.o文件中。链接器负责处理这种合并过程。结果就是可执行目标文件,可以被加载到内存中,由系统执行。 (查看原文)
    hao 2013-06-26 09:59:11
    —— 引自第18页
  • 指令集结构描述的是每条机器代码指令的效果;而微体系结构描述的是处理器实际上如何实现的。 (查看原文)
    hao 2013-06-26 09:59:11
    —— 引自第18页
  • 大多数计算机使用8位的块,或者字节,作为最小的可寻址的存储器单元,而不是在存储器中单独的位。机器级程序将存储器视为一个巨大的字节数组,称为虚拟存储器。存储器上的每个字节都是由一个唯一的数字标识,称为它的地址,所有可能地址的集合称为虚拟地址空间。 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页
  • 一个字节由8位组陈,在二进制法中,值域是00000000~11111111;在十进制中,值域是0~255;因为二进制在十进制中转换比较麻烦,代替方法就是用十六进制表示,值域是00~FF。在C语言中以0x开头的数字常量被认为是16进制的值。 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页
  • 每台计算机都有字长,指明整数和指针数据的标称大小。所以字长决定最重要的系统参数时虚拟地址空间的最大大小。对于一个字长为w位的机器而言,虚拟地址的范围为0~2^w - 1,程序最多访问2^w个字节。 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页
  • 可移植性的一个方面是使程序对不同数据类型的确切大小不敏感。 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页
  • 在几乎所有的机器上,多字节对象被存储为连续的字节序列,对象的地址为所使用字节中最小的地址。 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页
  • 小端机-------最低有效字节在前面(高高低低)。大端机--------最高有效字节在前面(高低高低) 对于大多数机器所使用的字节顺序完全不可见,无论哪种类型的机器编译都会得到同样的结果。会出现问题一般在1.网络传输时候,2.阅读反汇编,3.强制类型转换 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页
  • 位级运算的一个常见用法就是实现掩码运算,这里的掩码是一个位模式,表示从一个字中选出的位的集合。 (查看原文)
    hao 2013-06-26 10:32:08
    —— 引自第38页