Problem 1 . In the C programming language (C99), an int8_t is 8 bits, an int16_t
ID: 3783950 • Letter: P
Question
Problem 1 . In the C programming language (C99), an int8_t is 8 bits, an int16_t is 16-bits, and an int32_t is 32 bits. Each type is for a specific length of binary bits. Give the range of each type of number in decimal. Show your work.
Problem 2 . At least how many binary bits does it take to represent the decimal number 100,000,000,000? Show your work.
Problem 3 Ordered from Alpha to Omega, the Greek alphabet has 24 characters (Consider the capital characters only). At least how many binary bits should be used to represent the complete Greek alphabet?
Problem 4 Using the number of bits you have obtained from Problem 4, how many more unique characters can you represent in addition to the capital Greek letters?
Problem 5 Study the one’s compliment format for signed integers in the textbook section 1.5. Suppose we use half words to store two decimal numbers: 8 and -8. Use the one’s compliment, calculate -8+8 and express the result in binary bits using a half word. Also briefly describe your observation on the result.
Problem 6 Restrict us to only five binary bits. Use these five bits to represent unsigned integers. Now calculate 28+6 and 3-12. Express the results using the given five binary bits. Hint: these two calculation will have the problem of overflow. Show your work.
Explanation / Answer
Problem 1:
Range of n bit binary number can be represented as 2n-1 - (2n-1-1)
for 8-bit ,the range is -128 - +127
for 16-bit,the range is -32768 - +32767
for 32-bit,the range is -2147483648 - +2147483647
Problem 2:
for finding the no.of bits required ;the formula is n bit = (log number)/log 2
n= (log 100000000000)/log 2
=>11/log 2 =>36.54 => 37 (bits required)
PROBLEM 3:
for finding the no.of bits required ;the formula is n bit = (log number)/log 2
n= (log 24)/log 2
=>4.58 => 5 (bits required)
PROBLEM 4:
5 bits means we can use it for 25 = 32 elements.Out of which 24 are used for GREEK ALPHABETS , so the remaining can be used for unique characters i.e 32-24 = 8 unique characters
Hope,my answer helped you.Any other further help.Please feel free to contact us.We will love to help you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.