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
Convert the following binary values to hexadecimal and decimal (1 pt each) Write Hex Numbers as...
Convert the following binary values to hexadecimal and decimal (1 pt each) Write Hex Numbers as 0x##(ex 0x0A, 0xFF) Binary Hexadecimal Decimal 0001-1011 0x 0000-1000 0000-0100 0000-1001 0001-1111 1001-1001 0111-1010 1100-0010 1110-0101 1000-1010 0011-0100 0001-1001 0100-0011 1111-1111 1110-0111 0001-0010 0100-1000 0100-1110 1001-0001 0110-1100 Name: Convert the following hexadecimal values to binary and decimal Write binary numbers as 0000-0000 Hexadecimal Binary Decimal 0xf1 0xac 0x56 0x6c 0x32 0x30 0x05 0x28 0xf0 0x07 0x42 0xb9 0x6d 0x2f 0x71 0x0e 0x2d 0xfb 0xba...
(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.
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
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
(6 marks- 3 marks each) The following hexadecimal values are shorthand for 16-bit two’s complement binary...
(6 marks- 3 marks each) The following hexadecimal values are shorthand for 16-bit two’s complement binary numbers. Working purely in hex, negate each and then state whether the result is positive or negative. (a) 5E91 (b) D00F 2.
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT