o Add all the even numbers from N to 100 and put the result in sum. }

Similar documents
NCSU - ECE 306- Exam 2 March 27, 2003

Signature: 1. (10 points) Basic Microcontroller Concepts

MLR INSTITUTE OF TECHNOLOGY DUNDIGAL , HYDERABAD

F21 Microprocessor Preliminary specifications 9/98

Review for Exam III. Analog/Digital Converters. The MC9S12 has two 10-bit successive approximation A/D converters - can be used in 8-bit mode

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System

Today s Menu. >Use the Internal Register(s) >Use the Program Memory Space >Use the Stack >Use global memory

8051 Microcontroller

Department of Electronics and Instrumentation Engineering Question Bank

University of Florida EEL 4744 Spring 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 April Apr-14 9:03 AM

8051 Microcontrollers

231 Spring Final Exam Name:

S5-115U. Application

EE251: Tuesday December 4

Lecture 1. Course Overview and The 8051 Architecture

BaseIO for Cyclone Board

BHARATHIDASAN ENGINEERING COLLEGE. III Year / V Semester / EEE MICROPROCESSORS AND MICROCONTROLLERS (R-2013)

EE445L Fall 2010 Final Version A Page 1 of 10

University of Texas at Austin Electrical and Computer Engineering Department. EE319K, Embedded Systems, Spring 2013 Final Exam

Interrupts and Using Them in C

Bachelor of Engineering in Computer and Electronic Engineering

8085 Microprocessor Architecture and Memory Interfacing. Microprocessor and Microcontroller Interfacing

EE251: Thursday November 30

Final Exam. Date: May 14, Printed Name:


18~ lls RI. 2ft R. \ '2.0. <013 L-r (.,3!<-I. III DO. 0 I :") C)06Ii.I(J-t I ='> :2- J 10 Rfo /.1 S I \ \. 1 J. 4'2.. '2.) '34 P-o '2..

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

University of Washington EE 472: Microcomputer Systems Exam Autumn 2015

LCD MODULE DEM Q FGH-PW


A 3-SPEED STEPPER MOTOR

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families


Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 2003

BEng (Hons.) Telecommunications. BSc (Hons.) Computer Science with Network Security

LCD Display. Other I/O. LCD display Flash ROM SPI EPROM Keyboard (PS/2) UART connectors DAC ADC. 2-line, 16 character LCD display

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

GATE Exercises on Microprocessors

AVR Microcontrollers Architecture

ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

Microcontroller and Embedded Systems:

S5-115U. Application

MSMF GATE CENTRE. Sub: MICROPROCESSORS. Time: 50min Date: Marks:33

2B 52 AB CA 3E A1 +29 A B C. CS120 Fall 2018 Final Prep and super secret quiz 9

VALLIAMMAI ENGINEERING COLLEGE

Section 001. Read this before starting!

Select the single most appropriate response for each question. Note that none of the above MAY be a VALID ANSWER.

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

Sample Problem Set #1

8051 Overview and Instruction Set

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code:

DS75 Digital Thermometer and Thermostat

ELECTRICAL ENGINEERING

CS/ECE 5780/6780: Embedded System Design

XT-9100 Configuration Guide

Digital Signal Processor TRAINER

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram

Midterm Exam #2 Answer Key

Features: Analog to Digital: 12 bit resolution TTL outputs, RS-232 tolerant inputs 4.096V reference (1mV/count) 115K max speed

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 1.

8051 I/O and 8051 Interrupts

TEMIC 51T (Temic) EMULATION

SH69P48A EVB. Application Notes for SH69P48A EVB SH69V48A JP2 J4(ICE_J4) S1 IDD TEST JP1 74HC273 JP4 JP3 74HC273 JP6 STKOVE JP7 SW1 J5(ICE_J5)

HART Setup Multidrop Field Devices Technical Application Note

EECS 373 Midterm 2 Fall 2018

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

EE472 Mid Term SOLUTION KEY. Rules. Prof. Blake Hannaford Department of Electrical Engineering The University of Washington 31-Oct-2005 NAME

SH67K93/90 EVB ROM H ROM L. Application Notices for SH67K93/90 EVB SH69V93 SH67K93/90 EVB J2 GND. Port & CID interface Tele Line Plug.

EECS 373 Midterm Winter 2012

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING YEAR : III SEM : VI

PK2200 Series. Features. C-Programmable Controller. Specifications Board Size Enclosure Size Operating Temp.

May the Schwartz be with you!

Central processing units CPU 221, CPU 222, CPU 224, CPU 224 XP, CPU 224 XPsi, CPU 226

Free for personal use but you must have written permission to reproduce

mm Monochrome Display and Printer Adapter

POD 51EH C505L XH0 XH1 XH2 XH3 XH4 XH5 XH6 XH7 XL7 XL6 XL5 XL4 XL3 XL2 XL1 XL0. Figure 1. POD 51EH C505L 20

CS 352H Computer Systems Architecture Exam #1 - Prof. Keckler October 11, 2007

4. Configuring Cyclone II Devices

EE 314 Spring 2003 Microprocessor Systems. Parallel Printer Port Use and Digital-to-Analog Conversion

538 Lecture Notes Week 5

Changes in timetable (changes in GREEN)

Chapter 09. Programming in Assembly

17.1. Unit 17. Instruction Sets Picoblaze Processor

Supply voltage. Input current. Encoder supply. Memory

Lab 2 Part 3 Assembly Language Programming and 9S12 Ports

Stacks and Function Calls

ILI2511. ILI2511 Single Chip Capacitive Touch Sensor Controller. Specification ILI TECHNOLOGY CORP. Version: V1.4. Date: 2018/7/5

PCI to SH-3 AN Hitachi SH3 to PCI bus

PROGRAM CONTROL UNIT (PCU)

1. Attempt any three of the following: 15

TMCH Report March February 2017

A First Look at Microprocessors

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1

Tutorial 1 Microcomputer Fundamentals

ECE550 PRACTICE Final

University of Alexandria Faculty of Engineering Division of Communications & Electronics

CDA3100 Midterm Exam, Summer 2013

LABORATORY MANUAL VLSI DESIGN LAB EE-330-F

Transcription:

ECGR 410115101 - Midterm Exam Page 10f3 UNC Charlotte-ECGR4101/5101-Midterm Exam -10/14/09 Multiple Choice - Questions 1-10: Each of these multiple choice questions is worth 4 points for a correct answer, 0 points for an incorrect answer. Circle your answers on the bubble sheet. int i,sum; 1) Which of the following fully describes the outcome of the code at the right? sum = 0; a. Add all the numbers from 0 to 100 and put the result in sum. i = 0; b. Add all the odd numbers from 0 to 100 and put the result in sum. for(i=n;i<100;i++) { c. Add all the even numbers from 0 to 100 and put the result in sum. if((i %'2)) d. Add all the odd numbers from N to 100 and put the result in sum. sum += i; o Add all the even numbers from N to 100 and put the result in sum. } 2) MCU can run in three modes: single chip, memory expansion, microprocessor modes. If used in single-chip mode what areas in memory could be addressed. 6) Only internal areas (SFR, internal RAM, internal ROM) Y. Internal areas (SFR, internal RAi.V1, internal ROM) and external memory areas c. SFR, internal RAM and external memory d. SFR, external memory e. Only external memory 3) What is the number of address bits required to address any~e in a memory that contains 65536 bytes? a. 2 b. 8 c. 12 V 16 e. 20 4) If! used the MCU30262 instruction 'enter #2' at the beginning ofa function, how many bytes does the corresponding'exitd' instruction deallocate from the stack if no other enter, exitd, jsr, pop or push operations are performed wit in the function? a. 6 b. c. 8 d. 9 e. 10 5) Which assembly language code below adds the value of global variable shoe to the value in R1 and stores the result in R1: a. add.w shoe, R1 d. add.w _shoe, R1 b. add.w R1, shoe e. add shoe + R1 c. add _shoe, R1 6) How far apart in time can two interrupts be and still be considered as simultaneous (assume a 16 MHz clock)? 92 ns d. 40 ps b. 62.5 ns e. None of the above c. 50 ns Consider the piece of C-code to the right for questions 7 and 8: main() { 7) How is the char b in the code passed to the function char a = \x' ; choosechar(a,b)? char b = \ a' ; (;) Stack d. R1H char new; V. R1L e. R2 int d = 5; c. R1 f. None of the above float c = 3.14; float result; 8) How is the int d passed in the function dothemath(c,d)? a. Stack X~H new = choosechar(a,b); b. R 1 L \.S.;"KL result = dothemath(c,d); c. R1 f. None of the above

.ECGR 4101 /5101 - Midterm Exam Page 2 of 3 9) The double word Ox AC35 FA34 is stored in memory addresses N through N+3. Which of the following represents sto rage using b 19 endianness? a. N N+I N+2 N+3 43 N AC e. N 34 AF 53 CA N+I 35 N+2 FA N+3 34 N+I FA N+2 35 N+3 AC b. N FA d. N+l 34 N+2 AC N+3 35 N FA N+I 34 N+2 AC N+3 35 10) According the ECGR41 0 1/51 0 I programming standards, which of the following should be included in the header of a subroutine? a. Subroutine name A Interfaces b. Assumptions ~ All of the above c. Inputs/Outputs Short Answer " II) You have several I Ahr 1.2V batteries and a LED that has an average drain of 3.5mA at 4.8V. a. Draw the configuration of the minimum number of batteries needed to light the LED.(2 points) b. With your battery configuration how long would the LED stay lit? (3 points),- 12) Given the following information of a particular analog to digital converter, determine the value of the digitally represented voltage and the step size of the converter. (10 points) The device is a IO-bit ADC with a + reference voltage of3.3 volts and a - reference voltage of -0 volts. The digital representation is: 0 100 II 00 I O., 13) What are the benefits of a microprocessor/microcontroller-based embedded system over an FPGA-based embedded system? (10 points) (in three to five sentences) ~ 14) Can you, the user, store a value at memory location OOCBCh? Why or why not? (5 points) 15) Write the code to set up an AID conversion for the first four channels of P2, 1 O-bit sample-and-hold, one shot and store the data in four variables (unsigned int sampleo, samplel, sample2. sample3). Include all set-up bytes needed. If you use any.h files, tell me which ones you use. (25 points) 16) A) Imagine you have an embedded system that uses your QSK board. The system will: Req. 1: Use the C programming language. Req.2: Continually poll SWI. While it is pressed, light the LEDI. Req. 3: Continually poll SW2. While it is pressed, light the LED2. Req.4: Continually poll SW3. While it is pressed, light the LED3. Req. 5: Two or three LEDs can be lit at the same time. Req. 6: Continually have an ISR put an analog value on Port 0, bit 0 put it in the variable printme. Req.7: Continually print the value inprintme on the LCD. Req. 8: You may not use any string libraries. Req. 9: Include a few comments, including headers. Identify the "architecture" of this problem, dividing he work into appropriate functions. Substantiate your design decisions. (20 points) B) Write the algorithms (general steps) which implements the above functionality of all functions. (35 points)

G-CG\2 4 101/5/01 "1( a~ I ~ 10 ~(( UJo4 II a N-tJ!. j~,.1.0 Y't«!J.. -fo ~ ()\ a vb I"" '{"alv 4, v J l v CR./ :;t~, " b k - j, f. t{ 5/t r~y S!A(IA 3 /3) fjj 5 J I-II ~vos 0 /I1 ~v-o UJ ~/~ - hr 1 Vi tx'w t"'" C V' SV~ t;,(1v\ a~.(,>"" S Q U ~ Of "11'\ 14) 0400 7r 7 r: 10 ",07T(;r 7'$..Jo 1.:/ ~v--e.,e ~ CBC }5 IJ.AII w o ~A ' jv\

//) LCG?- 4' '/<51 0 1- lxw. 1 501 v OlA (/ tv1 v (' ov\q.r", I k /'II() I. 0.., A ono =- 'f. J -A VCON I =(h. :t q j 01{ o 3q ADeoN ~ ~ 0/07j 0'117 ~c 0 I - 0 fi v C Iz... J,Moo -0!ilVf -= r i12g I, A'P5T - 0 IJ I '!~. cj<50= -f./ /7f5 C A,NO --, J -A AI j N3 s: t =0 "," [) Z. 0 8HS- I 10 b,~ s r 0.. IA Y(0 0'( I ) VCVT I CO>/I o 0 AI 0 /~S~{>- " ~ I; A {)6'Sl:.l..O ; I :: D cz-j I b~ ~O G s z. ::: dvty (0 () ) 5 :: 0 bt 0 f 0 +... /I/I>W Co 4

E:CG -~IOI/5101 - A:./evW\ 5oL~o'" - :r;{(zoo1 ~v~ S~ ~v~ A1Xj 0p~~;R] l~~~; -~s ~IJ(: V-~*ltAto ~{O~4( ViiV' A{J;Ae&fv~ - 4fJ-s ~ r?vo0lelm Ib

tc6'r 410(/5 {Of - )A,J4tw\ s-,(uiiol/\ - +;t/ dj01 No~ ~ r NE.Yeil ~$W -h,v colt f,v~,,. prob~"" ((se,/-(jf_ 5V/_~~P I( ~ lip 5"V~., ft.-fh I LG!D5 ~ 5 5e+ -5IN rjvh. 5 t:{ S i VI.~ uf- l~ ~ 5 Ll?P5 rvyv\ C>~ Out-rJ5 1/ /rfx- ISf< (I ~Jl ~.~ 0 ~ Sa v--e fh ~~::. tt. ). 0 <u O"t03 FF 1/ COt,. vwf v',,(v-e VII/utL /1 GoA wit- ~ ~ tfv\ (Ovl vea- --fk.ov5~ $ Ceil o.tr'f- kv-j~5 Covv'e-/t -kv\ 5 Ct0t\ V#vt rj~f/~ 0 ~e'5