Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

22
Chapter 4 Computer Organization Vishal Shah Vishal Pinto
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    255
  • download

    3

Transcript of Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Page 1: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Chapter 4Computer Organization

Vishal Shah

Vishal Pinto

Page 2: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Contents

• The Von Neumann Architecture• The Central Processing Unit• The Primary Memory• I/O devices• Interrupts• Conventional Contemporary Computers• Mobile Computers• Multiprocessors and Parallel Computers

Page 3: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Interrupts

Why Device Drivers?

read ( devID, myData, dataLength );

x = f ( myData, dataLength, …)

Page 4: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

…// Start the device…while ((busy = = 1) || ( done = = 1)) wait( );//Device I/O complete…done = 0;

busy done

…while (( busy = = 0) && (done = = 1)) wait( );// Do the I/O operationbusy = 1;…

Software

Hardware

Page 5: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

I/O Polling

A process in which a number of I/O devices are interrogated, one at a time, to determine if service is required.

Introduces Busy-wait situation.

Page 6: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

. . . Device DeviceDevice

. . .

CPU

InterruptRequest flag

Detecting an Interrupt

Page 7: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Fetch-Execute cycle with an Interrupt

while (haltFlag not set during execution) { IR = memory[PC]; PC = PC + 1; execute (IR); if ( InterruptRequest) { memory[0] = PC; PC = memory [1]; }}

Conceptually ,hardware connects all device-done flags to the interrupt request flag using inclusive-OR logic

Page 8: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

The Interrupt handler

Interrupt_Handler {

SaveProcessorState( );

for ( i = 0; i<Number_of_devices; i++)

if (device[i].done = = 1) goto device_handle(i);

/* Something wrong if we get here

}

Page 9: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

• Extension to detect interrupt more rapidly?

Interrupt vector.

• Race condition ?

Interrupt occurs while the Interrupt handler is in the midst of execution.

Solution: Avoid it.

Page 10: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Disabling Interrupts

If ( InterruptRequest && InterruptEnabled ) {

/* Interrupt current process */

disableInterrupts ( );

memory [0] = PC;

PC = memory[1];

}

Page 11: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Trap InstructionUsed by a process running in user mode that wants to perform an operation that requires privileged instructions

trap

S

Mode

1

2

3

User SupervisorTrusted Code

Page 12: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Von Neumann Architecture

Primary Memory Unit

Device Controller

Device

CUALU

Address Bus

Data Bus

CPU

Page 13: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Bootstrapping the Machine

CMOS

POST

BIOS

Boot Prog

Loader

OS

Power UP

ROM

RAM

Boot Device

Page 14: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Boot Loader Program

Fixed_LOC:// Bootstrap loader entry point

load R1, =0

load R2, =LENGTH_OF_TARGET

/*The next instruction is really more like a procedure call than a machine instruction. It copies a block from BOOT_DISK to BUFFER_ADDRESS.*/

read BOOT_DISK, BUFFER_ADDRESS

Loop: load R3, [BUFFER_ADDRESS, R1]

store R3,[FIXED_DEST, R1]

incr R1

bleq R1, R2, loop

br FIXED_DEST

Page 15: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Mobile Computers

Features:• Physically light and small• Severely constrained in the rate at which it can

consume power• O/P devices are small and usually is speaker• Does not contain a storage device• Has removable devices like CF cards, NIC..

Page 16: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

System-on-chip Technology

Set of memory and device functions that is needed by the onboard processor on a single chip.

Page 17: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Power Management

• Notebook computers– Switch OFF LCD display– Power down Disks

• Mobile computers– Switch OFF or dim displays– Reducing the clock speed of processor

Page 18: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Multiprocessors and Parallel Computers

• Parallel instruction Execution

• Pipelined function unit

Function UnitOperand 1

Operand 2Result

Operand 1

Operand 2 Result

Page 19: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Array processors

ALU

ALU

ALU

ALU

ALUControl Unit

Control Unit

Conventional Architecture SIMD Architecture

Page 20: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Shared Memory Multiprocessors

• Processors are Interconnected with one another with primary memory using specialized hardware

• Popular among programmers tools used to develop s/w for single process could easily be used with the shared memory architecture

• Distinct from Von Neumann architecture but rely upon it.

Page 21: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Distributed memory Multiprocessors

• Collection of CPU’s with their memory interconnected using high-speed n/w– High speed LAN or High speed fiber optic n/w

• Do not support ordinary sequential Programming languages like Shared memory machines do

• Exchanges data as messages

Page 22: Chapter 4 Computer Organization Vishal Shah Vishal Pinto.

Network of workstations

• PC’s interconnected with a network• Usually individual computers with autonomous

executing units with their own OS