ex1_sol_f11 - , EEL 4744C — Dr. Gugel LAST NAME FIRST...

Info iconThis preview shows pages 1–10. 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 DocumentRight 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 DocumentRight 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 DocumentRight 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 DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

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

View Full DocumentRight Arrow Icon
Background image of page 10
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 é FWWZO“ gap 1 WV! w : www Exam #1 UF |D# r.’ - Open book and open notes, 90-minute examination to be done in pencil. - No electronic devices are permitted. 0 All work and solutions are to be written on the exam where appropriate. Point System (for instructor and TA use only) Page 2 14 points j/Lu‘l N Page 3 23 points QY‘KO Page 4 20 points C5 1 “p Page 5 26 points / Page 6 18 points A TOTAL out of 101 Grade Review information: (NOTE: deadline of request for grade review is the day the exam is returned.) [4E ‘fl 1. A student would like to use a microprocessor with the following characteristics: I. A 16 bit Address Bus, a 16 bit Data Bus and Control Signals Rl-W & -Data_Strobe (-08). ll. Upon reset, the processor loads the PC with address 0x2000 to begin fetching the first instruction. Given the following devices (and as many as you need of each) 32Kx8 EPROMs, 8Kx8 SRAMs, 74HC2735, 74HC244s and any combinatorial logic you need, show the required circuitry (both decode circuit & memory) to place 4Kx16 of EPROM at the appropriate place in the memory map. Label all signals and assume full address decoding. (7 pt.) 32K :9 2/5 9k cpl” 3M6}? 2. Next, show the decode circuit and memory required to place 8Kx16 SRAM starting at Ox5000. Label all signals and assume full address decoding. (7 pt.) Page Score = M59 3. Finally, show the decode circuit and devices required to create an input/output port at OX8 00 assuming 512 continuous images. Label all signals. (9 pt.) 572:; 26} A 530 “0% “Se 4. What is the address range that corresponds to the 512 I/O port images? 5. A student has wired up 8 low true switches and 8 low true LEDs on their board as shown below: Switches 88:5 (most significant nibble) => Inputs GPl027224 , Switches 84:1 (least significant nibble) => Inputs GP|0320 LEDs L811 (where L8 is the MSB) => Outputs GP|O1528 Write the DSP assembly code to continuously echo out the switches to the LEDs. Assume the GPlO direction and mux registers have already been initialized. Also, when you write to the LEDs do not modify any unused l/O such as GPIO31:28, GPl023z16 and GPIO7:4. (12 pt.) GPADAT .set 0x6FCO lQJQ #111414 [comb/IN /[1/: MW AKOMMHMT l'gt’vfid/fivmg / mov xA/zozfiL,‘ou7M mov fuell iffy/740971! 5 fl) [LA/(L ' Mm/ I‘ll/MAM ; gd‘ 5835 l ASL flL! 4/ I‘ {more ZLatLoEm'LMe l/qNb flLlfibxFFF Z'mask / Mow fl/7’ 2614,20 ' 5%] I 45L gm? Mm £0 zwzigliesfitlk / g/ub All2 fioxofioo ,‘msld IMM€€VJ7Lfl U} 3V6 7‘71 of HL, 'Wamk Page 3 —1\ (f3 Pll‘. I“: Page Score = {c'é 6. For the following code, show the values of the flags and registers after the comp re and add instructions. a CCCCI/scCC/S’ comfl péggq ’7Dif/ MOV AL, #OXCCCC MOV AH, #0x4ABC , t/flgc O _./// I l j CMP AL,AH ;after this instruction executes show the contents of Z, C, V and N below. (3 pt.) CCCO I O I o c=__ v=— ~=_._ m I 7 3 g Oib’ I l 0. 5 ADD AL, AH ;after this instruction executes show the contents of AL, C, V and N below. (5 pt.) 8 2 / l I 7. Write an assembly subroutine to sum N 16 bit signed numbers for a given signed vector. N will be passed to the routine via AL and the starting address will be passed via AH. i.e. AL = N and AH = starting vector address. Pass back the sum in AL and set AH = 0 if no sum falls out of the 2's complement 16 bit range otherwise set AH = -1 if any sum results in a value out of the 2's complement range. Use ARO as a pointer to the vector and AR1 as your counter. The best code will result in the highest points. (12 pt.) l MOV 4/20 frm Mfr l MW x4141! 14L g' cowxfer 1 MOV I411 1[1&0 ifLNfiJZSLLM E79 \ a l 1/, 5 £01) ,41, age/(Mo Z'mMe/ewmt: Vi v ' fNC Z'INC, ’ DEC 29/2/ 2‘ alec cowaLw ' 6 TllNEQ ;=? d l '2 V3/ \ ' MOV fl}! 2 #0 ' no overflow l 3 END) MAL/c 1 0V 9 May fl/f EOXHCF 'flo‘t flWBVeV¥70MJ I d l 8ND]: QflET egg: ____-___________—_—_._——— Page 4 Page Score = z E v) For the next several problems, consult the attached program and generated LIST file and answer the followling questions. 8. What is the effective address forthe instruction MOV AH,Ox4ABC (line 13)? 3 Hex (2 pt.) . . . . . A090 9. At run/execution time, what Is the value of the operand in MOV ARO,#value1 (line 17)? Hex (2 pt.) 10. What is the effective address for the instruction MOV *ARO,AL at run time (line 20)? / ) Hex (2 pt.) ‘ o 6 11. What value is the Stack Pointer being initialized to? ’4 % Hex (2 pt.) 12. What is the value of the SP & stack memory contents upon execution of MOV AH,#OxO (line #36)? (6 pt.) SP = ’40 8 E Hex Stack Memory Address & Contents Below Addr (Hex) Data (Hex) flog/0 620W 0000 #0 g/ #0 H 00 Z, /71 0 8’3 [/5150 13. What is the value of the SP after the POP ARO (line 53 is executed)? fl 0 _ Hex (2 pt.) 14. At load time, what addresses in DSP memory will be modified? (2 pt.) _—/70M&4_‘700_0/%i_ 15. At run time, what addresses in DSP memory will be modified? (2 pt.) 57:; 520 » ,40 5/3 2 flow! flooZ all/XS? r. 24+] 525/0 16. What is the final computed result stored in value3 after MOV *ARO,AL (line 27) is executed? Hex (2 pt.) 17. What does SUB1 compute? i.e. It approximately computes 2pt.) w froflL m, 71/0 Db“ 1 Cl'r‘curvfizrwce Ma crch 18. What is the largest unsigned input value we can pass via AL to SUB1 before that will not result in a 16 bit unsigned overflow result? i.e The answerwill stiy fit in 16 b' s. (2 pt.) b , fl .H gxwm =66 5352 a/ Page 5 Page Score = m 19. Assuming that the DSP has an internal 16 bit data bus and 22 bit address bus, fill out the following cycle execution table for execution of the two instructions listed below. Write all values in Hex. (12 pt.) line #20 MOV *ARO,AL ; 2 cycles for instruction execution line #21 MOV ,l *ARO,#0x6789 ; 3 cycles for instruction execution i , Reg Driving_the Addr Bus l Device Driving the Data Bus Cycle#RlW PC(Hex) A15:0(Hex) D15:0(Hex) )5 5% 700° :90ch @754 v" Pa f’d‘ mww 5 L/tg 5 W / 0V ; V BIC “no 1‘ $2 £40030»? ’3?” 6%?” I ‘21!“ if?“ “‘2 “ flaw pins have been already set up for input nd output. rite the code to detect ifjust a 2, 5 or 8 key is pressed and then 20. A student has connected a simple asshown in FigwE found in the attached ASM file program. Assume th tthe GPIO write the key number pressed 2, 5, 8 or 2 r0 (if no key is pressed) to an external latch placed at Ox4000. (6 pt.) GPADAT .set 0x6FCO m 5060 #é—PHDM : fr W———# flow gLfitaxz, {gay/em 5 gm)! ,m/c MOV t/f/Zo ) fit, _L_,La’_deg_ 2/ : WV A” “W W—______ M NO)” Mot/ flax/Mo JUN/Jew Z372: mow/QLE4F0X2 HM) AL , 0x/I’0006 ’1 Mark CmP flL ,#0>(ooloooez' Key? 8 kflzzea cmp HL {4* axolomggkey5 . 8 kt 5 J WV: (7, DPDVi— END/ 3: MW flkofiflx‘flw C M P #9 #0x Macao/y i beyz MW A!ng flL 5 Kéj 7’} 651 W Page6 8 gND ') “MC lawssd" PageScore= 1 .global _c_int00 2 A000 data_section .set OxAOOO 3 4 00000000 .data ;section starts at 0xA000 in Linker Command File 5 00000000 4567 valuel .word 0x4567 6 00000001 0000 value2 .word 0x0 7 00000002 0008 value3 .word 8 8 9 00000000 .text ;section starts at 0x9000 in Linker Command File 10 11 00000000 _c_int00: 12 00000000 28A9 MOV AL,#0XCCCC ;used to test flags for problem #6 in Exam I F11 00000001 CCCC 13 00000002 28A8 MOV AH,#0X4ABC 00000003 4ABC 14 00000004 54A8 CMP AL,AH 15 00000005 94A8 ADD AL,AH 16 17 00000006 28A0" MOV ARO,#value1 ;simple prog. to move data around for questions 00000007 0000 ' 18 00000008 92C0 MOV AL,*ARO 19 00000009 0AAO INC ARO 20 0000000a 96C0 MOV *ARO,AL 21 OOOOOOOb 28CO MOV *ARO,#0x6789 0000000c 6789 22 23 0000000d 28AD MOV SP,#data_section+0x80 0000000e A080 24 0000000f 28A0" MOV ARO,#value3 00000010 0002 25 00000011 92CO MOV AL,*ARO 26 00000012 0080' LC SUBl ;subroutine I/O passed through AL 00000013 0016 27 00000014 96C0 MOV *ARO,AL 28 00000015 6F00 ENDl: B END1,UNC 29 30 31 00000016 8081: ;AL has input value & passes back output result 32 ;Helpful Info: 1/8 = 0.125, 1/16 = 0.0625, 1/32 = 0.03125, 1/64 = 0.015625 33 00000016 22AO PUSH ARO ;protect registers modified by subroutine 34 00000017 22A8 PUSH AH 35 36 00000018 9B00 MOV AH,#0x0 37 00000019 96A0 MOV ARO,AL 38 39 0000001a FFC2 LSR AL,3 40 0000001b 95A9 ADD AH,AL 41 42 OOOOOOlc 92A0 MOV AL,ARO 43 0000001d FFC5 LSR AL,6 44 0000001e 95A9 ADD AH,AL 45 46 0000001f 92A0 MOV AL,ARO 47 00000020 95A9 ADD AH,AL 48 00000021 95A9 ADD AH,AL 49 00000022 95A9 ADD AH,AL 50 00000023 92A8 MOV AL,AH 51 52 00000024 2AA8 POP AH 53 00000025 2AAO POP ARO 54 00000026 7614 LRET Page 7 Page Score = data_section Valuel value2 value3 _q_int00: ENDl : SUBl: q (IV/$413512 AL, 3 .global _c_int00 .set OxAOOO .data ;$ection startfl at OXAOOO in Linker Command File .word OX4567 .word 0x0 .word 8 ‘ Command File .text ;section startw at OXQOOU in L MOV AL,#OXCCCC MOV AH,#OX4ABC CMP AL,AH ADD AL,AH MOV ARO,#valuel MOV AL,*ARO INC ARO MOV *ARO , AL MOV *ARO,#OX6789 ;simple program to move data around for questions MOV SP,#data_section+0x80 MOV ARO,#value3 MOV AL, *ARO LC SUBl ;subroutine L MOV *ARO,AL B ENDl, UNC has a D ;Helpful Info: 1/8 = 0.125, 1/16 , 1. _/ 6 1-1 PUSH ARO PUSH AH ;protec: regiSters modified by subroutine OV AH,#0X0 MOV ARO , AL GPIOO GPIOI (333502 2WD AH,AL MOV AL,AR0 LSR AL, 6 ADD AH,AL 6 PEG 5 MOV AL,AR0 ADD AH,AL ADD AH,AL ADD AH,AL MOV AL, AH GPEO4 POP AH , - Pop ARo GPI03 LRET Figure 1. Keypad for Problem #20 Page Score = Philips Semiconductors Octal buffer/line driver; 3-state 5. Functional diagram 1B 16 14 12 Fig 1. Functional diagram 1 Y0 2A0 2Y0 1Y1 2A1 2Y1 1Y2 2A2 2Y2 1 Y3 2A3 2Y3 2615-19 mnaB74 Fig 2. Logic symbol Fig 3. IEC logic symbol 74HC_HCT2M_3 0 Koninkflpto Philip- Ei-amm'a NV, 2006, All Light! rasowud. Product data sheet Rev. 03 — 22 December 2005 3 of 22 Connection Diagrams Logic Symbols Pin Assignments for PDIP, SOIC, SOP, and TSSOP Do D102 03 D4 95 De D7 will: u! dons-dud adKL-a lezoo SLZOHAVL 2 3 0001020304050607 4 5 6 IEEEIIEC 7 _ MR R 8 CP > C1 9 10 “0 °0 01 _ 01 02 — 02 Us — Os D4 — 04 “s _ 05 De — Os 07 _ <27 Function Table Operating m w - - H = HIGH Voltage Level L = LOW Voltage Level X = immaterial _r : LOW-to-HIGH Transition I I (Top Through View) Pin Descriptions _ ©1994 Fairchild Semiconductor Corporation www.fairchildsemi.com 74VHCZ73 Rev. 1.5 2 ...
View Full Document

This note was uploaded on 01/03/2012 for the course EEL 4744c taught by Professor Staff during the Fall '09 term at University of Florida.

Page1 / 10

ex1_sol_f11 - , EEL 4744C — Dr. Gugel LAST NAME FIRST...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online