|
发表于 2008-7-22 20:51:38
|
显示全部楼层
2.3.1 Von Neumann
Von Neumann architecture has a single, common memory space where both program instructions and data are stored. There is a single data bus which fetches both instructions and data. Each time the CPU fetches a program instruction it may have to perform one or more read/write operations to data memory space. It must wait until these subsequent operations are complete before it can fetch and decode the next program instruction. The advantage to this architecture lies in its simplicity and economy.
2.3.3 Harvard
Harvard architecture computers have separate memory areas for program instructions and data. There are two or more internal data buses which allow simultaneous access to both instructions and data. The CPU fetches instructions on the program memory bus. If the fetched instruction requires an operation on data memory, the CPU can fetch the next program instruction while it uses the data bus for its data operation. This speeds up execution time at the cost of more hardware complexity.
Since Harvard machines assume that only instructions are stored in program memory space, how do you write and access data stored in program memory space? For example, a data value declared as a C constant must be stored in ROM as a constant value. Different microcontrollers have different solutions to this problem. A good C compiler automatically generates the code to suit the target hardware’s requirements.
Some chips have special instructions allowing the retrieval of information from program memory space. These instructions are always more complex or expensive than the equivalent instructions for fetching data from data memory
Typically these chips have a register analogous to the program counter (PC) which refers to addresses in program space. Also, some chips support the use of any 16 bit value contained in data space as a pointer into the program address space. These chips have special instructions to use these data pointers.
=======================================================================
学校里学的是标准C,标准C是按Von Neumann结构为基础的。
而AVR,51等不是采用Von Neumann结构,是Harvard结构的。所以针对这些芯片开发的C平台,都不是标准C。 |
|