Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer &...

36
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization & Assembly Language Lecture 9 (Computer System Organization) Input / Output

Transcript of Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer &...

Page 1: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Riyadh Philanthropic Society For Science

Prince Sultan College For WomanDept. of Computer & Information Sciences

CS 251Introduction to Computer Organization

& Assembly Language

Lecture 9(Computer System Organization)

Input / Output

Page 2: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 2

Study from Lecture notes Logical Structure of a Simple Personal Computer

I/O-mapping

Direct Memory Access

Interrupt

Bus Arbiter & Cycle Stealing

Buses

A Typical Modern PC

Input / Output Devices

Outline

Page 3: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 3

Introduction

Motherboard = large printed circuit board

The motherboard consists mainly of the following components: The CPU chip. Some slots. Various support chips. A bus along its length. Sockets into which the edge connectors of I/O board can be inserted.

Sometimes there are two buses: A high-speed bus for modern I/O boards. A low-speed bus for older I/O boards.

Page 4: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 4

Logical Structure of PCs

Each I/O device consists of two parts:

The device. (e.g. keyboard, monitor, etc.)

The controller, which controls the device and handle bus access for it.

Page 5: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 5

Input / Output Mechanism

There are three different types of I/O that a typical computer system will use:

Port mapped I/O

Memory mapped I/O

Direct Memory Access

For each of these types, there are advantages and disadvantages

Page 6: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 6

I/O Mechanism – Port mapped

CPU uses special instructions to access the I/O ports

This type is not provided by all CPUs

The Intel 80x86 Family processors

supports this type of I/O

Has In and OUT instructions to provide I/O mapped input/ output characteristics

Page 7: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 7

I/O Mechanism – Memory Mapped

Peripheral devices are connected to the address and data line of the CPU exactly like the

memory

CPU reads/writes the address of the peripheral device to transfer data to/from the device

Page 8: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 8

I/O Mechanism – DMA

Direct Memory Access

Special Form of Memory mapped I/O

The I/O peripheral devices read/write data without going through the CPU

The CPU is not involved in the memory access

Page 9: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 9

Interrupt

I/O devices must be able to initiate communication with the CPU.

An interrupt is a signal initiated by the I/O devices to tell the CPU that it requires some

attention.

When the CPU is “interrupted”, it suspends running its current program and start running a

special procedure, called an interrupt handler

The interrupt handler determines the appropriate course of action (e.g. Check for error, informs the

OS that I/O is completed, etc.).

When the interrupt handler finishes, the CPU continues with the program that was suspended when

the interrupt occurred.

Page 10: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 10

Bus Arbiter & Cycle Stealing

The bus is not only used by the I/O controllers, but also by the CPU for fetching

instructions and data.

A bus arbiter decides who takes the bus in case there is a collision

In general, the I/O devices are given preferences over the CPU

When no I/O is in progress, the CPU could have all the bus cycles to access memory

When some I/O device is also running, that device will request and be granted the bus

when it needs it

This is what is called Cycle Stealing

Page 11: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 11

Buses

Communication pathway between all components

Shared among all, thus broadcasts the information to all devices that are

connected to it

Organize communication information into 3 forms

Address

Data

Control everything else

of information being communicated

Page 12: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 12

Bus Interconnection Scheme

memory I/O

Page 13: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 13

Data Bus

carries data

remember that there is no difference between “data” and “instruction” at this level

width is a key determinant of performance of bus. Can be 8, 16, 32, 64 bit.

Page 14: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 14

Address Bus

Identify the source or destination of data

e.g. CPU needs to read an instruction (data) from a given location in memory

Bus width determines maximum memory capacity of system (Maximum Cells

addressable)

Page 15: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 15

Address & Data Groups

often bundle address and data signals separately and use different physical

pathways

may multiplex using same physical pathway

1

0address

1

0data

1

0address data

Page 16: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 16

Common Control Signals

reset – force all components to reset

clock(s) to synchronize communication.

destination indicator – usually memory or I/O device.

acknowledgment from component – info received from parts of computer

interrupts

Arbitration: Signal for Bus access by devices

Page 17: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 17

Bus Protocols

signaling and sequencing to permit interactions between components of computer

Ex.. Memory Read

processor puts address value on bus, and “memory read” control indication

memory receives read signal, reads address, gets appropriate data, puts data on bus

processor waits, then reads data from bus

May be

Synchronous – protocol synchronized by a clock – organize protocol by clock “ticks” Ti

Asynchronous – no clock is required to synchronize protocol.

Page 18: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 18

Synchronous Memory Read

T1 initiate memory read (address, mem read signal)

T2 time for memory to do internal work

T3 data ready for reading from bus

T1

stable data

T2 T3

clock

addrs stable address

mem read

data

Assumption:Sensing of bus signals done during clock trailing edge

Page 19: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 19

Asynchronous Memory Writeno shared clock pacing the protocol mem write command

proc

esso

r

Memory sends signal that it has finished writing.

Page 20: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 20

ISA, EISA & PCI Buses

One of the earliest bus architectures in the IBM PC was the ISA

(Industry Standard Architecture) bus.

This bus was too slow for market development

The situation led to other companies developing machines with multiple buses, one

of which was the old ISA bus, or its backward- compatible successor, the EISA

(Extended ISA) bus.

The most popular of these now is the PCI (Peripheral Component Interconnect) bus

Page 21: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 21

Typical Modern PC

Page 22: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 22

Typical Modern PC (Cont.)

A typical modern PC would typically contain:

Three or four empty PCI slots.

Three or four empty ISA slots.

To allow customers to plug in both

New PCI I/O cards, usually for fast devices.

Old ISA I/O cards, usually for slow devices.

Page 23: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 23

Terminals

Computer terminals consist of two parts:

Keyboard.

Monitor.

In the mainframe world, these parts are often integrated into a single device and

attached to the main computer by a serial line or over a telephone line

In the personal computer world, the keyboard and monitor are independent

devices.

Page 24: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 24

Keyboards Keyboards rely on various methods to physically register the pressing of a key -

mechanical, electromagnetic, etc.

On personal computers, when a key is depressed, an interrupt is generated and

keyboard interrupt handler is started

The interrupt handler reads a hardware register inside the keyboard controller to get

the number of the key (1 - 102) that was just depressed

When a key is released, a second interrupt is caused

Thus if a user depresses the SHIFT key, then depresses & releases the M key, then

releases the SHIFT key, the operating system can see that the user wants an upper

case “M”.

Page 25: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 25

CRT Monitors

A monitor is a box containing a CRT (Cathode Ray Tube) and its power supplies.

The CRT contains a gun that can shoot an electron beam against a phosphorescent

screen near the front of the tube.

Color monitors have three electron guns, one each for:

Red

Green

Blue

Page 26: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 26

Flat Panel Displays

CRTs are far too bulky and heavy to be used in notebook computers

The most common screen for notebooks is based on the LCD (Liquid Crystal Display) tech.

Two types are common:

Passive matrix displays.

Active matrix displays

Page 27: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 27

Mice A mouse is a device for pointing at, and selecting items on a desktop

Low-level software in the computer accepts this information as it comes & converts the relative

movements sent by the mouse to an absolute position on the screen.

When the user clicks a mouse button, the computer can figure out which item has been selected

from knowledge of where the arrow is on the screen.

Four kinds of mice have been produced:

Mechanical mice.

Optical mice.

optomechanical

wireless mice

Page 28: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 28

Modems

A computer device that uses the telephone lines to provide the underlying connectivity

between computers

A raw telephone line is not suitable for transmission since it uses just 2 signals, 0 volts to

represent a 0 and 3 to 5 Volts to represent a 1.

Two-level signals suffer considerable distortion when transmitted over a voice-grade

telephone line, thereby leading to transmission errors

Page 29: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 29

Modems - Carrier

A pure sine wave signal at a frequency of 1000 to 2000Hz, called a carrier, can be

transmitted with relatively little distortion.

Because the pulsations of a sine wave are completely predictable, a pure sine

wave transmits no information at all.

By varying the amplitude, frequency, or phase, a sequence of 1s and 0s can be

transmitted

This process is called modulation

Page 30: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 30

Modems - ModulationTime

Tow-level signal

Amplitude modulation

Frequency modulation

Phase modulation

Page 31: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 31

Modems - Transmission

Modems can be:

Full-duplex: can transmit in both directions at the same time.

Half-duplex: can transmit in both direction, but once at a time.

Simplex: only transmit in one direction.

Page 32: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 32

ISDN

Integrated Service Digital Network, is a standard for digital telephony

When the World Wide Web happened and people were clamoring for high-bandwidth digital access to the

Internet, ISDN suddenly discovered its killer application

An ISDN line typically holds two independent digital channels at 64,000 bits/sec each, plus a signaling

channel at 16,000 bits/sec. For businesses, a 30-channel ISDN line is typically used.

ISDN is faster than the analog channel and

Allows connection to be established in typically no more than 1 sec

No longer requires an analog modem, and

Much more reliable than an analog line.

Page 33: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 33

ISDN for Home Use

Page 34: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 34

DSL

Digital Subscriber Line

Technology for bringing high-bandwidth information to homes and small businesses over

ordinary copper telephone lines

A DSL line carries both data and voice signals, where the data part is always connected

DSL uses the non-voice frequencies to transmit data, so the voice conversations are not

affected by the data transmission

Page 35: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 35

DSL - Advantages

The phone line can be used for phone calls while the internet is open

The speed is much higher than the regular modem

It doesn’t necessarily require new wiring, it can use the normal phone line

The company offering the DSL will provide the equipment as part of the installation

Page 36: Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.

Input / output 36

DSL - Disadvantages

The DSL connection works better when the user is closer to the provider’s central office

The connection is faster for receiving data than it is for sending data over the internet

The service is not available everywhere