Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (4 points) Convert (56257)10 into base 16. 2. (4 points) Check your answer for the previous problem by converting it back into base 10.

1. (4 points) Convert (56257)10 into base 16.
2. (4 points) Check your answer for the previous problem by converting it back into base 10.
3. To store text characters in binary, a computer uses an encoding scheme. The idea is to associate certain sequences of bits with certain characters 0001 might be A, 0010 might be B, and so on. When the computer sees a particular sequence of bits, it interprets that sequence as its character equivalent.
The number of bits used in an encoding scheme determines how many unique characters can be represented. For example, consider three encoding schemes: scheme S1 uses 1 bit per character, scheme S2 uses 2 bits per character, and scheme S3 uses 3 bits per character. Because each individual bit has only two possible values (0 or 1), S1 can represent up to two unique characters (encoded as 0 or 1). S2 can represent up to four unique characters (encoded as 00, 01, 10, or 11), and S3 can represent up to eight unique characters (encoded as 000, 001, 010, 011, 100, 101, 110, or 111). In general, an encoding scheme that uses n bits per character can represent up to 2n unique characters.
(a) (1 point) How many unique characters can be represented by an encoding scheme that uses 20 bits per character?
(b) (3 points) Suppose youre developing a new, super-complex language that contains 5170 consonants and 274 vowels. Each consonant and vowel can be either upper or lower case. What is the smallest possible number of bits per character you could use in an encoding scheme for this language? Clearly explain how you arrived at your answer. Assume a fixed-length encoding scheme (i.e., every character uses the same number of bits), as in our examples above.
4. Colors can be represented in a computer using an RGB color scheme, where each color is a combination of red, green, and blue components. In 24-bit RGB, each component (red, green, and blue) uses 8 bits, from a low of (0000 0000)2 to a high of (1111 1111)2. This translates to a range of 0-255 in base 10. The 8 bits of red are stored first, followed by the 8 bits of green, and finally the 8 bits of blue.
For example, the color green has RGB values (in base 10) of red 0, green 255, blue 0. A computer stores this as 24 bits: (00000000 11111111 00000000)2. Meanwhile, purple is a mix of red and blue: red 255, green 0, blue 255. This is stored in binary as (11111111 00000000 11111111)2.
24-bit RGB colors are usually expressed in hexadecimal (base 16) for conciseness. Recall that when converting base 2 into base 16, the bits are grouped in sets of 4. Therefore, these hexadecimal color codes are 24 / 4 = 6 digits in length. The first 2 digits represent the amount of red, the middle 2 digits represent the amount of green, and the last 2 digits represent the amount of blue. The 6-digit hexadecimal code is usually preceded by a pound sign (#) to clarify that its expressed in base 16. For example, the code for green is #00FF00, while the code for purple is #FF00FF.
Consider a color with red, green, and blue values of 124, 23, and 229 respectively (in base 10).
(a) (6 points) What is the hexadecimal color code for this color?
(b) (2 points) What is the sequence of 24 bits that a computer would store for this color?
You can use a website like https://www.webfx.com/web-design/color-picker/ to help verify your answers, but you must show your work to get full credit for this problem.
5. In the previous problem, we saw that each color can be represented using 24 bits of data. Its pretty easy to extend that idea to images. An image can be stored in a computer as a rectangular grid of pixels, each of which is assigned one color.
Youve probably heard the term 4k before. A 4k image has a resolution of 3840 pixels
(horizontally) by 2160 pixels (vertically).
(a) (1 point) How many total pixels are there in a 4k image?
(b) (1 point) Assuming that each pixel takes 24 bits to store its color information, how many bits does it take to store the colors for all the pixels in a 4k image
(c) (1 point) Convert your previous answer into bytes. (By definition, 1 byte = 8 bits.)
(d) (2 points) A video is simply a sequence of images (called frames) that are shown rapidly to produce the illusion of movement. In theory, how many bytes of data does it take to store a two-hour 4k movie at 24 frames per second?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions