For each of the following, see if you can figure out the representation in terms of bits and bytes.
(a) Internet addresses are four numbers, each between 0 and 255. How many bits are in an Internet address?
(b) In the ancient programming language Basic, lines can be numbered, each one between 0 and 65,535. How many bits are needed to represent a line number?
(c) Each pixel’s color has three components, red, green, and blue, each of which can be between 0 and 255. How many bits are needed to represent a pixel’s color?
(d) A string in some systems can only be up to 1,024 characters. How many bits are needed to represent the length of a string?
(a) Since it takes 8 bits to represent 256 numbers, it’ll require four sections of eight bits, meaning
(b)
(c) 24 bits, as 8 bits can represent one value between 0 and 255.
(d)
Computer Science & Information Technology