CPRE 381: Digital Systems, Logic, Programming

Spring 2006

HW#8

Due Date: Monday, March 20

 

  1. We argued in the class that memory-mapped I/O is designed to account for all possible variations for device control that would have been impossible to handle as an instruction. In the end, though, all we showed was that some storage locations physically located at the device are assigned memory addresses. If that is all it takes to perform memory mapped I/O, why can't we just have a new instruction mmio memaddr, ... that takes an address in the memory (memaddr) where all the required control and data words are located, in addition to other arguments. Specifically, show how getchar() would be implemented with such an instruction or argue why it cannot be implemented.

  2. Develop the interface for a printer in more detail: assume a word wide data register and all associated control bits. Assume two error bits from the printer: OutOfPaper, PaperJam.  Assume a memory map and show it. Show the polled version print(w) along the lines of polled version of getchar().