go good gators! luck! - university of florida

13
University of Florida EEL 4744Spring 2012 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM Page 1/13 Exam 1 , Last Name , First Name Instructions: Good luck! Go Gators! Turn off cell phones, beepers and other noise making devices. Show all work on the front of the test papers. If you need more room, make a clearly indicated note on the front of the page, "MORE ON BACK", and use the back. The back of the page will not be graded without an indication on the front. You may use any of your TI documents with limited added material; highlighting and tagging is permissible. You may not use any notes (mine or yours), examples, homework, labs, books, calculators, computer, electronic devices, etc. Put your name at the top of each test page and be sure your exam consists of 13 distinct pages. The space provided does not necessarily represent the amount of writing necessary. You must pledge and sign this page in order for a grade to be assigned. I n programs, the use of comments results in more partial credit. Read each question carefully and follow the instructions. The point values for problems may be changed at prof’s discretion. Part of your grade on tests, quizzes, labs, etc. is based not only on solving the problem you are presented with, but the manner in which you solve it. For example, there is a difference between two programs that meet the given specifications, but one is an elegant, extensible 20-line solution, while the other is an obfuscated 100-line program that also meets the specifications but would be difficult to extend later. Just as your future employer would value the latter program less than the first, so will I in grading your assignments. This exam counts for 20.67-24.33% of your total grade. Unless otherwise stated assume the following: The oscillator frequency is precisely 15 MHz. The code should run on a TMS320F28335 as configure on the UF F28335 Development Board without any additional peripherals. You may assume all the bit .SETs that you may need have already been done; use the standard I have used in class (e.g., BIT0 = 0000 0001b, BIT76 = 1100 0000b, INV7 = 0111 1111b, INV15_6 = 0111 1111 1011 1111b). PLEDGE: On my honor as a University of Florida student, I certify that I have neither given nor received any aid on this examination, nor I have seen anyone else do so. __________________________ _______________________ ________________ PRINT YOUR NAME SIGN YOUR NAME DATE (22 Feb 12) Regrade comments below. Give page # & problem # and reason for the petition. Pages Available Points 2 8 3-4 13 5-6 15 7-8 23 9-10 15 11 10 12-13 16 TOTAL 100 May the Schwartz be with you! Relax!

Upload: others

Post on 22-Apr-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 1/13 Exam 1

,

Last Name , First Name Instructions:

Good

luck!

Go

Gators!

Turn off cell phones, beepers and other noise making devices. Show all work on the front of the test papers. If you need more room, make a clearly indicated note on the front of the page,

"MORE ON BACK", and use the back. The back of the page will not be graded without an indication on the front.

You may use any of your TI documents with limited added material; highlighting and tagging is permissible. You may not

use any notes (mine or yours), examples, homework, labs, books, calculators, computer, electronic devices, etc.

Put your name at the top of each test page and be sure your exam consists of 13 distinct pages.

The space provided does not necessarily represent the amount of writing necessary.

You must pledge and sign this page in order for a grade to be assigned.

I n programs, the use of comments results in more partial credit.

Read each question carefully and follow the instructions.

The point values for problems may be changed at prof’s discretion.

Part of your grade on tests, quizzes, labs, etc. is based not only on solving the problem you are presented with, but the

manner in which you solve it. For example, there is a difference between two programs that meet the given specifications,

but one is an elegant, extensible 20-line solution, while the other is an obfuscated 100-line program that also meets the

specifications but would be difficult to extend later. Just as your future employer would value the latter program less than

the first, so will I in grading your assignments.

This exam counts for 20.67-24.33% of your total grade.

Unless otherwise stated assume the following:

The oscillator frequency is precisely 15 MHz.

The code should run on a TMS320F28335 as configure on the UF

F28335 Development Board without any additional peripherals.

You may assume all the bit .SETs that you may need have already been

done; use the standard I have used in class (e.g., BIT0 = 0000 0001b, BIT76 = 1100 0000b, INV7 = 0111 1111b,

INV15_6 = 0111 1111 1011 1111b).

PLEDGE:

On my honor as a University of Florida student, I certify that I have neither given

nor received any aid on this examination, nor I have seen anyone else do so.

__________________________ _______________________ ________________

PRINT YOUR NAME SIGN YOUR NAME DATE (22 Feb 12)

Regrade comments below. Give page # & problem # and reason for the petition.

Pages Available Points

2 8

3-4 13

5-6 15

7-8 23

9-10 15

11 10

12-13 16

TOTAL 100

May the Schwartz

be with you!

Relax!

Page 2: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 2/13 Exam 1

,

Last Name , First Name [8%] 1. Assume that you have a keypad circuit wired up as shown below.

(3%) a) If O2 is high and O1 and O0 are low, explain what happens if the 4 and 7 keys are pressed

at the same time. If this is a problem, explain a possible circuit design change correct the

problem.

(3%) b) If O2 is high and O1 and O0 are low, explain what happens if the 7 and 8 keys are pressed

at the same time. If this is a problem, explain a possible circuit design change correct the

problem.

(2%) c) Real switches bounce when they are activated or deactivated. Explain by drawing a

circuit or explaining an algorithm to deal with switch bouncing.

2 min

2 min

2 min

2 min

Page 3: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 3/13 Exam 1

,

Last Name , First Name [8%] 2. Write a program fragment (not an entire program) to set bit 4 in SRAM location FixIt (at

0xA025) if bit 4 of SRAM location CheckBits (at 0xA037) is 0 (i.e., clear); clear bit 2 at

FixIt if bit 2 at CheckBits is 1 (i.e., set). No other bits in either FixIt or CheckBits should

be changed. Use of assembler directives is strongly encouraged.

Labels Instructions Comments

8 min

Page 4: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 4/13 Exam 1

,

Last Name , First Name 2. (continued)

Labels Instructions Comments

[5%] 3. Show the proper component placement for a switch circuit that will provide 4 inputs for your

processor. Use a 4-switch DIP component and all the other necessary components on your

UF F28335 Development Board as you would with (only) the parts you were given in lab.

Show the required wiring for each of the switches. Label the processor input from your

switch circuits X0 through X3. Label the wires that are soldered, those that are wire-

wrapped, and those that are part of the printed circuit board (PCB). Use pull-down

resistors, if necessary.

5 min

Page 5: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 5/13 Exam 1

,

Last Name , First Name [15%] 4. Write a complete program to make GPIO25 an input, GPIO26 an output, and GPIO27 the

Enhanced Capture input/output 4 (ECAP4). Do NOT change the function of any of the other

GPIO and do NOT corrupt any GPIO outputs. Read GPIO25; if it is clear, complement the

value of GPIO26; otherwise do not change GPIO26. This function should repeat forever!

Labels Instructions Comments

12 min

Page 6: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 6/13 Exam 1

,

Last Name , First Name 4. (continued)

Labels Instructions Comments

Page 7: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 7/13 Exam 1

,

Last Name , First Name [23%] 5. Answer the following short questions.

(2%) a) What device (be specific) is needed to add an output port to a microprocessor? Why?

(4%) b) Addresses 0x10 0000 through 0x2F FFFF (and other address ranges) are available for

external interfacing on your F28335. Your F28335 has 22 address pins. Provide the

equation for addresses (ignore control signals) that can be used to place a single output

port at 0x10 0000 through 0x13 FFFF. How many images (also known as aliases) are

there for your output port? For full credit, provide a single number, not an expression.

(2%) c) What do the .lst files show that the .asm files do not show?

(2%) d) When a branch instruction (operation/mnemonic: B) condition is true, how does the

processor determine the correct destination?

(2%) e) On which register(s) does the CPU depend in order to make branching decisions?

1 min

4 min

2 min

2 min

1 min

Page 8: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 8/13 Exam 1

,

Last Name , First Name 5. (continued)

(2%) f) What is the difference between .set and .word? When and for what should each be used?

(2%) g) What is the difference between .word and .bss? When and for what should each be used?

(2%) h) Why does the DSP “forget” your program when power is removed?

(2%) i) What is the difference between an emulator and simulator?

(2%) j) What is an advantage and disadvantage of partial address decoding?

(1%) k) What system should be used to automatically reset the processor when it gets “lost” (i.e.,

“blue screen of death”).

2 min

1 min

2 min

1 min

1 min

2 min

Page 9: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 9/13 Exam 1

,

Last Name , First Name [12%] 6. In this problem you will write a complete program to copy the characters in a table at

0xA100 (InTable) until the null character (0x00) is reached to a table at 0xB200

(OutTable). Any upper case characters should be converted to lower case characters, but all

other characters should be copied unchanged. The ASCII codes of “A” is 0x41, “Z” is 0x5A,

“a” is 0x61, and “z” is 0x7A. A subroutine (NoScream) will do the required conversion.

Some of the key components of your program are described below.

( %) a) Write the assembler directives to put the input table at 0xA100 (InTable). Assume that

eventually this table may be placed at another location in FLASH. Be sure to put the

proper section instruction. Use the example input table data: In All KINDS OF

WEATHER. Be sure to terminate the table with a null character.

( %) b) Write the assembler directives to put the output table at 0xB200 (OutTable). Be sure to put

the proper section instruction.

( %) c) Complete the main routine and write a subroutine NoScream to do the required

conversion. The main routine should initialize all values as necessary and terminate

properly. (The next page is also available for your program.)

Labels Instructions Comments

2 min

2 min

2 min

10 min

Page 10: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 10/13 Exam 1

,

Last Name , First Name 6. (continued)

Labels Instructions Comments

Page 11: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 11/13 Exam 1

,

Last Name , First Name [10%] 7. Assume a F28335 subroutine named Sub_Exam1 is located at address 0x9ABC. Write

sample instruction(s) at address 0x9370 for appropriately executing a subroutine in the box

below (left). Write the stack pointer initialization instruction(s) in the box below (right).

Initialize the stack pointer at an appropriate location in internal F28335 SRAM.

Describe the stack on the F28335 as it relates to a subroutine.

For each of the below descriptions, draw the stack. In each case, show an arrow () at the

location of the stack pointer. On the far left, show (valid) addresses for each of the used

stack locations. Also provide the values requested at the bottom of these tables.

1) after the stack is initialized,

2) at the start of the subroutine

execution

3) after a push ACC instruction

(ACC=0x4237002D)

4) after a pop AR1 instruction

5) after the return from the subroutine

6) after a pop AR2 instruction

immediately following subroutine

execution instruction

10 min

Stack pointer initialization

Address Subroutine execute instruction

0x9370

Address

1-After

Init 2- Just after call

3-After push

ACC

4-After

pop AR1 5-After return

6-After pop

AR2

AR1 =

PC =

AR2 =

Page 12: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 12/13 Exam 1

,

Last Name , First Name [15%] 8. The UF4744 is a new microcontroller,

very much like the 68HC11, 68HC12,

Atmel microcontrollers and your DSP

discussed in class. Some relevant

differences are discussed here. The

same diagram timing diagram can be

used for both Read and Write cycles,

with the only difference being the

value of R/~W. The UF4744 has a

time-multiplexed address/data bus.

Reset (not shown) is active-low for

this device.

( ) a) Circle all the critical times on the

Read Cycle and Write Cycle

diagrams.

( ) b) The entire address range of

0x0000 through 0x7FFF is

available; the address range of 0x8000 through 0xFFFF is unavailable. Add a 4k x 8

SRAM starting at address 0, and an 8k x 8 ROM at addresses starting immediately

after the RAM. Fill in the blanks below to help you solve this problem. What equations

would you use to control what signals for the SRAM and ROM.

( ) c) Add an 8-bit input and an 8-bit output port. Use partial address decoding to add these

ports at address 0x4000 (with higher address images/aliases as necessary). Fill in the

blanks below to help you solve this problem. What equations would you use to control

what device(s) for an 8-bit input port and an 8-bit output port.

Equations:

SRAM:

ROM:

InPort:

OutPort:

4K SRAM Addr Range:

0x0000 - 0x = B - B

8K ROM Addr Range:

0x - 0x = B - B

InPort/OutPort Addr Range:

0x4000 - 0x = B - B

3 min

3 min

2 min

3 min

Page 13: Go Good Gators! luck! - University of Florida

University of Florida EEL 4744—Spring 2012 Dr. Eric M. Schwartz

Department of Electrical & Computer Engineering 22 February 2012 25-Jun-12 4:55 PM

Page 13/13 Exam 1

,

Last Name , First Name

D7-D0

8-bit

Flip-Flop

8Q7-Q0

8D7-D0

8-bit

Flip-Flop

8Q7-Q0

8

( %) 8. d) Complete the circuit diagram below in order to add the two ports and memory devices.

Please USE LABELS instead of wires! Please USE LABELS instead of wires!

D7-0

G

8-bit

Latch

8 Q7-0

8 D7-0

G

8-bit

Latch

8 Q7-0

8

11 min