Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm Exam 2 Review Spring 2003: What's the underlying representation?

Comments? Concerns? Answers? Questions? Questions about Answers?
Back to Sp2003 Midterm Review 2


1. 4numbers x 8bits=32bits per address or 32/8=4bytes
3. Each RGB is 8bits, and three make 24bits or 3bytes
4. 16bits per character, if the string is 1024characters, then 16 x 1024=16,384bits or 16,384/8=2048bytes
Rebecca Phillips

16 bits gives you a range +/- 64000, not 1024. You need fewer bits to represent 1024. What's log-base-2 of 1024? Or, what's n where 2-to-the-nth power is 1024? Mark Guzdial


Okay, maybe I misuderstood the question. I thought that you meant that there were as many as 1024 characters possible and if 16bits are allowed per character, that that would mean 16,384bits. 2 raised to the 10th power would make 1024. I'm really not following what you're asking here.
Rebecca Phillips

Yeah,well, I'm not following this entire Midterm!

Assume 1 byte per character. A string can hold a maximum of 1024 characters. How many bits are needed to represent the ACTUAL length of a particular string? The string could have zero or one character in it, or 1024. Mark Guzdial


So would number four then be: the length of a particular string is equal to 2^nth power where n= the number of characters in the string?

Where should we look (as in what lectures) should we look to help us find the answer to number 2?

2 to the fourth isn't 1024. Mark Guzdial


As for which lecture: Early on, when I told you that n bits have 2-to-the-nth patterns in them. Mark Guzdial


2. is it 8-40 bits? Is this right?


No, for #2 (the Basic line numbers that go from 0 to 65536), the answer is not 40 bits. 2 raised to the 40th power is a VERY large number. Anybody remember the child's song "Inchworm"? "2 and 2 is 4, 4 and 4 is 8, 8 and 8 is 16, and 16 and 16 is 32"? 2 to the 2nd is 4, 2 to the 3rd is 8, 2 to the 4th is 16, 2 to the 5th is 32. When do you hit 1024 (for problem #4)? When do you hit 65536 (for problem #5)? The curve goes up pretty quickly – you don't have to go much farther than the "Inchworm" song. Mark Guzdial


You hit 1024 at the 10th power and 65536 at the 16th power.
To get 256 with the RGB values, 2 is raised to the 8th power. We know that it's 8 bits per RGB value.
So should #4 be 10bits for a whole string?
and for #2 should it be 16bits?
Rebecca Phillips

Yep. Mark Guzdial


So is #1 1024

See earlier. 4 bytes is not 1024 bits. Mark Guzdial


could this be anymore confusing!!??!!??!!

number one is 32 bits per address. number two is 16 bits. number three is 24 bits. number four is 10 bits. transfer any of these to bytes by dividing by 8. Kelly Farrell



Link to this Page