Homework 1 Solved

22C:122/55:132, Spring 2001

Douglas W. Jones
  1. What is your E-mail address?

  2. What class and section are you in? (22C:122 vs 55:132; U of I vs Collins)
    The solutions to the above depend on who you are.

  3. The Problem: Show a truth table for a full adder using ripple carry.
    	   A  B  Cin | Cout S 
    	 ------------+---------
    	   0  0  0   | 0    0 
    	   0  0  1   | 0    1 
    	   0  1  0   | 0    1 
    	   0  1  1   | 1    0 
    	   1  0  0   | 0    1 
    	   1  0  1   | 1    0 
    	   1  1  0   | 1    0 
    	   1  1  1   | 1    1 
    

  4. The Problem: Show how the expression A = B + 5 is evaluated in the assembly language of any computer.
    	; in the spirit of the PDP-11 and the M68000
    	  MOVE B,R1
    	  ADD  #5,R1
    	  MOVE R1,A
    
    	; in the spirit of classical single accumulator machines
    	  LDA  B
    	  ADDI 5
    	  STA  A
    

  5. The Problem: What is an interrupt service routine?
    An interrupt service routine is a block of code (akin to a procedure or function) that is called asynchronously to handle an event detected by the hardware. In this context, the word asynchronous means that the transfer of control is not caused by a call instruction in the program that is currently running, but is caused by something external to the instructions being executed at the time the control transfer is initiated.

    Interrupt service routines typically return to the code that was interrupted by way of a return instruction of some kind, typically a return from interrupt instruction. Interrupt service routines typically handle the interrupt by moving data or taking other actions that reset the condition that initiated the interrupt.