That is for a machine with an bit word size the

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: for ($i = 0; $i < @ARGV; $i++) printf("%d = 0x%x\n", $ARGV[$i], $ARGV[$i]); bin/d2h Once this file has been set to be executable, the command: unix> ./d2h 100 500 751 will yield output: 2.1. INFORMATION STORAGE 100 = 0x64 500 = 0x1f4 751 = 0x2ef Similarly, the following script converts from hexadecimal to decimal: 25 bin/h2d 1 2 3 4 5 6 #!/usr/local/bin/perl # Convert list of decimal numbers into hex for ($i = 0; $i < @ARGV; $i++) $val = hex($ARGV[$i]); printf("0x%x = %d\n", $val, $val); bin/h2d End Aside. 2.1.2 Words Every computer has a word size, indicating the nominal size of integer and pointer data. Since a virtual address is encoded by such a word, the most important system parameter determined by the word size is the maximum size of the virtual address space. That is, for a machine with an Ò-bit word size, the virtual addresses can range from ¼ to ¾Ò ½, giving the program access to at most ¾Ò bytes. Most computers today have a 32-bit word size. This limits the virtual address space to 4 gigabytes (written...
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