# Size of framebuffer lookup table [closed]

If the frame buffer has 8 bits per pixel and 8 bits are allocated for each of the R, G, B components, what would be the size of the lookup table? a) 24 bytes b) 1024 bytes c) 768 bytes d) 256 bytes

I read about Framebuffer and what I understood is

"It stores the color values (in case of color frame buffer) in indexed form. So if we have $8-bit$ color, then possible colors are $2^8$*So frame buffer would store color values for each pixel on screen and it's size would depend on screen resolution. Corresponding actual color values (or codes) would be stored in lookup table"

So, Lookup table would have $2^8 = 256$ entries, which is $256$ bytes, since each entry is of 8-bits = 1 byte.

But that is not the correct answer to above question. So, can anyone tell, where am I going wrong ?

Also, question says frame buffer has 8-bit per pixel and 8-bits are allocated for each RGB , This means for each pixel, frame buffer has $8,8,8,8$ bits allocated ?

• where did you read that? what are the exact specification? You can't ask these details, as they depend on the information you are given. – Ran G. Dec 28 '14 at 5:15
• That being said, FWIK, 8-bit RGB, means 8+8+8 bits per pixel. But there may be additional information which is not color related. – Ran G. Dec 28 '14 at 5:17
• @Ran G. I read this in the competitive exam of Indian Space Research Organization (ISRO) for Computer Science Engineers. Only this question is given, nothing else is given as information. I don't have any clue about how to proceed with this. Here is the paper - see Q-10 – SimpleGuy Dec 28 '14 at 5:43
• maybe this would be helpful. – Ran G. Dec 28 '14 at 5:59
• Wow, that's a terrible set of exam questions. Not just this question but many others are more about guessing what the exam setter had in mind than about knowledge of computer science. Reading the mind of this exam setter isn't useful knowledge for computer scientists, I don't see how this question as worded could be of interest to anyone except people taking that particular exam. – Gilles 'SO- stop being evil' Dec 28 '14 at 14:36

## 1 Answer

Assuming that by framebuffer they really mean palette table, then the table consists of 256 entries, each encoding an RGB color ("true color"). An RGB color takes 24 bits (3 bytes), 8 bits per color component, so in total we need 256$\times$3=768 bytes. That said, it may be easier to access the table if each color takes up an entire dword (32 bits, 4 bytes): for example, indexing could be for free in certain processors. In that case the table would take up 256$\times$4=1024 bytes. However, given the data at your disposal, the best guess would be 768 bytes.

Palette tables are most celebrated for their use in the popular GIF format. GIF uses a color palette consisting of 256 colors (in its most popular version), one possibly being reserved for "transparent", and the colors themselves are stored separately, usually as "true color" 24-bit values. The color table indeed uses 3 bytes per color, for a total of 768 bytes.

• Thanks a lot for the answer. I couldn't find it anywhere. Your answer is correct. As per the answer-key, it is 768 bytes :) – SimpleGuy Dec 28 '14 at 10:26