Show the 8-bit two\'s complement representation in both binary and hexadecimal f
ID: 3663383 • Letter: S
Question
Show the 8-bit two's complement representation in both binary and hexadecimal for the decimal numbers 31, -31, 121, -124, 3, and -3. Yott must show your work to net credit. Show your work when answering this question dealing with IEEE Std 754 32-bit binary floating point numbers. This is a theoretical exercise demonstrating that you understand the concepts. Using a format/ approach similar to that found in the 412-1.0 lb slides dealing with floating-point representation. Show the 32-bit hex representation for the floating-point decimal value 11.25 Show the floating-point decimal value for the hex representation 0xC0700000 Show the addition of the two values in parts a and b. Show the multiplication of the two values in parts a and b. Download QtSpim form the syllabus reference [8] and install it on your computer. You will also want some kind of programmers editor; there are several decent free ones, e.g., jEdit. Write and run a QtSpim program that adds two numbers. Use the first two non-zero numbers in your J number. Hard-code the numbers in the data segment as x and y, and store the computed result in z, e.g. Do not use any syscall instructions other than the terminal program sequence, e.g., Include a screen dump of QtSpim showing your code runs. Put the source code and the screen dump into the PDF that you submit via email.Explanation / Answer
Answer for problem-1
------------------------------------------------------------
For 2's complement, you need to know the two points
1) Positive integer in 2's complement
-It is represented same i.e unsigned binary integer, but leftmost bit is 0 indicating sign as positive
2) Negative integer in 2's complement
a)First write the positive of negative integer in binary form. For example you want to write -15 inn
2's complement, first write 15 in binary form
b) Invert the digits
c) Add one to inverted digits
1)31
Binary = 0001 1111, Hex = 1F
As per point-2 above, 2's complement of 31 = Binary = 0001 1111, Hex = 1F
2)-31
As per point-2 above
Binary of 31 = 0001 1111
Inverting and adding 1 = 1110 0000+1 = 1110 0001 and (Hex = E1)
3)124
Binary = 0111 1100, Hex = 7C
2/s complement is same as above
4) -124
Binary of 124 = 0111 1100
2's complement of -124 = Invert above and add 1 = 1000 0011+1 = 1000 0100 , Hex = 84
5)3
Binary = 0000 0011, Hex = 03
6) -3
2's complement = Invert (3 = 0000 0011) and add 1 = 1111 1100 +1=1111 1101, Hex =FD
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.