Question

In: Computer Science

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

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. 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
(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
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.
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
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to...
Add or subtract the following 2’s complement form signed numbers, then convert the entire problem to decimal and confirm: 110110 + 111000 001100 – 011100
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
Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.
Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.
Binary How is 00001001 (base 2) represented in 8-bit two’s complement notation? Convert 0.3828125 to binary...
Binary How is 00001001 (base 2) represented in 8-bit two’s complement notation? Convert 0.3828125 to binary with 4 bits to the right of the binary point. How is 00110100 (base 2) represented in 8-bit one's complement.  
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT