I am getting confused between trap and interrupt. As trap is software driven and interrupt is hardware originated. Every instruction of a program get executed in CPU then how trap and interrupt differs ? A detailed example can help out me. Thanks in advance.