writes the command into the command register. If the host is sending output, it sets the write bit and writes a byte into the data-out register. If the host is receiving input, it reads the controller-written data from the data-in register, and sets the read bit to 0 as the next command. The host sets the command-ready bit to 1. Controller actions: When the controller notices that the command-ready bit is set, it sets the busy bit to 1. The controller reads the command register. If the write bit inside is set, it reads from the data-out register and performs the necessary operations on the device. If the read bit is set, data from the device is loaded into the data-in register for the host to read. Once the operations are over, the controller clears the command-ready bit, clears the error bit to show the operation was successful, and clears the busy bit. Types A polling cycle is the time in which each element is monitored once. The optimal polling cycle will vary according to several factors, including the desired speed of response and the overhead (e.g., processor time and bandwidth) of the polling. In roll call polling, the polling device or process queries each element on a list in a fixed sequence. Because it waits for a response from each element, a timing mechanism is necessary to prevent lock-ups caused by non-responding elements. Roll call polling can be inefficient if the overhead for the polling messages is high, there are numerous elements to be polled in each polling cycle and only a few elements are active. In hub polling, also referred to as token polling, each element polls the next element in some fixed sequence. This continues until the first element is reached, at which time the polling cycle starts all over again. Polling can be employed in various computing contexts in order to control the execution or transmission sequence of the elements involved. For example, in multitasking operating systems, polling can be used to allocate processor time and other resources to the various competing processes. In networks, polling is used to determine which nodes want to access the network. It is also used by routing protocols to retrieve routing information, as is the case with EGP (exterior gateway protocol). An alternative to polling is the use of interrupts, which are signals generated by devices or processes to indicate