In Dark Star a sentient bomb gets stuck in the drop mechanism. One of the crew teaches it existentialism in an attempt to stop it detonating, but then it comes to believe its the only being in the universe and decided “Let there be light”.
While the sibling comment correctly points out Dark Star as the movie, I'd also like to point out Starship Titanic - Douglas Adams was involved in the game, based on a throwaway line from one of the Hitchhiker novels. Terry Jones novelized the game. Both include a talking bomb where the plot involves distracting the bomb until it looses track and has to start counting down all over again.