CPU cannot directly control mechanical parts of IO device, so an electronic part needed for IO device as an “intermediary” between CPU and mechanical parts to realize the control of the device by CPU.
This electronic component is IO controller, also known as IO controller. CPU can control the IO controller, which controls the mechanical parts of device.
Functions of IO Controller
CPU read/write commands and parameters are stored in the control register
(For example, 1 means the device is busy, 0 means the device is ready)
Composition of IO Controller
The interface between CPU and controller (implementing the communication between controller and CPU)
IO logic (responsible for identifying the commands issued by CPU and issuing commands to the device),
The interface between controller and the device (implementing controller and the device) communication between devices)
Two register addressing methods
*Memory mapping IO: **The registers in controller are unified with the memory, and the instructions for operating the memory can be used to operate the controller.
*Register independent programming: The registers in the controller are programmed independently. Special instructions need to be set up to operate the controller.