Week #8 - Highyeena/Tech-Journal GitHub Wiki
Computer Organization and Architecture
- Protocol = Signals exchanged between a sender and a receiver. Includes command signals ('Printer reset'), status signals ('Tape ready') or data-passing signals ('Here are the bytes you requested').
- Handshake = The acknowledgement the receiver must give to the commands and data sent to it or indicate that it's ready to receive data.
- Durable Storage = Storage medium that doesn't rely on the continued supply of electric currents to retain data. (EX. Magnetic disks/tape and Optical Disks)
I/O Control Methods
- differences in control methods and transmissions modes make is hard to connect I/O devices to a system bus
- I/O modules are used as interfaces between the CPU and peripherals to manage these differences
- modules perform functions such as controlling device action, buffering data, performing error detection, and communication with the CPU.
Programmed I/O
- The simplest way for a CPU to communicate with an I/O device is through programmed I/O (also called: polled I/O or Port I/O)
- CPU monitors a control register associated with each I/O port and once the 'data ready' control bit is set:
- resets the control bit.
- retrieves the byte and processes it according to instructions programmed for that particular port.
- After processing is complete, the CPU resumes polling the control registers
- Benefit: there is control over the behavior of each device (you can adjust the number and types of devices in the system, their polling priority, and intervals)
- Cons: CPU is constantly polling in the 'busy wait' loop before servicing an I/O to process
- Polling frequency: Some CPUs poll faster than others
- Because of this, Programmed I/O is best used for specialized systems (such as teller machines/embedded systems that control or monitor environmental events
Interrupt Driven I/O
- Most common and efficient method
- Opposite of programmed I/O, device tells the CPU when they want data to send. The CPU proceeds with other tasks in the system until a device requests a service, which interrupts the CPU to complete the task.
- communication mostly takes place through an intermediary interrupt controller
- Similar to programmed I/O (can both modify service routines in order to accommodate hardware changes)
Memory Mapped I/O
- I/O devices and main memory share the same address space.
- Each I/O device has is own block of memory, data is transferred to and from the memory address mapped to the device
- Simplifies system design, making it easier to navigate and use
- Best used on smaller systems
Direct Memory Access (DMA)
- CPU offloads the execution of time-consuming I/O instructions.
- CPU provides the DMA controller with the location and number of the bytes to be transferred and the destination device or memory address
- This process usually takes place through special I/O registers on the CPU,
- block oriented; interrupting the CPU only after completion (success or failure) of transferring a group of bytes.
Channel I/O
- used in mainframe computers (becoming more popular on file servers and storage networks)
- One or more I/O processors control various I/O pathways called channel paths
- channel paths are categorized (EX. 'slow devices' like printers/terminals) are combined (multiplexed), allowing for management of several of the devices through only one controller
- I/O channels are driven by small CPUs called Processors (IOPs), optimized for I/O. Unlike DMA circuits, IOPs have the ability to execute programs that include arithmetic-logic and branching instructions
- IOPs execute programs (called Channel Command Words, 'CCW') that are placed in main system memory by the host processor
- Once the I/O program has been placed into memory, the host issues a start sub channel (SSCH) command, which informs the IOP of the location in memory where the program be found.
- After the IOP is done, completion information is put onto memory which interrupts the CPU
- Channel I/O is a type of isolated I/O.
Character I/O vs. Block I/O
-
Each key in a keyboard controls a small switch that closes a connection in the matrix of conductors that run horizontally and vertically beneath the keys. When a key is pressed, a scan code is processed by the keyboard circuitry. Then translates the code to a character
-
Magnetic disks and tapes store data in blocks; managed in block I/O units and lends itself to DMA or channel I/O processing.
-
Blocks can be different sizes (depends on hardware/software/applications)
-
Determining the right block size is important in the system to make sure the system is able to handle all information processed.
Serial and Parallel Transmission
Serial Transmission
- Data-bit goes between two computers (bi-direction)
- long distance
- One clock pulse = One bit transferred
- simple circuitry
- cost efficient
Parallel Transmission
- bits flow together simultaneously between two computers
- faster than serial transmission
- short distance
- eight bits transferred at a time (contain a start and stop bit)
- complex circuitry