Question

In: Computer Science

Part 2: Signed values: Convert each as indicated. 7. Decimal to Hexadecimal (1 byte, signed magnitude)...

Part 2: Signed values: Convert each as indicated.

7. Decimal to Hexadecimal (1 byte, signed magnitude)

     a. -18

     b. -41

Solutions

Expert Solution

a. -18
Decimal to binary:
-------------------
Write down the decimal number and continually divide by 2 to give a result and a remainder. The remainder is either a 1 or a 0.
18 /  2  result 9  remainder  0
9  /  2  result 4  remainder  1
4  /  2  result 2  remainder  0
2  /  2  result 1  remainder  0
1  /  2  result 0  remainder  1
Read the remainders from bottom to top.
( 18 )10 = ( 10010 )2
Prepend zeros ro make it 8 bit.
( 18 )10 = ( 00010010 )2

Ones complement = Inverts bits in binary = 11101101
Twos complement = Ones complement + 1 = 11101101 + 1 = 11101110

Binary to hexa decimal:
------------------------
Convert each 4 bits to its hexa decimal.
1110 in hexa decimal is E
So, 11101110 in hexa decimal = EE

Answer: (EE)16

******************************

b. -41
Decimal to binary:
-------------------
Write down the decimal number and continually divide by 2 to give a result and a remainder. The remainder is either a 1 or a 0.
41 /  2  result 20 remainder  1
20 /  2  result 10 remainder  0
10 /  2  result 5  remainder  0
5  /  2  result 2  remainder  1
2  /  2  result 1  remainder  0
1  /  2  result 0  remainder  1
Read the remainders from bottom to top.
( 41 )10 = ( 101001 )2
Prepend zeros ro make it 8 bit.
( 41 )10 = ( 00101001 )2

Ones complement = Inverts bits in binary = 11010110
Twos complement = Ones complement + 1 = 11010110 + 1 = 11010111

Binary to hexa decimal:
------------------------
Convert each 4 bits to its hexa decimal.
1101 in hexa decimal is D
0111 in hexa decimal is 7
So, 11010111 in hexa decimal = D7

Answer: (D7)16


Related Solutions

Part 2: Signed values: Convert each as indicated. 8. Decimal to Hexadecimal (1 byte, one's complement)...
Part 2: Signed values: Convert each as indicated. 8. Decimal to Hexadecimal (1 byte, one's complement)      a. -18      b. -41
if hexadecimal number FA16 represent a signed number in signed magnitude, what the decimal representation of...
if hexadecimal number FA16 represent a signed number in signed magnitude, what the decimal representation of that number? include the sign for that number with no spaces between the number and sign. for example -3 or +3
Convert the following numbers from decimal to hexadecimal (and for each, indicate how many bytes would...
Convert the following numbers from decimal to hexadecimal (and for each, indicate how many bytes would be needed to store the value of that number): 10 15 16 256 250 358 1024 1023 8195
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system....
(a) Convert the decimal numbers, 70 and -26 to binary in the signed 2’s complement system. Make sure there are enough digits in the results to be able to perform arithmetic operations with these two numbers. (b) Perform in the signed 2’s complement system, (+70) + (-26) (c) Perform in the signed 2’s complement system, (-70) - (-26) (d) Perform in the signed 2’s complement system, (+70) + (+26)
if hexadecimal number FF16 represent a signed number in one's compliments, what the decimal representation of...
if hexadecimal number FF16 represent a signed number in one's compliments, what the decimal representation of that number? include the sign for that number with no spaces between the number and sign. for example -3 or +3
With a detailed step-by-step process, convert the following decimal number into binary, Hexadecimal and IEEE 754...
With a detailed step-by-step process, convert the following decimal number into binary, Hexadecimal and IEEE 754 formats : 72.nn ( where nn is 80)
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7 5 -3
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7...
Complete the matrix below (use 4 bits) Signed Integer Signed Magnitude 1’s Complement 2’s Complement Excess-7 5 -3
Convert decimal +47 and +31 to binary, using the signed-2’s-complement representation and enough digits to accommodate...
Convert decimal +47 and +31 to binary, using the signed-2’s-complement representation and enough digits to accommodate the numbers. Then perform the binary equivalent of (+31)+(-47), (-31)+(+47), and (-31)+(-47). Convert the answers back to decimal and verify that they are correct.
Write a MIPS Assembly Language program which runs interactively to convert between decimal, binary, and hexadecimal....
Write a MIPS Assembly Language program which runs interactively to convert between decimal, binary, and hexadecimal. 1. Request input data type. 2. Request input data. 3. Request output data type. 4. Output the data. Use any algorithm
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT