Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Appendix C - Review Questions - Page 539: 2

Answer

1000011001 as hexadecimal: 219 1000011001 as decimal: 537 100000000 as hexadecimal: 100 100000000 as decimal: 256 100111 as hexadecimal: 27 100111 as decimal: 39

Work Step by Step

Binary to Hexadecimal Conversion: Group the binary digits into sets of four, starting from the right. If the leftmost group has fewer than four digits, pad it with leading zeros. Convert each group of four binary digits to its equivalent hexadecimal digit. Combine the hexadecimal digits obtained from each group to get the final hexadecimal representation. Hexadecimal to Decimal Conversion: Assign decimal values to each hexadecimal digit. Starting from the rightmost digit, assign positional values based on powers of 16. The rightmost digit has a positional value of 16^0 (1). The next digit to the left has a positional value of 16^1 (16). The next digit to the left has a positional value of 16^2 (256). Continue this pattern for each digit. Multiply each digit by its positional value and sum up the results.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.