For converting larger values between decimal and

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and hexadecimal representations of bit patterns. A starting point is to be able to convert, in both directions, between a single hexadecimal digit and a four-bit binary pattern. This can always be done by referring to a chart such as that shown in Figure 2.1. When doing the conversion manually, one simple trick is to memorize the decimal equivalents of hex digits A, C, and F. The hex values B, D, and E can be translated to decimal by computing their values relative to the first three. Practice Problem 2.1: Fill in the missing entries in the following figure, giving the decimal, binary, and hexadecimal values of different byte patterns. Decimal 0 55 136 243 Binary 00000000 Hexadecimal 00 01010010 10101100 11100111 A7 3E BC Aside: Converting between decimal and hexadecimal. For converting larger values between decimal and hexadecimal, it is best to let a computer or calculator do the work. For example, the following script in the Perl language converts a list of numbers from decimal to hexadecimal: bin/d2h 1 2 3 4 5 #!/usr/local/bin/perl # Convert list of decimal numbers into hex...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online