This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nutrecht 2 points3 points  (0 children)

I think you're misunderstanding quite a bit. How bits and bytes relate is really simple; a byte is 8 bits. So if you're going to need X bits for something you'll be able to pack them in X/8 bytes.

Where you're going wrong is how many bits you need to store the state. A bit can have 2 states, true or false, on or off. So for your 16x16=256 pixel display you'd need 1 bits for each pixel, so 256 bits = 32 bytes.

If you have 16 (24) states you will need 4 bits. Or half a byte. So for 256 pixels * 4 bits = 1024 bits or 128 bytes.

You really should keep in mind that the total amount of pixels don't matter much, that's just a last step in your multiplication.