{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ex1_f10_sol - EEL 4744C — Dr Gugel LAST NAME FIRST NAME...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EEL 4744C — Dr. Gugel LAST NAME FIRST NAME K5 1 Fall 2010 Exam #1 UF |D# - Open book and open notes, 100-minute examination to be done in pencil. - No electronic devices are permitted. - All work and solutions are to be written on the exam where appropriate. Point System (for instructor and TA use only) Page 2 18 points H; m P Page 3 14 points H ' 5C“ Page 4 17 points l7 ”5 Page 5 16 points [(0 gm Page 6 22 points 21 ' I CV3 Page 7 14 points M TOTAL out of 101 REGRADES ARE DUE BACK BY 4PM THE DAY THE TEST IS HANDED BACK. (317 Benton Hall) Grade Review information: (NOTE: deadline of request for grade review is the day the exam is returned.) M: Lu 1. Given the following switches and LEDs attached to the DSP GPiO signals below, answer the following questions. GPIO‘31 1K ohm GPIO_3 0 m ... 1 K ohm @1029 r ' —— +3.3V , m+33v +3.3V 330 ohm ”3,93 GPIO‘“28 H M “....w w. V v ............,_ .,..‘.. I 14463 +3.3V +3.3V GPICLE‘? GPIOHZE rn...H.». t t 1,..nw ....u..l.,.u..t.uw , " w+3.3V GPiOmZS 1K ohm 6131034- ” ~——-+3.3V 1K ohm Write the code to initialize the inputs and outputs as required by the above circuitry. Do not modify MUX and DIR values for GPIOZ3:O; they are being used for other functions. You may use the .set values shown below. (6 pt.) GPAMUX1.set 0x6F86 GPAMUXZ .set 0x6F88 mov Aim #Qmm‘mx 2 H m0 AL! JIWXO Mox/ *fiéo flL —,L—____ mov Amt) . fiéPfiDlQ-l’l +— IMV AV. 9% I‘ll/£0 + GPADlR .set OX6F8A GPACTRL .set 0x6F80 ND AI. #OXBCH: —/__— - 0K Ar.) atox 35,00 mox/ 916/9160 2 AL. Write the code to echo the switch values to the LEDs. When a switch' [5 closed (3 3V) the corresponding LED should also be turned on. i.e. lfW S4_= 83: closed and 82: 81 = open then L=ED4 LED3= on and LEDZ= LED1- — off. (12 pt.) Mot/ finer) #Qflabflnl %% MW AL Mao a NM’ AL mov AH Mil/0:0 ____fil_— NOT AH [512 ALflc‘Z fl/VD flLZfi’OXBOUa LSL ml 41:; AND 9H, fiox 06.00 02a 5);; Ad , Page 2 mov 79220 L. Page Score = 1‘5 . - (was he; 2. in the previous problem, assume we have 4 pin DlPs for the switches & LEDs. Also assume the 330 & 1K RPACKs are 5 pin SlPs. Show where the four components should be placed on your board via the diagram below. Label all signals. Le. +3.3V, GND, GPlO31:24 Assume a header will be used to connect to the GPIO signals. (4 pt.) $37.4 r0 GP"? Cpfiblb 3. A vector contains (512) 16~Bit Unsigned Numbers. Write code to 03mpute the average value for the vector. Use the variables listed below in your solution. The best solution will receive the highest points. You are not allowed to use any ; - 32 bit MOV or 32 bit ADD instructions. Use ARO as a pointer to the data and AR1 as a counter. (10 pt.) LEN .word 512 ;vector length VEC_START_ADDR .word OxABOO ;vector starting address FINAL_ANS .word 0x0 ;where your final answer should go m o 110M000>pé '7 m ggu gnu @ LEN ~ may (Elm) 4K0 ® UEQHSTAR'I: ADDR , Nov AL #0 Nov AH #0 .6 TOP (LL. RC (1, I ADD 4L *ARO ‘41.: (Wu “mg 5% ' i {3 SK l P No; 1 Ink. A-l-l ‘ up?” mg sum' \ gin? Int, lino ‘ rm. p-l-r ./ Mm“ _________________________ __L___’E9_L_L0_E—_Q___ ______,________,___ (.5 {.5ng ace-.17 a? I Nov E9 Fri/ML. 4105. AL Page 3 Page Score = 1L, (we I KEj 4. In problem #3 where we compute the average value, what can be done to improve the rounding accuracy? is If the final average result is 132.7, then the resultant integer portion should be 133 instead of 132. in other words, how do you round up the result by one if the fractional portion of the aver ge is 0.5 or greater? (2 pt.) ' «H‘s ol‘r‘drtge I} 5);) LCkahl‘ck fr Halal 2% 1L6 trauma 5. Design the hardware required to create a Single Bit IIO port that exists in the memory range 0x38000-0x39FFF. Assume that hardware will be placed in our CPLD and that we are using our DSP that has 20 Address lines, 16 data bits, a low true Data Strobe and Rl—W control signai. Label all signals and show all :70 and decode hardware. (7 pt.) OOH lOOXJVXXXbCXXX‘pO‘EX ggooofigqFfl: M 9.95 fi/K A”? file all" #3 MFD¢ ,m /N 99 6. Assuming again that we are using our DSP, create a block of SRAM from OxDOOGO-OXDTFFF using only 16K x 16 SRAMs. Assume Full Addr Decoding. Label all signals and show a" memory and decode hardware. (8 pt.) I? [nor DOSE Emaé’ooélém' 0—— ”)rrr MB: 32.14 m 22>; “[1 III. - ”0' “Lil—«"4 53mm er? . [46") 7. In problem #6, if A17 & A16 are not included in the decode circuitry, what are the new images that result from this * below. (3 pt.) 8. Given the following keypad and connections below, what patterns must be sent out to scan the keys in the keypad? _GPIO43210 5x3 Hex KEYPAD PatternsinHex #LLLL. NJLLL. 1—1. HLL. LLLHLL Mug {5pm Write the code to send out the proper pattern to check if the A key has been pressed. If the key has been pressed write OxA to DXBOOO and stop. if no key is pressed. send out the next pattern for scanning and stop. Ignore Switch Bounce. (8 Pt.) " . Ou ‘Mlo #GPADAT ’ ('1le AL #02:! 1 mm veil-ROE gt. ‘ W “ 4ND AH #Ox E0 ‘E (MP 414 Fats/0 £3 ‘ SKIP. EEQ "" MOO #0x/0 Page 5 Page Score = 19 \m \ 9. For the next several questions, consult the asm and list file shown on the last page of this exam. \k-E I 9.1 What lines in the assembly file modify memory at load time? _____ 6” (2’) [Li A. 2% (2 pt.) 7930 ’73) @7’8‘2) 783 9 2 What memory addresses Will be modified at run time? 2 ) (2 pt ) 9.3 What is the value of the opcode for the Long Call instruction? 00 go (1 pt.) 9.4 What is the value of the operand (at toad time) for the Long Catt instruction? 900 8 (1 pt.) 9.5 What is the effective address for the first POP instruction executed in SUB1? 7 Y a (1 pt.) 9.6 Show the address and contents of modified stack memory when the infinite branch is executing: (4 pt.) NozAu hOXOOh benlcdinmeo xA eA I iminfiiiinoth ielo. Stack Memory Modified at Run-time Ad res gate at 7 ‘6 O @000 7 5/ 2: 9 0" 9’ 9.7 What is the efl'ective address for the very firsfistruction in the main program? 9 J (1 pt.) 9.8 What is the value of the stack pointer right after the Long Call has been executed? 7 g 3 x‘ (2 pt.) 9.9 What is the value of the stack pointer right star the Long Return has been executed? 7312’ (2 pt.) 9.10 What is the purpose of the subroutine? (2 pt.) {3/441 6% sigma? ”smear €15 9%wa {3 329:7"; 9.11 What can be done to increase the efficiency of the subroutine? i.e. make it fasterlshorter (2 pt.) jug” Mg AL +0 pm; AL fair-L 7‘0 flé sabmfule 9.12 if the “B L1 ,LT” instruction is changed to “B SUB1,LT", what is the new expected machine code value for the instruction? (2 pt.) so 517’ in: H3”) (HQ/2 + 7 f/ “I 923013 Page 6 Page Score = 12 KEV M. We would like to examine the run time function of the following two instructions found in the SUBt subroutine. MOV AH, #DXO :line19 (1 cycles to execute) )5 new ””35 PUSH AL June 29 (2 cycles to execute) lHLlsve. +030 I 1M2; Fill in the cycle table below when these two instructions are executed in SUBl (8 pt): Cycle# RI-W Addr Bus Value Data Bus Value Dev Driving Addr Bus Dev Drivin Data Bus 1 l " ' 5301‘? (7‘5 60 PC [107’ fflfim 2 l (r’é H 2’21??? WC /N7’ 9&1”! 3 ~ @ " mo W 5” ma MW?) i it pm wow" ‘L in?) (11-5 9‘5 l 5 11. We would like to implement an instruction like DSP’s instruction “POP ACC" in the G- CPU. The new opcode should be 0x32 which wouid follow the INY instruction In the (3- CPU ASM diagram. Describe what new hardware is needed and Wherethe/I/zfldwg mgyjp'aced (2/5271?) 7‘0 flit/r MW K will-.11 he f 48:33th Now draw the cycles for executing this instruction in a manner similar to that found in the G-CPU Controller ASM Chart. In other words, draw all the states for this instruction in an ASM format and give as much information as possible as to what is going on in each state. i. e. lnc PC fetching operand REGGlE' s driving the school bus Johnny doesn' t know how to RI—W etc. (4 pt) 4’09 us at ' //R LD chOO'O CW”) U» J Page 7 ' Page Score = 1"], .global _C_int00 :ASSEMBLY CODE TOP_STACK .set 0x780 DATA_ADDR .set 0xA000 ;ASSUME DATA at OxAOOO = 0x8000 .text _q_int00: MOV SP,#TOP_STACK MOV ARO,#DATA_ADDR MOV AL,*ARO PUSH AL LC SUBl POP ACC _ NOP :extra program code that uses ;ACC's'resu1t could be placed ;here ENDl: B ENDl,UNC SUBI: POP AR7 POP ARE POP AL CMP AL,#0X0 B L1,LT MOV AH,#0x0 PUSH AL PUSH AH B END__SUB,UNC L1: MOV AH,#0XFFFF PUSH AL PUSH AH END_SUB: PUSH AR6 PUSH ART LRET 1 .global _c_int00 ;LIST FILE STARTS HERE 2 0780 TOP_STACK .set 0x780 3 A000 DATA_ADDR .set 0xA000 4 00000000 .text 5 00000000 2BAD _c_int00: MOV SP,#TOP_STACK 00000001 0780 7 6 00000002 28A0 MOV ARO,#DATA_ADDR 00000003 A000 7 00000004 92C0 MOV AL,*ARO 8 00000005 22A9 PUSH AL 9 00000006 0080' LC SUBi 00000007 000B 10 00000008 06BE POP ACC 11 00000009 7700 NOP ' 12 0000000a 6F00 ENDl: B END1,UNC 13 14 0000000b 2AA7 SUBl: POP . AR7 15 0000000c 2AA6 POP AR6 16 0000000d 2AA9 POP AL 17 0000000e 5200 CMP AL,#0x0 18 0000000f 6405 B' L1,LT 19 00000010 9B00 MOV AH,#0X0 20 00000011 22A9 PUSH AL 21 00000012 22A8 PUSH AH 22 00000013 6F05 B ‘ END_SUB,UNC 23 00000014 28A8 Ll: MOV AH,#0XFEFF 00000015 FFFF 24 00000016 22A9 PUSH AL 25 00000017 22A8 PUSH AH 26 00000018 22A6 END_SUB: PUSH AR6 27 00000019 22A7 PUSH AR7 28 0000001a 7614 LRET No Assembly Errors, No Assembly Warnings ...
View Full Document

{[ snackBarMessage ]}