The second part of the system is used to sound the alarm. There is an input signal, D, indicating that a door is open (1) or closed (0) and an output, N, indicating that the alarm is sounded (1) or not (0). (Of course, A is also an input to this part of the system.) When the alarm is first armed, the door must be closed within 1000 clock pulses or the alarm will sound. (Note that this gives the user the chance to set the alarm and go out without the alarm sounding.) Also, if the alarm has been armed for more than 1000 clock periods and the door is opened, the alarm will sound if it is not disarmed within 1000 clock periods.