Question
3) Give the 2s complement form (applies to negative numbers) using 16-bit binary for each of the following: For example 1111 0000 1111 0000. a.
3) Give the 2s complement form (applies to negative numbers) using 16-bit binary for each of the following: For example 1111 0000 1111 0000. a. 13 base 10 b. -13 base 10 c. 156 base 10 d. -209 base 10
4) Perform the following calculations involving decimal values using 2s complement arithmetic within the amount of bit precision available. Show the resulting value in binary AND indicate whether there is an overflow condition or not. a. 13 + 8 with 5 bits precision b. 13 + 8 with 6 bits precision c. 13 8 with 5 bits precision d. 13 8 with 6 bits precision e. -13 8 with 5 bits precision f. -13 8 with 6 bits precision g. 105 57 with 8 bits precision
5) Perform the following multiplication operations of decimal values using bit shift operations. Show your work, for example: 15*11 = 15 * (8+2+1) = 15 *8 + 15 * 2 + 15 * 1 = (0000 1111 << 3) + (0000 1111 << 1) + (0000 1111 << 0) = 0111 1000 + 0001 1110 + 0000 1111 = 1010 0101 = 165 a. 5 * 4 b. 13 * 12 c. 7 * 10 d. 15 * 5
6) What is the hexadecimal representation of the following ASCII character strings (note that the quotation mark is a delimiter and NOT part of the string value): a. 52 b. -127
7) Perform the following division operations of decimal values using only bit shifts operations. Show your work, similar to the example for multiplication in problem 5: a. 12 / 8 b: 64 / 16 8) Explain the difference between a short circuiting and non-short circuiting logical Boolean expressions such as AND and OR.
9) What hexadecimal value would you add or subtract to the following ASCII character values to convert them to either upper or lower case? Indicate both the value (in hex) and operation (add or subtract). a. 0x41 (character A) b. 0x6e (character n)
10) Write a program in the High-Level Language (HLL: Java, C, C++) of your choice to take a character string representing a binary number, and write out the number in hex. You can assume the characters in the string are either 0 or 1 and the length of the string is some multiple of 4. For example, in Java: String binary = 0110110101001111, hexchar; int currentposition = 0; for (int count = 0; count < (binary.length() 1); count = count + 4) { System.out.print(hexchar); } System.out.println(); The result should be on the monitor: 6D4F
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started