CMPE 401 - Computer Interfacing

Assignment #1

Due: In the CMPE 401 assignment box at 15:45 on Friday, Oct. 3, 2008


  1. Briefly explain the difference between synchronous and asynchronous interfaces. What are the advantages and disadvantages of asynchronous compared to synchronous interfaces?

  2. Briefly explain what is meant the term "memory-mapped input/output"? What would be an alternative to memory-mapped I/O? What are the main advantages of memory-mapped I/O compared to the alternatives?

  3. The two program counter addressing modes, described on slide 2-41 of the lecture notes, can be used to specify the location of source operands, but not destination operands. This is different from the situation for the otherwise similar address register indirect addressing modes, which can be used for both source and destination operands. Why do you suppose this restriction was placed on the program counter addressing modes?

  4. Consult the Coldfire Family Programmer's Reference Manual by clicking on CFPRM.pdf in the on-line version of this handout, and then determine what the MOVEM.L instruction does. In particular, explain what the following two instructions do:
             MOVEM.L  A0-A5/D7,-(SP)
             MOVEM.L  (SP)+,A7/D0-D5
    

  5. Design a subrountine in ColdFire assembly language, to be called RD_STA_FIELDS, that reads a memory-mapped longword register at symbolic address STAT_REG and then extracts three bit fields as follows. The first field contains the 3 most significant bits in the register (i.e. bits #31-29) concatenated with the 5 least significant bits of the register (bits #4-0). The second field contains the eight bits at positions #28-21. The third field contains the 16 bits at positions #20-5, but with the bits arranged in the reverse order. The first, second and third fields are to be returned in D0.B, D1.B and A2.W, respectively. The contents of no other CPU registers are to be disturbed after the execution of the subroutine.

  6. There are various possible ways of implementing multitasking, where the available execution time on the CPU is shared using some mechanism or rule. Briefly describe round robin time slicing, pre-emptive multitasking, and co-operative multitasking. Bue sure to highlight the likely strengths and weaknesses of these three multitasking schemes. Which scheme would be most appropriate for handling hard real time constraints? Carefully justify your answer.

  7. MicroC/OS requires the private stack data structures for tasks to be 4-byte aligned. Given the properties of the ColdFire microprocessor, why do you suppose that this storage constraint would be required?

  8. MicroC/OS provides two simple ways of disabling task interleaving to protect critical sections: (a) USER_ENTER_CRITICAL and USER_EXIT_CRITICAL, and (b)OSLock and OSUnlock. What would be advantages and disadvantages of these two ways compared with each other, and then compared with using a binary semaphore.