YP.1.1 What We Will Try to Do and 1.2 How We Will Get There(双语)

from:

[1] Introduction to Computing System, from Bits and Gates to C and Beyond. Yale N. Patt and Sanjay J. Patel. McGraw-Hill Higher Education.(英)

[2] 计算系统基础_陈道蓄_第一章引言http://resource.jingpinke.com/details?uuid=ff808081-22c93527-0122-c936e141-1a96&objectId=oid:ff808081-22c93527-0122-c936e141-1a97 (中)

1.1 What We Will Try to Do

Welcome to From Bits and Gates to C and Beyond. Our intent is to introduce you over the next 632 pages to come, to the world of computing. As we do so, we have one objective above all others: to show you very clearly that there is no magic to computing. The computer is a deterministic system—every time we hit it over the head in the same way and in the same place (provided, of course, it was in the same starting condition), we get the same response. The computer is not an electronic genius; on the contrary, if anything, it is an electronic idiot, doing exactly what we tell it to do. It has no mind of its own.

What appears to be a very complex organism is really just a huge, systematically interconnected collection of very simple parts. Our job throughout this book is to introduce you to those very simple parts, and, step-by-step, build the interconnected structure that you know by the name computer. Like a house, we will start at the bottom, construct the foundation first, and then go on to add layers and layers, as we get closer and closer to what most people know as a full-blown computer. Each time we add a layer, we will explain what we are doing, tying the new ideas to the underlying fabric. Our goal is that when we are done, you will be able to write programs in a computer language such as C, using the sophisticated features of that language, and understand what is going on underneath, inside the Computer.

1.2 How We Will Get There

We will start (in Chapter 2) by noting that the computer is a piece of electronic equipment and, as such, consists of electronic parts interconnected by wires. Every wire in the computer, at every moment in time, is either at a high voltage or a low voltage. We do not differentiate exactly how high. For example, we do not distinguish voltages of 115 volts from voltages of 118 volts. We only care whether there is or is not a large voltage relative to 0 volts. That absence or presence of a large voltage relative to 0 volts is represented as 0 or 1.

We will encode all information as sequences of 0s and 1s. For example, one encoding of the letter a that is commonly used is the sequence 01100001. One encoding of the decimal number 35 is the sequence 00100011. We will see how to perform operations on such encoded information.

Once we are comfortable with information represented as codes made up of 0s and 1s and operations (addition, for example) being performed on these representations, we will begin the process of showing how a computer works.

In Chapter 3, we will see how the transistors that make up today's microprocessors work. We will further see how those transistors are combined into larger structures that perform operations, such as addition, and into structures that allow us to save information for later use. In Chapter 4, we will combine these larger structures into the Von Neumann machine, a basic model that describes how a computer works. In Chapter 5, we will begin to study a simple computer, the LC-3. LC-3 stands for Little Computer 3; we started with LC-1 but needed two more shots at it before we got it right! The LC-3 has all the important characteristics of the microprocessors that you may have already heard of, for example, the Intel 8088, which was used in the first IBM PCs back in 1981. Or the Motorola 68000, which was used in the Macintosh, vintage 1984. Or the Pentium IV, one of the high-performance microprocessors of choice in the PC of the year 2003. That is, the LC-3 has all the important characteristics of these "real" microprocessors, without being so complicated that it gets in the way of your understanding.

Once we understand how the LC-3 works, the next step is to program it, first in its own language (Chapter 6), then in a language called assembly language that is a little bit easier for humans to work with (Chapter 7). Chapter 8 deals with the problem of getting information into (input) and out of (output) the LC-3. Chapter 9 covers two sophisticated LC-3 mechanisms, TRAPs and subroutines.

We conclude our introduction to programming the LC-3 in Chapter 10 by first introducing two important concepts (stacks and data conversion), and then by showing a sophisticated example: an LC-3 program that carries out the work of a handheld calculator.

In the second half of the book (Chapters 11-19), we turn our attention to a high-level programming language, C. We include many aspects of C that are usually not dealt with in an introductory textbook. In almost all cases, we try to tie high-level C constructs to the underlying LC-3, so that you will understand what you demand of the computer when you use a particular construct in a C program. 

Our treatment of C starts with basic topics such as variables and operators (Chapter 12), control structures (Chapter 13), and functions (Chapter 14). We move on to the more advanced topics of debugging C programs (Chapter 15), recursion (Chapter 16), and pointers and arrays (Chapter 17).

We conclude our introduction to C by examining two very common high-level constructs, input/output in C (Chapter 18) and the linked list (Chapter 19).

1.1  本书的目标

欢迎阅读《计算系统基础》,我们的目标是通过本书向读者介绍计算世界,向读者揭示毫无神秘可言的计算系统。计算机是一个确定性的系统——只要我们在同一个地方以同一种方式操作它(假设在同一起始条件下),它总会得到同一个结果。计算机并不是一个电子天才,相反的,它只是一个电子白痴,精确地做着我们让它做的事,并没有自己的大脑。

虽然计算机看上去是一个复杂的机器,但它却是一个系统的、相互有关联的简单的组件的集合。我们贯穿全书的目的就是向你介绍这些简单的组件,然后逐步建立起相互关联的计算系统。就如同建造一所房屋,我们首先从地基开始,然后逐层添加,最后达成目标。每添加一层,我们都将解释所做的工作——在下一层的结构上添加新的思想。最后,当我们做完这些时,就可以使用像C语言那样的计算机语言编写程序,同时理解计算机内部正在进行的工作。

1.2 本书的结构

    在第二章中,我们将了解到计算机就是一个电子设备,它是由许多通过线路连接起来的电子元件所组成。在任意时刻,计算机中的每条线路要么处于高电压,要么处于低电压。我们并不需要弄清楚其电压到底是多高或多低。也就是说,我们并不需要区分115伏和118伏。我们只需要关心线路中电压的有和无,这样,就可以使用1和0分别表示电压的有和无。

    接下来,我们将使用0和1的组合序列信息进行编码。例如,使用01100001表示字母a,00100011表示十进制数字35。我们还将了解如何对这些编码进行运算。

    当熟悉了0和1的组合序列的信息表示及其运算(如加法)后,我们就开始了解计算机是如何工作的。在第三章中,我们将会了解组成今天的微处理器晶体管是如何工作的,接着将进一步了解如何由晶体管组成更大的进行运算的结构(比如加法),以及如何组成允许我们保存信息的结构。在第四章中,我们将这些大的结构组成冯·诺依曼机器——一个关于描述计算机是如何工作的基本模型。在第五章,我们将学习一个简单的计算机LC-3(LittleComputer 3)。LC-3拥有那些我们熟悉的微处理器的所有重要的特性,例如用于1981年IBM 第一台PC机的 Intel 8088,用于苹果公司制造的Macintosh的Motorola 68000、或2003年的高性能微处理器Pentium 4。也就是说,LC-3就如同真实的微处理器一样,只是没有那么复杂,从而能够被我们所理解。

    一旦我们理解了LC-3是怎样工作的,下一步就是对其进行编程,首先使用它自身的语言(即机器语言)(第6章),接着是汇编语言——一种更易于我们理解的语言(第7章)。第八章中会介绍LC-3的输入输出,即处理信息进出LC-3的问题。第九章中会介绍两个复杂的机制——trap和子程序。

    我们将在第十章中介绍程序设计,首先介绍两个重要的概念——堆栈数据转换,接着是一个稍微复杂的例子——LC-3实现计算器工作的程序。

    在本书的第二部分(11章-19章),我们将会学习一种高级程序设计语言——C语言,还包括很多在其他关于C语言介绍的书籍中没有涉及的方面。在大多数情况下,我们都会将C语言和底层的LC-3联系起来,以利于我们深入的理解:当你在C程序中使用某一种构造时,你要让计算机做什么。

    C语言从基本的主题开始,如变量运算符(第12章)、控制结构(第13章)和函数(第14章),到更高级的主题,如C程序的调试(第15章)、递归(第16章)、指针数组(第17章)。

    最后,我们以两个非常普遍的高级结构做总结——C的输入/输出(第18章)和链表(第19章)。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值