ECEN 3213

Fall 2002

Exam 2

7 November 2002

 

Name______SOLUTION______

The questions in this exam refer to the 68HC11A8 single chip, unless otherwise noted in the question.  This is an OPEN Book Open notes exam.  Read the instructions carefully before completing the exam.  All answers must be shown on these pages – no attached pages will be graded. 

 

    

1. (4 Pts) Draw a State Diagram that:

-         has 4 states;

-         has 1 binary input value;

-         has 1 binary output value;

-         stays in the initial state while the input is 0;

-         returns to the initial state whenever the input is 0 two or more times in a row;

-         outputs a 0 whenever the previous inputs is the same as the current input values.  Outputs a 1 whenever the input is the opposite of the previous input value. 

 

 


 


The following True / False questions are worth 2 points each.  Circle T for True or F for False for your answer. 

   F       2. All digital computer systems have the CPU and some of the Memory on the same chip.

 

T          3. All digital computer systems have I/O.

 

T        4. The 6811 we use in this class (the single chip version) has all three blocks of a digital computer system on one chip.

 

T        5. A system using a 6811 could have extra memory added of the chip that has the CPU.

 

T        6. Extended addressing is required to access external memory in a 6811 system.

 

T        7. The stack pointer is a 16 bit register.

 

T        8. The stack pointer can point to ROM.

 

   F     9. The stack can be in either RAM or ROM but not both.

 

   F     10. Binary numbers are always greater in value than their decimal equivalents.

 

11.(21pts) Fill in the following table with hex values for the given values and operations.

 

Value A

Value B

Logical OR of Value A and Value B

Logical AND of Value A and Value B

Logical Exclusive-OR of Value A and Value B

$00

$97

$97

$00

$97

$FF

$97

$FF

$97

$68

$F0

$97

$F7

$90

$67

$0F

$97

$9F

$07

$98

$AA

$97

$BF

$82

$3D

$CC

$97

$DF

$84

$5B

$33

$97

$B7

$13

$A4


 

The following multiple-choice questions will be scored as 2 pts for each correct

    answer, -1 for an incorrect answer and 0 for unanswered questions.

  

12.  For a state diagram, how many edges enter each state for a diagram with 1 binary input? ___g___

     a. 0      b. 1       c. 2      d. 3       e. 4        f. 8        g. Can’t tell or varies

 

13.  How many bytes are available for a stack in a 6811A8 without external memory chips ?___g__

 a. 0      b. 1       c. 2      d. 3       e. 4        f. 8        g. 256

 

14.  If the stack is used only for storing subroutine return addresses, how deep can the subroutine nesting be for a 9 byte stack?___e__

 a. 0      b. 1       c. 2      d. 3       e. 4        f. 8        g. None of these choices

 

15.  For the same clock frequency, How much faster is a parallel 1 byte port than a 1 bit serial port with no start or stop bits?______f________

        a. 0      b. 1       c. 2      d. 3       e. 4        f. 8        g. None of these choices

16.  For the same clock frequency, How much faster is a parallel 1 byte port than a 1 bit serial port with 2 start bits and 1stop bits?_____c_________

        a. 0      b. 10       c. 11      d. 12       e. 4        f.8        g. None of these choices

 

17. What does it mean when the PC register has the value 35? __b___

a.       The next instruction to be fetched is in memory location 60735.

b.      Something is probably wrong because 35 addresses RAM and instructions are usually in ROM.

c.       This is a trick question because a 16-bit PC register cannot hold a value of less than 1024.


Consider the assembly program listing on the last two pages of this exam. 

 

18. (15pts) For each of the addressing modes: give an example instruction, its address from the assembly listing, and the location of the operand:

Addressing mode

Example instruction

Address of example instruction

Location of operand for example instruction

Inherent

inx

$E11A

x register

Immediate

lds #$f0

$E102

instruction EEPROM

Direct

staa oldpta

$E108

mem location $0005

Extended

ldab pte

$E117

$100A

Indexed

stab List, x

$E11B

mem loca 17 + [reg x]

 

 

19. (14 pts) Complete the following RAM memory Map for the Assembly listing on the last two pages. (There are more blanks than answers, put an XXX in unused spaces, which could help with question on memory usage).

RAM Memory Address

Name

Size (number of Bytes)

$00-$04

XXX

 5 unused bytes

$05

oldpta

1 byte

$06

count

2 bytes

$08-$19

XXX

17 unused bytes

$20

lastled

1 byte

$21 to $60

XXX

63 unused bytes

$61 to $80

List

  31 bytes for storing values

$81 to $E9

XXX

115 unused bytes(or 0 if stack is 112)

$f0 down to $EA

Stack

6 bytes (or 122 bytes available)

$f1 to $FF

XXX

 14 unused bytes

 

 

 

 

 

 

$FF

XXX

unused

 

Consider the program listing on the last two pages.  Answer the following memory usage questions.

 

20. (4pts)How many bytes of EPROM are used to store the program instructions?__       94 = $5E (accept 96=$60)_______

 

21. (4pts)How many bytes of the RAM are NOT used?_215 (or 99)_____________

 

22. (4pts)What is in EPROM location $E005?_____Don’t Know_________

 

23. (4pts) What is in EPROM location $EE00? ______Don’t Know ________

 

 

$1004         ptb equ $1004    ; Port B  output bits for LED indicators

$100A         pte equ $100A  ; Port E  input digits

$0005      oldpta equ $5 ;   place to store old value

$0061        List equ 97  

$0006       count equ $06 ; store the count of values

$0020     lastled equ $20  ;store last value for leds.

$E100             org      $E100

$E100 8600    [ 2](  0){pp     }start     ldaa  #$00

$E102 8E00F0  [ 3](  2){ppp    }    lds #$f0

$E105 BDE300  [ 6](  5){ppprss }    jsr subgreen

$E108 9705    [ 3]( 11){ppw    }    staa oldpta

$E10A 9706    [ 3]( 14){ppw    }    staa count

$E10C CE0000  [ 3]( 17){ppp    }    ldx #$00

$E10F BDE300  [ 6]( 20){ppprss }    jsr subgreen

$E112 8601    [ 2]( 26){pp     }begin  ldaa #$01

$E114 BDE300  [ 6]( 28){ppprss }    jsr subgreen

$E117 F6100A  [ 4]( 34){pppr   }reade ldab  pte  ;load value

$E11A 08      [ 3]( 38){pfn    }    inx

$E11B E761    [ 4]( 41){ppnw   }    stab List,x

$E11D DF06    [ 4]( 45){ppww   }    stx count

$E11F CF      [ 2]( 49){pf     }    stop

$E120 BDE410  [ 6]( 51){ppprss }    jsr subaddy

$E123 8C001F  [ 4]( 57){pppn   }    cpx #$1F

$E126 26EA    [ 3]( 61){pfn    }    bne begin    

$E128 BDE400  [ 6]( 64){ppprss }    jsr subzero

$E12B CF      [ 2]( 70){pf     }    stop

$E12C Þ20D2  [ 3]( 72){pfn    }    bra start

$E200                          org $E200

$E200 36      [ 3](  0){pfs    }subred psha

$E201 8601    [ 2](  3){pp     }    ldaa #$01

$E203 B71004  [ 4](  5){pppw   }    staa ptb

$E206 9720    [ 3](  9){ppw    }    sta lastled

$E208 32      [ 4]( 12){pfxu        pula

$E209 39      [ 5]( 16){pfxuu  }    rts

$E300                          org $E300

$E300 36      [ 3](  0){pfs    }subgreen psha     

$E301 8602    [ 2](  3){pp     }    ldaa #$02

$E303 B71004  [ 4](  5){pppw   }    staa ptb

$E306 9720    [ 3](  9){ppw    }    staa lastled

$E308 32      [ 4]( 12){pfxu   }    pula

$E309 39      [ 5]( 16){pfxuu  }    rts

$E400                          org  $E400

$E400 36      [ 3](  0){pfs    }subzero psha

$E401 BDE200  [ 6](  3){ppprss }    jsr subred

$E404 BDE300  [ 6](  9){ppprss }    jsr subgreen

$E407 8600    [ 2]( 15){pp     }    ldaa #$00

$E409 B71004  [ 4]( 17){pppw   }    staa ptb

$E40C 9720    [ 3]( 21){ppw    }    staa lastled

$E40E 32      [ 4]( 24){pfxu   }    pula

$E40F 39      [ 5]( 28){pfxuu  }    rts

$E410 36      [ 3]( 33){pfs    }subaddy psha

$E411 9620    [ 3]( 36){ppr    }    ldaa lastled

$E413 8A04    [ 2]( 39){pp     }    oraa #$04

$E415 B71004  [ 4]( 41){pppw   }    staa ptb

$E418 9720    [ 3]( 45){ppw    }    staa lastled

$E41A 32      [ 4]( 48){pfxu   }    pula

 

$E41B 39      [ 5]( 52){pfxuu  }    rts

$FFFE                          org $FFFE

$FFFE E100                     dc.w start

$0000                          end

***************Symbol Table*********************

List         $0061

begin        $E112

count        $0006

lastled      $0020

oldpta       $0005

ptb          $1004

pte          $100A

reade        $E117

start        $E100

subaddy      $E410

subgreen     $E300

subred       $E200

subzero      $E400

Assembly successful