1. A virtual address of 335CDD3C (hex) appears in a program that is being run on a computer that does demand paging. The computer has 24-bit physical addresses, 32-bit virtual addresses, and a 2048-word page-size. The (hex) frame number for the address is 3456. A) How many physical frames are there? B) How many virtual pages are there? C) In hexadecimal notation, what is the offset of the virtual address? ANSWER: A) 2048 == 2^11. 24-bit physical address has 11 bits for offset, so 24-11==13 bits are for frame numbers. Therefore : 2^13 == 8K of frames B) 32-11==21 ==> 2^21 == 2Meg of virtual pages C) The last three hex digits of the virtual address are D3C. This represent the last 12 bits of the virtual address. Expanding the D we get 1101 3 C. Therefore the offset, which is the last 11 bits of the address, is 101 3 C, which is 53C in hex. ======================================= 2. Refer to the previous problem. A) In hexadecimal notation, what is the page number of the virtual address? B) In hexadecimal notation, what is the physical address corresponding to the virtual address? ANSWER: A) The page number is the first 21 bits of the virtual address, it corresponds to 335CD 1, where the '1' is a single bit (the one that was unused when we calculated the offset above). Expanding all the hex digits we see the page number is: 3 3 5 C D 1 0011 0011 0101 1100 1101 1 in binary. We can get the page number in hex by making groups of 4 bits starting with the least significant bit: 6 6 B 9 B 0 0110 0110 1011 1001 1011 B) The physical address is the bit pattern formed by adjoining the offset to the frame number. The frame number is the 13-bit sequence represented by 3456 (hex): 0 0011 0100 0101 0110 The offset is the eleven-bit sequence expressed as 53C in hex: 101 0011 1100 Therefore the bits of the physical address are: 0 0011 0100 0101 0110 101 0011 1100 Regrouping this we get: 0001 1010 0010 1011 0101 0011 1100 1 A 2 B 5 3 C