previous
 next 
CS 3843 Computer Organization
Notes on Chapter 4: Section 4.3
Trace Register-Memory Move

Section 4.3: Sequential Y86 Implementation - Tracing an Register-Memory Move Instruction

Assumptions:

  1. Instruction Memory is combinational logic.
    1. We assume it has the following instructions stored starting at location 0:
      irmovl $11, %eax
      irmovl $7, %ecx
      rmmovl %eax, 8(%ecx)
      

    2. In binary the instuction memory contains (all values in hex)
      AddressContentsComments
      0030irmovl
      01F0rB=%eax
      020B11=0x0B (little endian)
      0300second byte of 11 is 0 (little endian)
      0400third byte of 11 is 0 (little endian)
      0500fourth byte of 11 is 0 (little endian)
      0630irmovl
      07F1rB=%ecx=1
      08077=0x07 (little endian)
      0900second byte of 7 is 0 (little endian)
      0A00third byte of 7 is 0 (little endian)
      0B00fourth byte of 7 is 0 (little endian)
      0C40rmmovl
      0D01rA=%eax=0, rB=%ecx=1
      0E088=0x08 (little endian)
      0F00second byte of 8 is 0 (little endian)
      1000thrid byte of 8 is 0 (little endian)
      1100fourth byte of 8 is 0 (little endian)
  2. The register file acts like combinational logic when reading values.
  3. Each block of combinational logic has a fixed propgation delay of .1 (in some units)
  4. We start our trace with the rmmovl instruction, so we have:
    PC = 0C
    %eax = 0B
    %ecx = 07
Trace:
We will need the figures that are available here.
  1. In Figure 4.27, coming out of the PC is 0C.
    1. Byte 0 = 40, Byte 1 = 01, Byte 2 = 08, Bytes 3-5 are 0
    2. icode = 4, ifun = 0
    3. Need regids = 1, Need valC = 1
    4. valP = 12 = 0x0C + 6
    5. rA = 0, rB = 1
    6. valC = 00000008
    7. Instr valid = 1
  2. Transfer these results to Figure 4.23 and 4.28
  3. In Figure 4.28:
    1. have rA=0, rB=1, icode=4
    2. srcA=rA= 0, srcB=rB=1
    3. valA = 0B, valB = 07
  4. Transfer these values to Figures 4.23 and 4.29
  5. In Figure 4.29
    1. valC = 00000008, valB = 07, icode=4, ifun=0
    2. ALUfun = 0 (0=add, 1=sub, 2=and, 3=xor)
    3. ALU-A output = valC = 00000008, ALU-B output = valB = 07
    4. SetCC output is 0
    5. valE = 0F (0x08 + 0x07 = 11 + 7 = 15 = 0x0F)
  6. Transfer these values to Figures 4.23 and 4.30
  7. In Figure 4.23, New PC output is valP = 12
  8. In Figure 4.30, icode=4, valE = 0F, valA=0B.
    Since icode=4, Mem addr out is valE, and data in is valA, Mem read is 0, and Mem write is 1.
    On the next clock cycle, valA=0B will be stored in addres valE=0F.
  9. Also on the next clock cycle, newPC=12 will be stored in the PC