5.1k views

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?

1. $24$ bytes
2. $1024$ bytes
3. $768$ bytes
4. $256$ bytes
| 5.1k views

Lookup table is essentially a concept that is brought in to achieve greater color depth by using lesser amount of memory. The concept is achieved this way:

A framebuffer stores the color representation for every pixel on the screen. Its size will depend upon the screen resolution. Now to represent color on the screen for every pixel, a framebuffer would need some amount of memory. If it is dersired to represent more colors, then more bits (memory) would be needed for each pixel in framebuffer. For example, if we want to represent color in 24 bits, and screen has 80x80 pixels, then framebuffer would need 24 bits per pixel, so total of 80x80x24 bits, which is lot of memory.

A solution to this, is to use a lookup table. All the colors, 24 bit depth for example, are stored in lookup table.The framebuffer just stores if index of the entry in the lookup table, to represent color. So, the advantage is that, the bits per pixel in framebuffer is only as large as the bits needed to represent index of lookup table.

As can be seen abovem the framebuffer is just storing index of lookup table. The lookup table actually holds color representation. So size of framebuffer is reduced.

Now let us solve the question:

The question says

the frame buffer has 8 bits per pixel

This means that the maximum indexes that can be represented in the framebuffer are 256 (8-bits) entries.So, this means that Lookup table has maximum of 256 entries.

The question says

8 bits are allocated for each of the R,G,BR,G,B components

This means that the each entry in lookup table is of 24 bits ( 8 bits for each RGB).

24 bits = 3 bytes.

So the size of lookup table is

Number of entries x size of each entry

256 entries x 3 bytes each entry

## 768 bytes

by Loyal (5.5k points)
selected
0
Good Explanation
There are 2^8 = 256 entries in the lookup table with each entry size equal to 3*8 = 24 bits.

Hence, total size of memory = 256*24/8 bytes = 768 bytes.

Asnwer (C)
by (299 points)
0
0
Amazing bro.
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×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×4=1024 bytes. However, given the data at your disposal, the best guess would be 768 bytes.
by (61 points)