subject

4. (??, 22 pts) We saw in lecture methods to store integers (both negative and non-negative) and real numbers as sequences of 0s and 1s. Integers can be stored exactly (using binary numbers and/or 2’s complement), but real numbers must be approximated by rational numbers. In decimal (base 10), a rational number can be expanded as, for example, 11 8 = 1.375. That is, 11 8 = 1 × 100 + 3 × 10−1 + 7 × 10−2 + 5 × 10−3 . In a similar fashion, we can expand a rational number in binary, 11 8 = · · · # × 2 0 + # × 2 −1 + # × 2 −2 + # × 2 −3 + · · · = 1 × 2 0 + 0 × 2 −1 + 1 × 2 −2 + 1 × 2 −3 . Thus, we can write 11/8 as 1.011 in binary; thereby converting it to a sequence of 0s and 1s (and a decimal—binary?—point). (a) Is 0.1 the binary expansion of 1/2? Explain why or why not. (b) Determine the binary expansion of 45/16. Remember that a rational number is a number that can be written as a ratio of integers, such as 1/2, 3/4, and 5/1.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
What are compression artifacts? 1) visible defects in the picture caused by the nature of the compression algorithm. 2) numbers that tell a web server how much to compress a picture for faster transmission. 3) invisible defects in the picture preserved by lossless compression. 4) numbers that tell a photo editing program how much to compress a picture for faster transmission.
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 23.06.2019 22:20
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
You know the right answer?
4. (??, 22 pts) We saw in lecture methods to store integers (both negative and non-negative) and rea...
Questions
question
Chemistry, 21.01.2021 20:40
question
Social Studies, 21.01.2021 20:40
question
Biology, 21.01.2021 20:40
question
Mathematics, 21.01.2021 20:40
question
Mathematics, 21.01.2021 20:40