Memory mapped does not require special instructions to do I/O, but you no longer have the entire memory available for storing data. Opposite in the case of I/O mapped. Also, it is much easier to do accidental I/O in the memory mapped case.
a. If programmed I/O is used and each 1-word I/O transfer requires the CPU to execute two instructions, estimate the maximum I/O data transfer rate possible through the I/O device.
Maximum using programmed I/O : 5% * 10^5 = 5000 instructions/second, so 2500 words/second
b. Estimate the maximum data transfer rate if DMA is used.
Maximum throughput using DMA is using all the cycles not doing instructions, which is 100,000 * ((.05 * 5) + (.95 * 2))
Virtual page Number Page Frame Number 0 1 1 0 2 3 3 - 4 - 5 2 6 0 7 -
a. What is the size of the virtual address space? (How many bits in a virtual address?)
13 bits
b. What is the size of the physical address space? (How many bits in a physical address?)
12 bits
c. What are the physical addresses corresponding to the following decimal virtual addresses (yes, you have to convert from decimal to binary): 0, 3728, 1023, 1024, 1025, 7800, 4096?
0 000 00 0000 0000 01 00 0000 0000 3728 011 10 1001 0000 Page Fault 1023 000 11 1111 1111 01 11 1111 1111 1024 001 00 0000 0000 00 00 0000 0000 1025 001 00 0000 0001 00 00 0000 0001 7800 111 10 0111 1000 Page Fault 4096 100 00 0000 0000 Page Fault
As the page size grows, more and more bits are used in the offset field, meaning the size of a page table can shrink. Also, there are cache size ramifications. However, as the page size grows, there is more and more fragmentation (since there are going to be more and more pages brought in that are not fully utilized). It also takes a longer amount of time to bring in a very large page, which can be bad if you are not using much data on that page.
a. What is the maximum size of each segment?
16K
b. What is the maximum logical address space for the task?
64K
c. Assume that an element in physical location 0x1ABC is accessed by this task. What is the format of the logical address that the task generates for it?
0x1ABC = 0001 1010 1011 1100 = 00 011 010 1011 1100 Seg # Page # Offset
a. What is the format of the processor's logical address?
5 bit Page number field, followed by 12 bit Offset field.
b. What is the length and width of the page table (ignoring any access control bits)?
Length is 32 entries, width is 8 bits
c. What is the effect on the page table if the physical memory space is reduced by half?
Width of page table entries becomes 7 bits.
------------------------------------------------------------------------------ Segment Table Entry Number Presence bit Page Table 0 0 0 1 1 1 ------------------------------------------------------------------------------ Page Table 0 Entry Number Presence bit Disk Address Physical Page Number 0 0 0x443BH096 0x0 1 1 0x08D22108 0x3 2 1 0xF0871A09 0x1 3 0 0x7BA54C21 0x2 ------------------------------------------------------------------------------ Page Table 1 Entry Number Presence bit Disk Address Physical Page Number 0 1 0x88B04136 0x2 1 0 0xEF444219 0x0 2 1 0x00222957 0x3 3 1 0x28756554 0x1 ------------------------------------------------------------------------------ Memory Address Contents 0x02A4 0x7230 0x03A4 0x86a9 0x04A4 0x9723 0x05A4 0x3423 0x06A4 0x8876 0x0FA4 0x2373 0x11A4 0x1346 0x17A4 0x6792 0x1EA4 0x5292 0x37A4 0x7974 0x3BA4 0x3205 0x67A4 0x6623
a. Assuming 512-byte pages, convert the virtual address 0xFA4 into a physical address.
0xFA4 = 1111 1010 0100, 512 byte pages means bottom 9 bits=offset. So segment table 1 is selected, look at page table 1, entry 3, find 0x1 - Physical address = 011 1010 0100
b. What is the value in memory stored at the physical address corresponding to the virtual address 0xFA4?
0x86a9
c. Repeat (a) and (b) for the virtual address 0x3A4.
0x3A4 = 0011 1010 0100, Physical addr = Unknown (Seg fault)
d. Repeat (a) and (b) for the virtual address 0xEA4.
0xEA4 = 1110 1010 0100, Physical addr = 011 1010 0100, 0x86a9
e. Repeat (a) and (b) for the virtual address 0xBA4.
0xBA4 = 1011 1010 0100, Physical addr = Unknown (Page fault) (Note there is a difference between Page Faults and Segment Faults)
f. What changes to this Virtual Memory structure would need to take place if the page size was increased to 1024 bytes?
Page size decreases to 1K bytes, the page tables would be half as large.