Getting Started with the TExaS Simulator



“But what’s it good for? ”

Engineer at the Advanced Computing Systems Division at IBM, commenting on the microchip 1968

 

Quiz 3 solutions

(5) Question 1. The measurement system range is 0 to 1999. How many decimal digits is it?

2000 alternatives is 3½ decimal digits

(5) Question 1. The measurement system range is 0 to 19999. How many decimal digits is it?

20000 alternatives is 4 ½ decimal digits

(5) Question 1. The measurement system range is 0 to 3999. How many decimal digits is it?

4000 alternatives is 3¾ decimal digits

(5) Question 1. The measurement system range is 0 to 39999. How many decimal digits is it?

40000 alternatives is 4¾ decimal digits

(5) Question 6. Write friendly assembly code that makes PORTT bit 6 an output.

bset DDRT,#$40

(5) Question 6. Write friendly assembly code that makes PORTT bit 6 high.

bset PORTT,#$40

(5) Question 6. Write friendly assembly code that makes PORTT bit 6 low.

bclr PORTT,#$40

(5) Question 6. Write friendly assembly code that makes PORTT bit 6 an input.

bclr DDRT,#$40

(5) Question 8. What is the effect of executing these two instructions?

pshd

pulx

Value of Reg D is copied to Reg X

(5) Question 9. A signed 16-bit binary fixed point number system has a resolution of Δ. What is the corresponding value of the number if the integer part stored in memory is 2000?

value = 2000*Δ

(5) Question 10. What is the effective address of this instruction?

$F000 EDE4 ldy A,X

Effective address is X+A

(5) Question 11. Which op code should be used in the ??? position? Unsigned.

[pic]bls

[pic]bhs

[pic]blo

[pic]bhi

(5) Question 12. Since 10 bits/frame and 1 frame/byte, bandwidth=baud rate/10

(5) Question 13. Which answer is the data flow graph for the following program? The main program calls InChar.

RDRF equ $20

InChar brclr SC0SR1,#RDRF,*

ldaa SC0DRL read ASCII character

rts

[pic]

(5) Question 14. Consider a matrix with 4 rows and 7 columns, stored in column-major zero-index format. Each element is 1 byte or 8 bits. Which equation correctly calculates the address of the element at row I and column J?

C. base+I+4*J

(5) Question 14. Consider a matrix with 4 rows and 7 columns, stored in row-major zero-index format. Each element is 1 byte or 8 bits. Which equation correctly calculates the address of the element at row I and column J?

D. base+7*I+J

(5) Question 14. Consider a matrix with 7 rows and 4 columns, stored in row-major zero-index format. Each element is 1 byte or 8 bits. Which equation correctly calculates the address of the element at row I and column J?

B. base+4*I+J

(5) Question 14. Consider a matrix with 7 rows and 4 columns, stored in column-major zero-index format. Each element is 1 byte or 8 bits. Which equation correctly calculates the address of the element at row I and column J?

E. base+I+7*J

(5) Question 15. What digital result occurs when the 6812 ADC converts?

Dout = Dmin + (Dmax-Dmin)(Vin-Vmin)/(Vmax-Vmin)

Dout = 255*Vin/5

(5) Question 16. Give the general equation showing LED current Id as a function of LED voltage Vd, gate output voltage VOL, and resistance R1.

Id = (5 -Vd - VOL)/R1

(5) Question 17. Which registers are pushed by swi and pulled off by rti?

all registers but the SP

(5) Question 18. Five interpreters were presented in Tutorial 10. Assuming each interpreter was modified to accept 26 commands, labeled A-Z, which technique will have the fastest lookup speed?

array containing list of functions to execute

(10) Question 19. Consider the following linked list FSM

PORTA equ 0

DDRA equ 2

org $0800

pt rmb 2

org $F000

SA fcb 10 output

fdb SB next state

SB fcb 25 output

fdb SA next state

main movw #SA,pt

loop ldx pt

movb 0,x,PORTA

ldx 1,x

stx pt

bra loop

org $FFFE

fdb main

Trap or software interrupt

Why

• allow binding of user/OS software

• introduction to hardware interrupts

How:

• OS software is trap handler

• User program calls OS program executing trap #num

• any number $30-$39 or $40-$FF

• trap vector is $FFF8, swi vector is $FFF6

|* OS software |*User software |

|In equ $30 |In equ $30 |

|Out equ $31 |Out equ $31 |

|org xxxx | |

|Traphan |org yyyy |

|ldx 7,s |main lds #$0C00 |

|ldab -1,x trap num |ldaa #13 |

|cmpb #In |trap #Out |

|bne notIC |loop trap #In |

|brclr SC0SR1,#$20,* |trap #Out |

|ldaa SC0DRL input |bra loop |

|staa 2,s | |

|bra done |org $FFFE |

|notIC cmpb #Out |fdb main |

|bne done | |

|brclr SC0SR1,#$80,* | |

|staa SC0DRL output | |

|done rti | |

|org $FFF8 | |

|fdb Traphan | |

before trap #$31 after trap #$31

| | |0BF5 | | |0BF5 |

| | |0BF6 | | |0BF6 |

| | |0BF7 |SP → |oldCC |0BF7 |

| | |0BF8 | |oldB |0BF8 |

| | |0BF9 | |oldA |0BF9 |

| | |0BFA | |oldX high |0BFA |

| | |0BFB | |oldX low |0BFB |

| | |0BFC | |oldY high |0BFC |

| | |0BFD | |oldY low |0BFD |

| | |0BFE |SP+7→ |oldPC high |0BFE |

| | |0BFF | |oldPC low |0BFF |

|SP → | |0C00 | | |0C00 |

 

Quiz3 will be similar in style to the online Homework

Quiz3 will cover material from Chapters 1,2,3,4,5,6,7,8,10.

Good things to study are

    the Homework questions and solutions

    the lecture notes aLec1 to aLec32

It will be closed book with about 25 short answer questions

I will give you similar technical documents as I did with Quiz1

The numerical questions will be simple enough not to require a calculator.

Quiz 3 review

Number conversions, 8-bit (fill in the blank)

convert one format to another without a calculator

signed decimal e.g., -56

unsigned decimal e.g., 200

binary e.g., %11001000

hexadecimal e.g., $C8

volatile, nonvolatile

static efficiency, dynamic efficiency

structured program, flowchart, call graph, data flow graph

basis, precision,

fixed-point,

given resolution convert between value and integer

value = integer*Δ

given precision and range choose the fixed-point format

promotion, demotion

setting N, Z, V, C after 8-bit add or subtract

overflow, ceiling and floor, drop out,

bus, address bus, data bus,

bus cycle, read cycle, write cycle,

simplified cycle by cycle execution

assembly listing to execution cycles (Lab 3.1)

machine code to execution cycles (Lab 3.4)

IR, EAR, BIU, CU, ALU, registers,

device driver,

friendly,

ldaa DDRD

oraa #$80

staa DDRD

bset DDRD,#$80

mask, toggle,

ldaa PORTD

eora #$80

staa PORTD

8-bit versus 16-bit data

reset vector

pass 1, pass 2, symbol table

direction register

baud rate, bandwidth, frame, start bit, stop bit, parity

busy-waiting, gadfly, or polling

flow chart, call graph, data flow graph

device driver

ADC 0 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download