EC303 - CHAPTER 3 BASIC OF COMPUTER ARCHITECTURE AND NUMBER

Post on 28-Apr-2015

135 views 1 download

description

-

Transcript of EC303 - CHAPTER 3 BASIC OF COMPUTER ARCHITECTURE AND NUMBER

BASIC OF BASIC OF COMPUTER COMPUTER

ARCHITECTURE ARCHITECTURE AND NUMBER AND NUMBER

SYSTEMSSYSTEMS1

Understand how the Von Neumann architecture is constructed.

Understand how the Von Neumann architecture works.

Explain the strengths and weaknesses of the Von Neumann architecture.

Contrast the Von Neumann architecture and Harvard architecture.

The term von Neumann architecture refers to a computer design model that uses a single storage structure to hold both instructions and data. The term von Neumann machine can be used to describe such a computer, but that term has other meanings as well. The separation of storage from the processing unit is implicit in the von Neumann architecture.

The term "stored-program computer" is generally used to mean a computer of this design.

3

4

The parts are connected to one another by a collection of wires called a bus

Data flow through a von Neumann architecture

Processor

Von Neumann’s proposal was to store the program instructions right along with the data

This may sound trivial, but it represented a profound paradigm shift

The stored program concept was proposed about fifty years ago; to this day, it is the fundamental architecture that fuels computers.

The Stored Program concept had several technical ramifications:◦ Four key sub-components operate together to

make the stored program concept work◦ The process that moves information through the

sub-components is called the “fetch execute” cycle

There are four sub-components in von Neumann architecture:◦ Memory◦ Input/Output (called “IO”)◦ Arithmetic-Logic Unit◦ Control Unit

As you already know, there are several different flavors of memory

Why isn’t just one kind used? Each type of memory represents

cost/benefit tradeoffs between capability and cost

RAM is typically volatile memory (meaning it doesn’t retain voltage settings once power is removed)

RAM is an array of cells, each with a unique address A cell is the minimum unit of access. Originally, this

was 8 bits taken together as a byte. In today’s computer, word-sized cells (16 bits, grouped in 4) are more typical.

RAM gets its name from its access performance. In RAM memory, theoretically, it would take the same amount of time to access any memory cell, regardless of its location with the memory bank (“random” access).

It gets its name from its cell-protection feature. This type of memory cell can be read from, but not written to.

Unlike RAM, ROM is non-volatile; it retains its settings after power is removed.

ROM is more expensive than RAM, and to protect this investment, you only store critical information in ROM.

A register is the lowest level of data storage in a computer. Registers also have the lowest read/write time of all types of memory in your computer, making them idea to perform small, repeated calculations.

Of course, each CPU has a limited number of registers, so they can only be used for very short term data storage while that data is being processed.

There is a third, key type of memory in every computer – registers. Register cells are powerful, costly, and physically located close to

the heart of computing.

Modern computers include other forms of memory, such as cache memory.

Remember, memory types exist at different trade offs.

Two basic operations occur within this subcomponent: a fetch operation, and a store.

The fetch operation:◦ A cell address is loaded into the MAR.◦ The address is decoded, which means that thru

circuitry, a specific cell is located.◦ The data contents contained within that cell is

copied into another special register, called a Machine Data Register (MDR).

◦ Note that this operation is non-destructive – that is, the data contents are copied, but not destroyed.

The second memory operation is called a store.◦ The fetch is like a read operation; the store is

like a write operation◦ In the store, the address of the cell into which

data is going to be stored is moved to the MAR and decoded.

◦ Contents from yet another special register, called an accumulator, are copied into the cell location (held in the MAR).

◦ This operation is destructive, meaning that whatever data was originally contained at that memory location is overwritten by the value copied from the accumulator.

There is both a human-machine interface and a machine-machine interface to I/O.◦ Examples of the human-machine interface include a

keyboard, screen or printer.◦ Examples of the machine-machine interface include

things like mass storage and secondary storage devices. Input and output devices are the least

standardized of the various sub-components, which means that you have to pay extra special attention to make certain that your input or output devices are compatible with your machine.

The third component in the von Neumann architecture is called the Arithmetic Logic Unit.

This is the subcomponent that performs the arithmetic and logic operations for which we have been building parts.

The ALU is the “brain” of the computer.

It houses the special memory locations, called registers, of which we have already considered.

The ALU is important enough that we will come back to it later, For now, just realize that it contains the circuitry to perform addition, subtraction,multiplication and division, as well as logical comparisons (less than, equal to and greater than).

The last of the four subcomponents is the Control Unit.

The control unit is the work horse that drives the fetch and execute cycle.

A cell address is loaded into the MAR (machine address register )– it is the control unit that figures out which address is loaded, and what operation is to be performed with the data moved to the MDR(Machine Data Register (MDR).

StrengthsStrengthsshares memory between instructions and

dataRequires less hardware - separate data

busses are not required

18

WeaknessesWeaknesses

possible for instructions to be treated as data and for data to be executed as if it were instructions, resulting in a system crash.

because memory is common to data and instructions, the whole execution process is slower because (two) memory accesses need to be be made: first to access data, and then to access the instruction (or opposite).

19

2020

• Von Neumann architecture .– Programs and data occupy a single memory.

• Think of main memory as being an array of words, the array index being the memory address. Each word (array location) has data which can be separately written or read.

• Usually instructions are one word in length – but can be either more or less

CPU

Data bus

Data &

Instruction Memory

Address bus

Control bus

memory bus

21

Harvard architecture. ◦ In A Harvard architecture CPU programs are stored in a

separate memory (possibly with a different width) from the data memory. This has the added benefit that instructions can be fetched at the same time as data, simplifying & speeding up the hardware.

◦ In practice, the convenience of being able to read and write programs just like normal data makes this less usual still popular for fixed program microcontrollers.

21

CPUData Memory

Instruction Memory

Harvard architecture

22

The most obvious characteristic of the Harvard Architecture is that it has physically separate signals and storage for instructions and data memory. It is possible to access program memory and data memory simultaneously.

Von Neumann machines have shared signals and memory for instructions and data. Thus, the program can be easily modified by itself since it is stored in read-write memory.

22Harvard Architecture

23

Contrast the

Von Neumann architecture with Harvard architecture

23

24

Von Neumann Harvard

Program and data are stored in the same memory

Program and data are stored in separated storage

Managed by the same information-handling subsystem (buses)

Handled by different subsystems(buses)

requires less hardware requires more hardware

The most obvious characteristic of the Harvard Architecture is that it has physically separate signals and storage for instructions and data memory. It is possible to access program memory and data memory simultaneously.

Von Neumann machines have shared signals and memory for instructions and data. Thus, the program can be easily modified by itself since it is stored in read-write memory.

25Harvard Architecture