First page Back Continue Last page Overview Graphics
Software polling implementation of double handshaking (sender side)
1. write strobe signal (low) to output port.
2. wait1: read acknowledge signal from input port.
if input = 1 (acknowledge not received)
jump to wait1;
3. send data to data port.
4. write strobe signal (high) to output port.
5. wait2: read acknowledge signal from input port.
if input = 0 (data has not been read)
jump to wait2;
6. next: . . . ; data has been read
The pseudocode shown above uses polling to implement the sender side of double handshaking. The scope of the if statement is indicated by indentation.
Double handshaking on the receiver side can be implemented similarly in software.