44
Computer Structure A simple computer system consists of the following components: • Processor • Memory • Input/Output • Communication Channels Structure of a computer system INPUT PROCESSOR OUTPUT BACKING STORAGE MAIN MEMORY

Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Embed Size (px)

Citation preview

Page 1: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Computer Structure

A simple computer system consists of the following components:

• Processor

• Memory

• Input/Output

• Communication Channels

Structure of a computer system

INPUT PROCESSOR OUTPUT

BACKING STORAGE

MAIN MEMORY

Page 2: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Architecture of a computer system

Control

Unit

ALU Arithmetic

Logic Unit

Registers

Main Memory

External Memory

Peripheral Devices

This diagram is a typical example of John Von Neumann (1903 – 57) architecture. Virtually all computers follow this architecture model. Stored Program Concept.

buses

Page 3: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Buses – communication channel.

The parts which go together to make up the computer system need to be able to communicate with one another.

Buses connect the processor to the memory and input/output devices. There are three buses that connect all of these parts.

Processor Main Memory Input Output

Address Bus

Data BusThe control bus is not shown in this diagram.

Page 4: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Standard Grade Revision

Program

A program is a list of instruction which tell the processor to do something.

Each program instruction is stored in separate locations with it own binary number in the computers main memory.

An item is stored in memory in a storage location with its own unique address (binary number).

011 111 101 100

RAM

Page 5: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Standard Grade Revision cont..

The processor can identify each storage location this is known as addressability.

WORDEach storage location can hold data this is known as a word.

Word is the number of bits that can be processed by the CPU in one operation

Page 6: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Address BusThe address bus is a collection of wires used to identify which address in memory the CPU is accessing.

Unidirectional bus, transferring information in one direction.

The number of wires in an address bus (width) determines the number of unique memory locations which the CPU can address.

Page 7: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

A 2 line address bus would allow addresses.

2 lines00011011

because 22 = 4.

because 23 = 8.

X lines on the address bus allows addresses.

A 24 line address bus allows 224 = 65536 storage locations

4

A 3 line address bus would allow addresses.83 lines

000001010011100101110111

2x

Address bus width and addressable memory

Page 8: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Calculating the addressable memory in a computer system.

Formula

= Number of storage locations (addresses) x size of each storage location

Type of question

Calculate the maximum memory size of a computer with a 24 bit address bus and a memory word size of 16 bits.

Page 9: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

= 2^24 x 16 bits

= 16777216 x 16

= 268435456 bits/8

= 33554432 bytes/1024

= 32768 Kb/1024

= 32 Mb

= 2^24 x 16 bits

= 16777216 x 2 bytes

= 33554432 bytes

= 32768 Kb

= 32 Mb

Question 1

Calculate the maximum memory size of a computer with a 32 bit address bus and a memory word size of 8 bits.

Question 2

Calculate the maximum memory size of a computer with a 24 bit address bus and a 16 bit data bus.

That the width of the data bus matches the capacity of each memory location.

Page 10: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Every time a bit is added to the width of the address bus, the address range doubles.

Increasing the width of the address bus, for instance, from 32 bits to 40 bits, will increase the total number of memory locations which the processor can address from 2^32 to 2^40.

Increasing address bus width has NO effect on computer performance.

Page 11: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Data Bus

Carries data to and from the CPU, main memory and any other devices attached to the data bus.

Bi-directional bus – 2 way. The width of the data bus determines the quantity of data that the bus can carry at one time.

CPU RAM

READ

WRITE

It is a two-way bus as data may be going to the processor (Read) or coming from the processor (Write).

Page 12: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Most common 32 bit bus which can transfer 32 bits of data from a processing unit or storage device. (32 bit Word Length)

Word Length – the number of bits a computer can process in a single operation.

Increasing the data bus width will increase the quantity of data which the bus can carry at one time.

This will have an effect on the computer performance of the computer system.

Page 13: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Control Bus (line)

The control bus is not really a bus. Each wire is used for a separate purpose whereas the data and address bus consist of a collection of wires that are always together.

The control bus is made up of a number of separate wires, each with their own function:

• Read/Write

• Clock

• Reset

• Interrupt

• NMI - Non Maskable Interrupt

CU

Page 14: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Read/Write Function

Control unit will initiate a read signal when data has to be read from another part of the computer system.

When data has to be written to a memory location then the control unit will initiate a write signal.

More about this later – Fetch Execute Cycle

Page 15: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Clock

Generates a constant pulse at a frequency measured in Hertz.

Common CPUs available today perform at 3Ghz and faster. This means that a 3Ghz CPU can execute 3,000,000,000 instructions in a single second!

Each beat causes the control unit to fetch and decode data, which is called the “Fetch Execute Cycle”.

Page 16: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Reset

Used to return the processor to an initial state, as if it has just been switched on.

All internal registers are cleared and the machine reboots.

If you computer has ‘frozen’ many computers have a small button somewhere on the case which can be used to activate the reset line.

Page 17: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Interrupt

A signal from a peripheral device or a program. Allows the peripheral or program to communicate with the processor.

• Each time the keyboard is pressed an interrupt is generated.

• IBM PC can allow 256 interrupts.

Page 18: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Steps involved with an interrupt

• Stops the current program (break in execution)

• Saves current program

• Runs program to deal with interrupt (Interrupt Service Routine)

• Reloads its original task and continues what it was doing.

Software can be used to ignore (mask) an interrupt. For example, a printer out of paper.

Page 19: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Non Maskable Interrupt

Behaves in the same way as an Interrupt, except that the processor cannot ignore the interrupt.

Page 20: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

The two most basic operations which the processor carries out are and

It therefore spends a lot of time transferring data to and from the main memory.

memory read memory write.

You have now seen the three buses.

The processor uses the three buses to communicate with the main memory. The processor works on data which is stored in main memory.

Page 21: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Inside the Processor

Control Unit

ALU

Registers

Control

Unit

ALU Arithmetic Logic Unit

Registers

PC

MAR

MDA

IR

MAIN MEMORY

Control Bus (line)

Data Bus

Address Bus

Page 22: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Registers

Registers are temporary storage locations inside the processor.

The registers are used hold:

● data which is being processed

● instructions which are being executed

● addresses which are about to be accessed.

Page 23: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Registers

Memory Address Registers memory address register used to hold memory address being accessed.

Memory Data Registers contains the data to be written to memory or receives the data read from memory.Program CounterThe register which stores the address of the next instruction is called the program counter.

Usually after each instruction is executed, the program counter increases by one (hence the use of the word counter) so that it contains the address of the next instruction. Instruction CounterHold the instruction currently being executed.

Page 24: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Control Unit

The control unit controls the flow of information through the processor, and coordinates the activities of the other units within it.

In a way, it is the "brain within the brain", as it controls what happens inside the processor, which in turn controls the rest of the PC.

The control unit fetches each instruction (by sending out a signal) in sequence, decodes it and executes it. This is known as the Fetch Execute Cycle.

Page 25: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Control Unit cont…

Timing/Control Logic

• Tells other parts of the system what to do and when to do it.

• Makes sure everything happens in the correct place at the correct time.

Instruction Decoder

• Decodes the machine code during the cycle.

These signals are sent out and received on the control bus

Page 26: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Arithmetic Logic Unit (ALU)

Deals with the arithmetic operations and logical operations.

Arithmetic

Addition

Subtraction

Division

Logic

Logical OR

Logical AND

Think of programming

IF mark >50 then print “PASS”

Page 27: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Stored Program Concept

Programs are stored in slow-to-access storage medium (hard disc) and the processor works on them in fast-access storage medium (RAM).

By changing the program, which is stored or held in the computers main memory, a computer can carry out a completely different process. e.g. using Word and Excel at the same time.

Process

A process is a program in execution.

Page 28: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

CPU

Hard Disk

What happens when a program is opened:

Programs are stored in the computers Hard Disk

Programs move into RAM when in use by the computer

A processor of a computer is able to carry out a process only when it is given a set of instructions

The Processor decodes the instructions and executes them.

Page 29: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Fetch Execute Cycle

A program may contain thousands of instructions but the processor can only execute one instruction at a time.

The fetch execute cycle is the name given to the way in which the CPU takes in an instruction from memory (FETCH) and carries out that instruction (EXECUTE).

Page 30: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

In computing, the two-phase cycle used by the computer's central processing unit to process the instructions in a program.

Fetch Stage

During the fetch phase, the next program instruction is transferred from the computer's immediate-access memory to the instruction register (memory location used to hold the instruction while it is being executed).

Execute Stage

During the execute phase, the instruction is decoded and obeyed.

The process is repeated in a continuous loop.

Page 31: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Summary – fetch-execute cycle (Memory Read)

1. The processor sets up the address bus with the address of the next instruction to be fetched.

2. The processor sends a read signal on the control bus.

3. The instruction is then copied onto the data bus from the correct memory location to a register in the CPU.

4. The CU (Control unit) decodes the instruction and begins to execute it.

Once the execute phase has completed, the fetch phase will be carried out again.

Page 32: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Fetch-Execute Cycle (Memory Write)

1. The processor sets up the address bus with the address of where the instructions has to be placed

2. The processor sends a write signal on the control bus.

3. The instruction is then copied onto the data bus from the CPU and taken to the memory location.

4. The instructions are then placed in the correct memory location in main memory.

Once the execute phase has completed, the fetch phase will be carried out again.

Page 33: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Memory

Main memory of a computer is a general term for any type of computer memory other than backing storage.

Known as primary storage

Memory consists of a number of storage location, each identified by a unique address

INPUT PROCESSOR OUTPUT

BACKING STORAGE

MAIN MEMORY

Page 34: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Types of Memory

Main memory consists of two types, Random Access Memory (RAM) and Read Only Memory (ROM)

Random Access Memory

• Holds data as long as computer is switched on

• Data is lost when computer is switched off

• Known as volatile memory

• RAM can be written to and read from

Type types of RAM

DRAM – Dynamic

SRAM – Static

Page 35: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

DRAM – Dynamic

The term dynamic is derived from the fact that it does need refreshed

• Contents constantly refreshed from the CPU (1000 times a second) or data will be lost

• Access time of 60 – 70 nanoseconds (1 nanosecond is one billionth (10-9) of a second)

• Cheap to produce

• Holds large amounts of data

• Requires less power than SRAM

Page 36: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

SRAM - Static

Type of memory that is faster and more reliable than the more common DRAM

• The term static is derived from the fact that it doesn't need to be refreshed like dynamic RAM.

• Holds its data as long as there is a power supply

• Consumes more power

• Faster access times

• Expensive to produce

• SRAM is more suited to cache memory

Page 37: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

VRAM – Video

This is an old type of memory that was designed for used with graphic adapters. It is special because it allows two devices to read the contents of the memory at the same time.

This allows the monitor to access the memory for screen updates, while at the same time allowing the graphics processor to provide new data.

Page 38: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Cache Memory

The cache memory is similar to the main memory but is smaller than main memory and performs faster.

The cache memory performs faster by accessing information in fewer clock cycles.

There are two types of cache memory present in the majority of systems

Level 1 (L1) cache is in the processor

Level 2 (L2) cache memory is optional and found on the motherboard of most processor-based systems.

Page 39: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

How it works?

An area of high speed memory set aside to store frequently accessed data.

When data is accessed, a copy (and its address in memory) is stored in cache memory. The next time the CPU looks for information, it first checks the cache. If the data is there (called a hit), it can retrieve it from the much faster cache memory. If it is not, then it accesses system memory, puts a copy of the new data in the cache, and processes the information.

Page 40: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Cache Memory

A small amount of random access memory that sits between the processor and RAM in order to speed up data transfer.

Temporary store for often used instructions. Web Pages are saved in cache memory

Much faster for CPU to access data held in cache memory than in main memory.

CPUCACHE

RAM

Very fast access

fast access

Page 41: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Read Only Memory

Memory that holds its data permanently. When the computer is switched off, data is preserved.

The contents of ROM are fixed when the computer is manufactured.

Used to hold part of the operating system program, the bootstrap loader, which is used to start up the computer.

Access time of 10 – 50 nanoseconds

Page 42: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Types of ROM

ROM: Read-only memory. The “1”s and “0”s are permanent and created at the silicon foundry. Only used for circuits needed in the tens of thousands and after many prototypes.

PROM: Programmable read-only memory. A hardware device connected to a PC can program the ROM, but it is write-once.

EPROM: Erasable programmable read-only memory. A PROM that can be erased by exposure to ultraviolet light .

EEPROM: Electrically erasable programmable read-only memory. A PROM that can be erased by high voltages.

FLASH ROM: Erased and reprogrammed easily inside a computer. Flash ROM is now very popular. Used for USB memory pens, memory cards, mobile phones.

Page 43: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Memory Map

Page 44: Computer Structure A simple computer system consists of the following components: Processor Memory Input/Output Communication Channels Structure of a computer

Review Questions