Could you use a cpu to store data

If I am correct cpus are made of billions of transistors in a small space that are either a 0 or a 1. Could you use this to store data? If we can cram billions of transistors in a small space that each store 1 bit we could put trillions in a space as big as a hard drive.

CPU's don't work like that, but they do store data. Not much, and not for very long, but they store data using cache.

Assuming every transistor could hold a single bit of data, a CPU with a billion transistors would hold about 120MB of data. MicroSD cards have had higher data density since their inception. Today's MicroSD cards can hold 128GB of data, and they aren't that much bigger than a CPU die.