alice-teacher question regarding bits and bytes!

James Vanderhyde jvanderhyde at benedictine.edu
Wed Mar 5 10:45:03 EST 2014


12 * 2^10 = 12,288 bytes, and the question is about bits (8 bits in a byte).

As for the colors, you don’t really have to consider RGB when counting the bits. In the “old days” when monitors could not display 24-bit color, we used look-up tables to get different color palettes. 8-bit color was a common case, and GIF files still use 8-bit color. There are only 256 different colors, but which ones they are is controlled by a color look-up table. Each 8-bit value (between 0 and 255) is used to look in a table of colors. Each table entry has a regular 24-bit RGB value for that color. The 6 bits in your question could be used to form a 64-entry look-up table.

Another way to interpret it, however, is that the 6 bits are split up evenly between R, G, and B, so there are 2 bits for each color channel. There are a total of 2^6 = 64 different colors, and each channel has 2^2 = 4 different variations.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu<mailto:jvanderhyde at benedictine.edu>
http://vanderhyde.us/~james/pro/



On Mar 5, 2014, at 12:30 AM, Sandy Graham <sandyg at gvtc.com<mailto:sandyg at gvtc.com>> wrote:

The book I just started has this question:
“If a picture was made up of 64 possible colors, how many bits would be needed to store each pixel of the picture?”
I thought RGB values would be required so was trying to figure out an answer from that (though the book doesn’t give much information on how to do that exactly), but the answer key says the answer is 6. I can see that 2^6 = 64 and assume that’s where the 6 came from, but why is that the answer? How does 6 bits yield 64 possible colors? Don’t RGB values have to be considered?

Then the next question asks, “How many bits are there in 12 KB?”
So 12 * 2^10 = 12,288, right? I’m pretty confident of my answer, but I wanted to double check with a reliable source as the answer key says 98, 304 is the correct answer. The key is wrong, right?

Thanks! I didn’t know where else I could get a reliable answer to this!
Your sister in Christ,

Sandy Graham

_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140305/9aabda99/attachment.html 


More information about the alice-teachers mailing list