So I'm currently learning about thermoelectric generators and I learned about the two p and n semiconductors. I understand how the n-type semiconductors works which is that when one side gets heated then the other side will have more electrons giving it a negative charge, since the more heated side will have more excited electrons and they will move to the colder side faster than the colder side can get to the hot side. What I don't comprehend is how the p type semiconductor will do the exact opposite which is that the negative side will be on the hot side and the positive will be on the cold side. I know that p-type semiconductors are doped with elements for one less silicon atom in the lattice so that it can accept electrons, and I've heard it conducts positive charges but that's essentially it. If someone could give a clear explanation why that would be great thanks!