understanding how bits are stored

suppose we have an 8 bit 16x16 bit map

that means 16x16 = 256 pixels then 256 x 8 bits = 2048 Kbits

if i have an eeprom with 2048 Kbits of spacen then i can only store there one 8 bit sprite of 16x16.

im i wrong? i think this is how flash work too, i want to store sprites for games in flash but i would like to know how many sprites i can store in flash or eeprom, thanks in advance.

If your sprites are 16x16 pixels : 512 bytes for full 65536 colours. 256 bytes for 256-colour palette. 128 bytes for 16-colour palette.

Your Due has plenty of Flash memory. Quite a bit of SRAM too. It is unnecessary to use any external memory.

Note that a 256-colour palette uses 512 bytes. So palettes are only memory savers when you use the same palette for lots of sprites.


then 256 x 8 bits = 2048 Kbits

No. You added a "k" that shouldn't be there. 2048 BITS! Don't forget that most microcontroller memories are measured in bytes. A Due has 512kBYTES of flash memory - enough for a couple thousand of your 2048bit sprites. EEPROM chips do tend to be measured in bits, because they first came out a really long time ago, when adding 256 bytes (from a 24c02) or even 128bytes (from a 93c46) of writeable non-volatile storage to a system was a BIG DEAL. These days, you can get much larger EEPROMS - a 24fc1025 has 1Mbit (128k bytes - that seems to be the largest readily available I2C EEPROM) and SPI flash chips are available up to several Gigabits.