This information is not entirely correct, although it is the most accurate that I have seen published, I attached my document where I have reverse engineered p1 and reference is made to the original patent.
https://github.com/formatcom/tamatama/blob/master/Tutorial%20Tamagotchi%20P1.pdf