ECE-1021
HOMEWORK #6
(Last Mod: 27 November 2010 21:38:42 )
Write and test the function GetV_u() and GetV_i() that get integer values from the keyboard. Each function takes a pointer as it's sole argument.
The first takes a pointer to a variable of type unsigned int while the second takes a pointer to a variable of type int.
The behavior of both functions is defined as follows:
This part is to be done on paper and turned in at the beginning of the first class session after the homework Grace Period expires.
Work should be legible and neatly presented. The use of Engineering Paper (E-2 paper) is preferred. Answers should be clearly indicated.
The goal of this assignment is for you to gain proficiency in working with different number bases and number representations. As such, your work must reflect your ability to perform these operations, not the ability of the design team that developed your calculator. You may therefore use a calculator to perform base-10 computations only. Specifically, you may not use calculator functions that perform number base conversions or that permit you to work with numbers in any base other than decimal. You may use such functions to check your work only. You must show your work on all problems that require computation to receive credit.
Using on the "systematic" methods described in the reading material, perform the following conversions. Do NOT perform brute force conversions - they will NOT receive credit.
100,000 to hex
0x8F7C to decimal
1101 1010 0111b to decimal
57614 octal to decimal
254 to binary
0xF7B5 to binary
1000 1101 1111 0101b to decimal
4230135 to base-7
Represent the value π2 in decimal, hex, and binary to the six radix places.
Represent the value 1/e in decimal, hex, and binary to the equivalent of at least six decimal places.
Express the U.S. National Debt ( $7,418,151,165,657.99 as of 07 Oct 04) in hexadecimal.
Represent the length of a meter, expressed in light years, using normalized exponential notation in decimal, hex, and binary. The mantissa should have enough digits to represent the number to an accuracy of 0.01%.
Represent the value of Avogadro's Number, using normalized exponential notation in decimal, hex, and binary. The mantissa should have enough digits to represent the number to an accuracy of 0.001%.
What is the decimal value of the largest value that can be represented using 12 digits in base-5?
How many hexadecimal digits are required to represent the speed of light, expressed in meters per second?
The number of possible ways to shuffle a 52 deck of playing cards is 52! (52 factorial). How many bits would be required to express this value (i.e., how many digits in base-2)?
Prepare hand-written Hexadecimal Addition and Multiplication Tables similar to that found in the reading for base-8. You may either prepare separate tables or a combined table.
Perform the following computations directly in hexadecimal. For the division problems, if the quotient is not an integer, show the result both in quotient/remainder form and also as a fixed point result to two hexadecimal places.
0xAE + 0x2C
0xAE - 0x2C
0xAE x 0x2C
0xAE / 0x2C
0xFACE + 0xDEED
0xFACE - 0xDEED
0xFACE x 0xDEED
0xFACE / 0xDEED