CMPE 401 - Computer Interfacing

Assignment #3

Due: In the CMPE 401 assignment box by 15:45 on Monday, Oct. 20, 2003


  1. Design an initialization routine in CPU32 assembly language that initializes the DUART as follows: Serial port A is to use a baud rate of 19200, and character frames with 8 data bits, even parity, and 2 stop bits. Serial port B is to use a baud rate of 38400, and character frames with 7 data bits, fixed low parity bit, and 1.5 stop bits. Interrupts are to be enabled for the receive direction of both serial ports, but not for the transmit direction. Thus, receiving a new character into either port A or port B's receiver is to trigger a hardware interrupt to the CPU. In your code be sure to use the predefined constants that were provided to you in laboratory exercise 2.

  2. Briefly describe the similarities and differences between routers, bridges and repeaters. In your answer make reference to the layers of the ISO OSI-RM model for data communications.

  3. Briefly explain the different roles played by the IP and TCP layers in the TCP/IP protocol stack.

  4. Error detection and correction actions can take place at different possible layers in the 7-layer ISO OSI-RM model. If the physical transmission medium is very reliable, would one wish to have the error detection and correction take place at a higher layer or a lower layer? Briefly justify your answer. Now consider the situation of a a physical transmission medium that is rather noisy and unreliable. At what layer would you now prefer to perform error detection and correction?

  5. Briefly explain why it might be preferable to use the UDP protocol instead of the TCP protocol for broadcasting audio and video information streams over the Internet.

  6. What were some of the major strategies and design techniques that were used by the designer of the "Lightweight IP" stack to make the software portable across different operating systems and hardware platforms. Which of this techniques were also used to make MicroC/OS-II portable across different processors?

  7. Design an CPU32 assembly language program that implements a circular queue. The data elements in the queue are to be word-sized (16 bits wide). Two byte-sized flags are to be used to keep track of whether the buffer is full or empty. Two word-sized indexes are to be used to keep track of the queue locations where next data word is to be inserted, and where the next data word is to be read. Use traps to access the queue. A TRAP #4 is called with no parameters to initialize the circular queue. A TRAP #5 is used to read the next word in the queue. It returns -1 in D7.B if the circular queue is empty. It returns the data item in D0.W and has D7.B set to 0 if the circular queue was not empty when the trap was called. A TRAP #6 is used to write the next word in the queue. The data word to be inserted is passed in D0.W. This trap returns 0 in D7.B if the word was inserted successfully; otherwise, -1 is returned in D7.B. In your solution, be sure to include code that reserves memory locations for all required data structures. Express the size of the queue as a symbolic constant value.