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 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...
SUBJECT: CYBER ESSENTIALS Convert between binary and hexadecimal values Question 7: Convert binary number to a...
SUBJECT: CYBER ESSENTIALS Convert between binary and hexadecimal values Question 7: Convert binary number to a hexadecimal number Binary number: 00001100 Hexadecimal value: ?? Question 8: Convert binary number to a hexadecimal number Binary number: 01001111 Hexadecimal value: ?? Question 9: Convert binary number to a hexadecimal number Binary number: 10101101 Hexadecimal value: ?? Question 10: Convert hexadecimal number to an 8 bit binary number Hexadecimal number: AB 8 bit binary number: Question 11: Convert hexadecimal number to an 8...
Convert from hexadecimal to binary to decimal (PLEASE SHOW WORK) 1. B2 - binary: - decimal:...
Convert from hexadecimal to binary to decimal (PLEASE SHOW WORK) 1. B2 - binary: - decimal: 2. 37 - binary: - decimal: 3. 0A -binary: - decimal: 4. 11 - binary: - decimal:
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
Convert a list of decimal numbers into their binary and hexadecimal equivalents Add the elements of...
Convert a list of decimal numbers into their binary and hexadecimal equivalents Add the elements of each of these lists to generate a total sum Print the lists, and the total sum of each value C++ contains some built-in functions (such as itoa and std::hex) which make this assignment trivial. You may NOT use these in your programs. You code must perform the conversion through your own algorithm. The input values are: 5 9 24 2 39 83 60 8...
Convert from binary to decimal to hexadecimal (PLEASE SHOW ALL WORK) a. 1010 1011 - decimal:...
Convert from binary to decimal to hexadecimal (PLEASE SHOW ALL WORK) a. 1010 1011 - decimal: - hexadecimal b. 0011 0001 - decimal: - hexadecimal: c. 1110 0111 - decimal: - hexadecimal: d. 1111 1111 - decimal: - hexadecimal:
(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)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT