Tuesday, December 3, 2013

INPUT/OUTPUT

1.1BUSES

The input/output bus or io bus is the pathway used for input and output devices to communicate with the computer processor.

A bus is a shared communication link,which uses one set of wires to connect multiple subsystems.

Bus is a set of wires connecting multiple modules(processor,memory,IO devices)





Sometimes shared bus with memory,sometimes a separate I/O bus






1.2Advantage and Disadvantage of Buses


Advantages:

1)versatility
-new devices can be added easily.
-peripherals can be moved between computer systems that use the same bus standard

2)low cost
-a single set of wires is shared in multiple ways

Disadvantages:

1)It creates a communication bottleneck.

2)The bandwidth of that bus possibly limiting the maximum I/O throughput.

3)The maximum bus speed is is largely limited by:
- physical factors:the length of the bus and the number of devices.

4)The need to support a range of devices with widely varying latencies and data transfer rates also makes bus design challenging.

5)It becomes difficult to run many parallel wires at high speed due to clock skew and reflection.


1.3Characteristics of Buses

-a bus standard provides flexibility:can connect multiple devices from different manufacturers

-but a bus maybe a communications bottleneck

-a bus maybe a synchronous or asynchronous

-to coordinate transmission on an asynchronous bus,a hand shaking protocol can be used.

There are two basics schemes  for communication on the bus:

-Synchronous
-Asynchronous




1.4Synchronous

-If a bus is a synchronous(e.g Processor-memory),it includes a clock in the control lines and a fixed protocol for communicating that is relative to the clock.




-This type of protocol can be implemented easily in a small finite state machine.Because the protocol is predetermined and involves little logic,the bus can run very fast and the interface logic will be small.


Two Major Disadvantages:

1)Every device on the bus must run at the same clock rate.

2)Because of clock skew problems,synchronous buses cannot be long if they are fast.





1.5Asynchronous

-An asynchronous bus is not a clocked.

-It can accommodate a wide variety of devices

-It can be lengthened without worrying about clock skew or synchronization  problems.

-It requires a handshaking protocol.

Three special control lines required for hand-shaking:

1)Read-req:used to indicate a read request for memory.The address is put on the data lines at the same time.

2)DataRdy:used to indicate that the data word is now ready on the data lines;asserted by:Output/Memory and Input/I_O Device.

3)Ack:used to acknowledge the ReadReq or the DataRdy signal of the other party.






Steps after the device signals a request by raising ReadReq and putting the address on the Data lines:

1)When memory sees the ReadReq line,it reads the address from the data busand raises Ack to indicate it has been seen.

2)As the Ack line is high-I/O releases the ReadReq and data lines.

3)Memory sees that ReadReq is low and drops the Ack line to acknowledge the ReadReq signal(Mem. Reading in progress now)

4)This step starts when the memory has the data ready.It places the data from the read request on the data lines and raises DataRdy.

5)The I/O device sees DataRdy,reads the data from the bus,and signals that it has the data by raising Ack.

6)On the Ack signal,M/M drops DataRdy,and raises the data lines.
7)Finally,the I/O device,seeing DataRdy go low,drops the Ack line,which indicates that the transmission is completed.





1.6Increasing the bus bandwidth:

1)Data bus width:

-By increasing the width of the data bus,transfers of multiple words require fewer bus cycles.
-Example:SPARCstation 20?s memory bus is 128 bit wide.

-Cost:more bus lines

2)Block transfers:

-Allow the bus to transfer multiple words in back-to-back bus cycles.

-Only one address needs to be sent at the beginning

-The bus is not released until the last word is transferred

-Cost:(a)increased complexity
          (b)decreased response time for request
    

1.7Bus Arbitration

Any device that can control the bus is called a bus master

Bus arbitration scheme:

-A bus master wanting to use the bus asserts the bus request

-A bus master cannot use the bus until its request is granted

-A bus master signal to the arbiter after it has finished using the bus


Bus arbitration schemes usually try to balance two factors:

1)Bus priority:the highest priority device should be serviced first

2)Fairness:Even the lowest priority device should never be completely locked out from the bus


The Daisy Chain Bus Arbitrations Scheme


Advantage:

-simple

Disadvantages:

-cannot assure fairness:
A low-priority device may be locked out indefinitely

-the use of the daisy chain grant signal also limits the bus speed







Recall that I/O buses are the electronic channels that allows the various input/output and storage devices to communicate with the CPU.On most motherboards,the I/O buses are organized as follows:




As the diagram shows,
-The I/O panel(on the back of the motherboard)contains ports and connectors for standard input/output devices(keyboard,mouse,etc) as well as integrated components(audio,video,LAN).
-Device headers (attached to the surface of the motherboard)are used to connect storage devices(FDD,HDD,DVD)




1.8Giving Commands to I/O Devices

1)Two methods are used to address the device:

-special I/O instructions

-memory-mapped I/O

2)Special I/O instructions specify:

-Both the device number and the command word
     -Device number:the processor communicates this via a set of wires 

-Normally included as part of the I/O bus
      -Command word:this is usually send on the bus data lines

3)Memory-mapped I/O:

-Portions of the address space are assigned to I/O device

-Read and writes to those addresses are intrepreted as commands to the I/O devices



1.9Notifying the OS

1)The OS needs to know when:
-The I/O device has completed an operation
-The I/O operation has encountered an error

2)This can be accomplished in two different ways:

Polling:
-The I/O device put information in a status register
-The OS periodically check the status register

I/O Interrupt:
-Whenever an I/O device needs attention from the processor,it interrupts the processor.



1.10Controlling Input/Output Transfers

1)Polling
-Check the device a regular intervals.

Advantage:
Simple-the processor is totally in control and does all the work

Disadvantage:
Polling overhead can consume a lot of CPU time


2)Interrupt Driven Data Transfer

Advantage:
-User program progress is only halted during actual transfer

Disadvantage:
-special hardware is needed to:
 -cause an interrupt(I/O device)
-detect an interrupt(processor)
-save the proper states to resume after the interrupt(processor)


3)Delegating I/O Responsibility from the CPU:DMA




 Direct Memory Access(DMA):

-External to the CPU
-Act as a maser on the bus
-Transfer blocks of data to or from memory without CPU invention

  
 Block Diagram of a DMA Controller


Sequence of Operations-Input:

1)CPU loads register-Address,Count and Device

2)CPU Sets Status to Input

3)Controller asks for bus

4)Gets bus-does read from device,puts Address on the bus,does write to memory and decrements count.

     **Repeat 4 until count=0

5)Interrupt CPU to signal end of transfer


***Output is similar but status is set to Output and data is read from memory and written to the output device





4)Intelligent Controllers(microprocessors themselves)

-handle basic control of IO device in addition to block transfers


Example:
 -error checking for communication lines,transfer of multiple sectors from disk



I/O buses connect these ports and headers to the super I/O and southbridge support chips, which in turn are connected to the northbridge chip, which allows the devices to communicate with the CPU and memory.
The division of I/O buses is according to data transfer rate.Specifically,

Controller
Port / Device
Typical Data Transfer Rate
Super I/O
PS/2 (keyboard / mouse)
2 KB/s
Serial Port
25 KB/s
Floppy Disk
125 KB/s
Parallel Port
200 KB/s
Southbridge
Integrated Audio
1 MB/s
Integrated LAN
12 MB/s
USB
60 MB/s
Integrated Video
133 MB/s
IDE (HDD, DVD)
133 MB/s
SATA (HDD, DVD)
300 MB/s




1.11PS/2 Ports

The circular ports with 6 holes are called PS/2 connectors. They are used to connect the keyboard and mouse.
In early PCs, mice were usually connected to the PC using the serial port, and were therefore known as serial mice.Microsoft developed another type of mouse that could be connected to the PC by an expansion card, which plugged into one of the expansion slots on the motherboard.This type of mouse was called a bus mouse.By using a bus mouse, the serial port could be used for other devices, such as a modem.In 1982, IBM took this idea one step further with their new PS/2 computer.In the PS/2, the motherboard contained built-in mouse controller circuitry and a built-in mouse connector, which eliminated the need for an expansion card.Today, the term "PS/2 connector" is still a reference to the 1982 computer where they first appeared.



1.12Universal Serial Bus (USB) Ports

The Universal Serial Bus (USB) is a serial bus technology that was developed jointly by seven companies, including Intel, IBM and Microsoft.The USB has significantly higher data transfer rates than the standard serial interface; however, it's most attractive feature is called "hot-plugging", which means that devices can be plugged in and used immediately, without powering down or rebooting the system.When the device is plugged into any USB port, the USB controller in the PC will detect the device, and automatically determine and allocate the resources and drivers that are required.
The USB interface can be used to connect a maximum of 127 different peripheral devices, including keyboards, mice, joysticks, speakers, microphones, printers, modems, scanners,videos cameras and more.This can either be done by "chaining" the devices together (provided each device contains 2 of it's own USB ports), or by using a series of USB "hubs" which can connect multiple devices, and can themselves be chained together.
Most PCs have additional USB connectors on their front panel.Extra USB ports can be purchased and installed on the back of the PC (using an expansion card opening), or on the front of the PC (into a device bay opening). The wires from these ports have plastic connectors on the other end, which are then plugged into appropriate pin banks on the motherboard.



1.13Serial and Parallel Ports

1)Serial ports are used to connect slower devices that communicate using serial (one bit at a time) signals, such as a modem or a serial mouse.Serial ports are easily identifiable, with 9 or 25 small metal pins arranged over two rows (most other ports have holes).Motherboards usually identify the serial port as COM1.

2)Parallel ports are used to connect devices that communicate using parallel (8 bits at a time) signals, such as printers, scanners and disk cartridge drives. The parallel port is usually the widest port on the motherboard, with 25 holes arranged over 2 rows.Motherboards usually identify the parallel port as LPT1.
Since most I/O devices now use USB, more and more motherboards are being manufactured without a parallel / serial port on the back of the board.However, these motherboards may still support older parallel or serial devices. External parallel / serial ports can be purchased and installed on the back of the PC (using an expansion card opening).The wires from these ports have plastic connectors on the other end, which are then plugged into appropriate pin banks on the motherboard.



1.14Additional Ports

Additional I/O ports will vary from motherboard to motherboard, depending on the number of integrated features. 
For example, in the diagram above:
-VGA port for attaching a monitor.
-LAN port for attaching an Ethernet cable to connect the PC to a local area network.
-Standard audio jacks (blue / pink / green) for standard sound input and output
Not shown in the diagram above, but found on some specialized motherboards:
-Audio jacks to connect surround sound speakers (grey / black / orange)
-Game port / midi connection
-SPDIF ports to send the sound from the PC to a stereo receiver
Firewire ports for connecting camcorders, DVD players and digital audio equipment

to be continued...
Nur Liyana Bt Roslan
B031310295

No comments:

Post a Comment