A write the binary representations of these two

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: oth encode the numeric value 12,345, they have very different byte patterns: 0x00003039 for the integer, and 0x4640E400 for floating point. In general, these two formats use different encoding schemes. If we expand these hexadecimal patterns into binary and shift them appropriately, we find a sequence of 13 matching bits, indicated below by a sequence of asterisks: 0 0 0 0 3 0 3 9 00000000000000000011000000111001 ************* 4 6 4 0 E 4 0 0 01000110010000001110010000000000 This is not coincidental. We will return to this example when we study floating-point formats. Practice Problem 2.2: Consider the following 3 calls to show_bytes: int val = 0x12345678; byte_pointer valp = (byte_pointer) &val; show_bytes(valp, 1); /* A. */ show_bytes(valp, 2); /* B. */ show_bytes(valp, 3); /* C. */ Indicate below the values that would be printed by each call on a little-endian machine and on a bigendian machine. A. Little endian: B. Little endian: C. Little endian: Big endian: Big endian: Big endian: Practice Prob...
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