3 Pages

recitation_week_8

Course: CDA 3100, Spring 2011
School: Fayetteville State...
Rating:
 
 
 
 
 

Word Count: 395

Document Preview

the In lecture I will discuss how to write the basic main loop for an embedded controller. Based on the TV.asm given in the lecture downloadable from the slides, write a process_input function that responds to `m, `h, `q (ascii code 109, 104, 112, respectively). The TV is initially not in the ``menu state. When the user presses `m while the TV is not in the menu state, the TV should show as very simple menu, and...

Register Now

Unformatted Document Excerpt

Coursehero >> North Carolina >> Fayetteville State University >> CDA 3100

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
the In lecture I will discuss how to write the basic main loop for an embedded controller. Based on the TV.asm given in the lecture downloadable from the slides, write a process_input function that responds to `m, `h, `q (ascii code 109, 104, 112, respectively). The TV is initially not in the ``menu state. When the user presses `m while the TV is not in the menu state, the TV should show as very simple menu, and enters the menu state (recall your own TV for reference): `h' to print hello, `q' to quit. In the menu state, if the user presses `h, print out Hello! In the menu state, if the user presses `q, print out quit. and quits the menu state. If not in the menu state, the TV does not respond to `h and `q. The following is my code: .data menuLevel: .word 0 msg_tvworking: .asciiz "tv is working\n" msg_menu: .asciiz "`h' to print hello, `q' to quit.\n" msg_hello: .asciiz "hello!\n" msg_quit: .asciiz "quit.\n" main: .text .globl main addi $s0, $0, 300 #s0: used in couting 10ms mainloop: # 1. read keyboard input, and process it lui $t0, 0xFFFF # $t0 = 0xFFFF0000; lw $t1, 0($t0) andi $t1, $t1, 0x0001 $t1 # &= 0x00000001; beq $t1, $0, mainloopnext1 lw $a0, 4($t0) jal process_input mainloopnext1: # 2. update counter, check sleep timer jal delay_10ms # 3. $s0 as the 10ms counter, go from 0 to 299 addi $s0, $s0, -1 bne $s0, $0, mainloop li $v0, 4 la $a0, msg_tvworking syscall addi $s0, $0, 300 j mainloop li $v0,10 # exit syscall # -------------------delay_10ms: li $t0, 1000 delay_10ms_loop: addi $t0, $t0, -1 beq $t0, $0, delay_10ms_done j delay_10ms_loop delay_10ms_done: jr $ra # -------------------process_input: la $t0, menuLevel lw $t1, 0($t0) bne $t1, $0, pi_menu_L_1 li $t0, 109 # comparing with the ascii of `m' bne $a0, $t0, process_input_done la $t0, menuLevel li $t1, 1 sw $t1, 0($t0) la $a0, msg_menu li $v0, 4 syscall j process_input_done pi_menu_L_1: li $t0, 104 # comparing with the bne $a0, $t0, pi_menu_L_1_comp_q la $a0, msg_hello li $v0, 4 syscall j process_input_done pi_menu_L_1_comp_q: li $t0, 113 # comparing with the bne $a0, $t0, process_input_done la $a0, msg_quit li $v0, 4 syscall la $t0, menuLevel sw $0, 0($t0) j process_input_done process_input_done: jr $ra # -------------------- ascii of `h' # ascii of `q' #
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Fayetteville State University - CDA - 3100
In this recitation, please help the students with the K-map. This is a very good link I found on theweb about the K-map:http:/www.ee.surrey.ac.uk/Projects/Labview/minimisation/karrules.htmlso please go over this with the students first. Then, ask them
Fayetteville State University - CDA - 3100
In this recitation, you may help the students with some more advanced combinatorial circuitdesign:1. You may ask them to design a 4-bit encoder, which takes four bit inputs and output two bits.If the input bits are 1xxx, the output is 11. If the input
Fayetteville State University - CDA - 3100
In this recitation, the goal is to let the students get familiar with both sequential circuit designand Verilog. You may first help the students with their problems with the Verilog simulator. Allstudents are supposed to be able to run the simulator, an
Fayetteville State University - CDA - 3100
Design a circuit that has two inputs, clk and X, and produces one output O. X may change everyclock cycle, and the change happens at the falling edge. The circuit samples the input at everyrising edge of the clock. If the input is 1, consider as read a
Fayetteville State University - CDA - 3100
1. Design a simplified MIPS processor that supports only beq and sw. You may ask them todraw on this figure:The answer is the following.2. Design a simplified MIPS processor that supports only addi and lw. You may ask them todraw on this figure, and s
Fayetteville State University - CDA - 3100
Problem 1 Read the MIPS code and answer the following questions.(a) What does function f1 do?Ans: Find the first i such that A[i]-B[i] < C[i](b) What will f1 return in $v0?Ans. 3main:.text.globl mainla $a0,la $a1,la $a2,li $a3,jal f1ABC10
UC Riverside - ECON - 1000
MGMT 4010 Fall 2011 Version 1.0UNIVERSITY OF COLORADO - BOULDERLEEDS SCHOOL OF BUSINESSEmployee Relations MGMT 4010Instructor:Section Meets:Office:Office Hours:Email:Dr. Tracy JenningsKOBL 330 9:30-10:45 (001) and 11:00-12:15 (002)Rm. 456Wedne
UC Riverside - ECON - 1000
Chapter 1 - Critical Thinking and Concept Review (CTCR)1.(i) Capital Budgeting: Expanding or adding a manufacturing plant,(ii) Capital Structure: Issuing new equity (stock) or debt (bonds) and using the proceeds toretire outstanding debt or pay for a
UC Riverside - ECON - 1000
Chapter 2 and 3 Formulas to be MemorizedDefinition of Variables: (These definitions will NOT appear on the sheet attached to the exam.)A = Assets = Total AssetsCurrent Assets = CACurrent Liabilities = CLE = Equity = Total EquityD = Debt = Total Debt
UC Riverside - ECON - 1000
Midterm 1 Formula SheetTimes Interest Earned = EBIT/Interest ExpCash Coverage = EBITDA/Interest ExpInventory Turnover = COGS/InventoryDays Sales in Inventory = 365/Inventory TurnoverReceivables Turnover = Credit Sales/(A/R)Days Sales in Receivables
Chapman - ACCU - 620
Pick a company, look up what their cash balances are over the last 2 years and look attheir Statement of Cash Flows. Describe what they are using the Cash from Operationsfor over the last two years- any trends? Do you agree with this trend for this comp
Chapman - ACCOUNTING - 640
CHAPTER 3COST BEHAVIORDISCUSSION QUESTIONScrease in cost requires an increase in several units of activity. When a step-variablecost changes over relatively narrow rangesof activity, it may be more convenient totreat it as a variable cost.1. Knowle
Chapman - ACCOUNTING - 640
CHAPTER 4ACTIVITY-BASED COSTINGDISCUSSION QUESTIONS7. Activity-based product costing is a costingapproach that first assigns costs to activitiesand then to products. The assignment ismade possible through the identification ofactivities, their cost
Chapman - ACCOUNTING - 640
CHAPTER 5PRODUCT AND SERVICE COSTING:JOB-ORDER SYSTEMDISCUSSION QUESTIONSbor. Predetermined overhead rates are usedto assign overhead costs to individual jobs.1. Cost measurement is the process of determining the dollar amounts of direct materials,
Chapman - ACCOUNTING - 640
CHAPTER 6PROCESS COSTINGDISCUSSION QUESTIONS1. A process is a series of activities (operations) that are linked to perform a certain objective. For example, the bottling process ofa pain medication manufacturer consists offour linked activities: load
Chapman - ACCOUNTING - 640
CHAPTER 7ALLOCATING COSTS OF SUPPORT DEPARTMENTSAND JOINT PRODUCTSDISCUSSION QUESTIONSproducing department cannot control. Allocating budgeted costs avoids this problem.1. Stage one assigns service costs to producing departments. Costs are assigned u
Chapman - ACCOUNTING - 640
CHAPTER 8BUDGETING FOR PLANNING AND CONTROLDISCUSSION QUESTIONSpriate percentage to yield the amount ofcash expected.1. Budgets are the quantitative expressions ofplans. Budgets are used to translate thegoals and strategies of an organization into
Chapman - ACCOUNTING - 640
CHAPTER 9STANDARD COSTING:A FUNCTIONAL-BASED CONTROL APPROACHDISCUSSION QUESTIONS1. Standard costs are essentially budgetedamounts on a per-unit basis. Unit standardsserve as inputs in building budgets.an event that will create a direct labor rate
Chapman - ACCOUNTING - 640
CHAPTER 10DECENTRALIZATION:RESPONSIBILITY ACCOUNTING, PERFORMANCEEVALUATION, AND TRANSFER PRICINGDISCUSSION QUESTIONSencourages investment in all projects thatearn at least the minimum rate of return.1. Decentralization is the delegation of decisio
Chapman - ACCOUNTING - 640
CHAPTER 11STRATEGIC COST MANAGEMENTDISCUSSION QUESTIONS6. Value-chain analysis involves identifyingthose internal and external linkages thatresult in a firm achieving either a cost leadership or differentiation strategy. Managingorganizational and o
Chapman - ACCOUNTING - 640
CHAPTER 12ACTIVITY-BASED MANAGEMENTDISCUSSION QUESTIONSthose costs caused by non-value-added activities. An example is the cost of materialshandling.1. The two dimensions are the cost dimensionand the process dimension. The cost dimension is concern
Chapman - ACCOUNTING - 640
CHAPTER 13THE BALANCED SCORECARD:STRATEGIC-BASED CONTROLDISCUSSION QUESTIONSwards are mostly tied to financial performance.)1. A strategic-based responsibility accountingsystem converts an organizations missionand strategy into operational objectiv
Abilene Christian University - ECON - 261
Chapter 5 ElasticityA. Price Elasticity of Demand1. Elasticity the measure of responsiveness of one variable relative to another. We cando this for any variable, not just economic.2. Price Elasticity of Demand Measures the percentage change in Qd rela
Abilene Christian University - ECON - 261
CHAPTER 31SUPPLY AND DEMAND: AN INITIAL LOOKTHE INVISIBLE HAND1.Scarcityandchoicearethebasicproblemsofeconomics;thesupplyanddemandmechanismisthe basicinvestigativetoolofeconomics.ANSWERT,E,R2.Governmentsofmarketorientedeconomiesnevertamperwiththep
Abilene Christian University - ECON - 261
CHAPTER 41CONSUMER CHOICE: INDIVIDUAL AND MARKET DEMANDTRUE-FALSE QUESTIONSSCARCITY AND DEMAND1.Becausetheconsumersbudgetislimited,purchasedecisionsamongavailablegoodsmustof necessitybeinterdependent.ANSWERT,E,A2.ThenumberofCompactDiscspurchasedb
Abilene Christian University - ECON - 261
CHAPTER 51DEMAND AND ELASTICITYTRUE-FALSE QUESTIONSELASTICITY: THE MEASURE OF RESPONSIVENESS1.Themarketdemandcurveshowshowthequantitydemandedofaproduct,duringaspecifiedtime period,changesasthepriceofthatproductchanges.ANSWER:T,E,A2.Thelawofdemand
Abilene Christian University - ECON - 261
Chapter 34 / 18Limits to Stabilization PolicyCM34 \ D \ Laws and Regulations \ 2 \The Employment Act of 1946 did not identify as a national macroeconomic priority:(a) maximum employment.(b) maximum purchasing power.(c) maximum economic growth.(d) m
Abilene Christian University - ECON - 261
Pre-Test 1Multiple ChoiceIdentify the letter of the choice that best completes the statement or answers the question._1. Some college students think that because a college degree greatly increases their earning potential there is no op portunity cost
Abilene Christian University - ECON - 261
Exam 2 Review POLS 226Chapters 3-5 Political parties definitions, characteristics, purposeshow do parties form? Ideology and interest.Ppl align with a party bc it protects their investments, benefits, employment,etc. interest may have nothing to do w
Abilene Christian University - ECON - 261
The Rules of Yahtzee - Standard PlayOBJECT OF THE GAME:The object of YAHTZEE is to obtain the highest score. The player with the greatest grand total wins and earns the difference between his score and that of hisopponents.Each player keeps his own sc
CUNY Brooklyn - ECON - 101
1998mcanswersABCDE 1. A solid metal ball and a hollow plasticball of the same external radius arereleased from rest in a large vacuumchamber. When each has fallen 1m, theyboth have the same a. inertiab. speedc. momentumd. kinetic energye. c
UCLA - KOREAN - 3
Final Review: _A. Choose the most appropriate form.1. ( , , , ).2. (- , -, ) .3-4.: (, , )?:, (, , )5. Century City Shopping Mall(-, -(), -, -) .6. (, , , ) .7. (, , , ) ?8. (, , , ) .9. (, , , ) .B. Fill in the blanks with appropriate verb
UCLA - KOREAN - 3
Final Review: _A. Choose the most appropriate form.1. ( , , , ).2. (- , -, ) .3-4.: (, , )?:, (, , )5. Century City Shopping Mall(-, -(), -, -) .6. (, , , ) .7. (, , , ) ?8. (, , , ) .9. (, , , ) .B. Fill in the blanks with appropriate verb
UCLA - KOREAN - 3
4.6.
UCLA - KOREAN - 3
Korean 3Lesson Test #2 Review: _A.Choosethemostappropriateform.1. ( , , ).2. (, , ) .3. (, , .)4. (, , ).5. (, , ) .6. (, , ) .7. (, , ).8. (, , ).9. (, , ).B.TranslatethefollowingsentencesintoKorean.1. I dont have money because Im a student
UCLA - KOREAN - 3
KOR2 Grammar SummaryI. PARTICLES1. -/ (topic marker) honorific: . . .C+, V+2. -/ (subject marker) honorific: . . .C+, V+3. also . .4. / object marker . .C+, V+5. =-() with(=) .6. ()a. Transportation: by / . * .C+, V/+b. Instrument
University of Alabama - Huntsville - CPE - 323
CPE 323 Introduction to Embedded Computer Systems: IntroductionInstructor: Dr Aleksandar MilenkovicCPE 323 AdministrationSyllabustextbook & other references grading policy important dates course outlinePrerequisitesNumber representation Digital desi
University of Alabama - Huntsville - CPE - 323
CPE 323 Introduction to Embedded Computer Systems: MSP430: Assembly Language and C Instructor: Dr Aleksandar Milenkovic Lecture NotesOutlineAssembly Language ProgrammingAdding two 32-bit numbers (decimal, integers) Counting characters `E'SubroutinesC
University of Alabama - Huntsville - CPE - 323
CPE 323 Introduction to Embedded Computer Systems: The MSP430 System Architecture Instructor: Dr Aleksandar Milenkovic Lecture NotesOutline MSP430: System Architecture System Resets, Interrupts, and Operating Modes Basic Clock Module Watchdog TimerCPE 3
University of Alabama - Huntsville - CPE - 323
CPE 323 Data Types and Number RepresentationsAleksandar MilenkovicNumeral Systems: Decimal, binary, hexadecimal, and octalWe ordinarily represent numbers using decimal numeral system that has 10 as its base (also base-10 or denary). The decimal numeral
University of Alabama - Huntsville - CPE - 323
12345ZMD 915 MHz RF Demo BoardDDZMD1611/DZMD1612DPower Power.Sch PONOFF VCC GND V25 VCCIO IO.Sch VCC GNDZMD44102 ZMD44102.Sch V33 GND V25CoreMSP CoreMSP.Sch VCC GND LED1 LED2 ZMDCS ZMDSO ZMDSI ZMDSCLK ZMDRSN ZMDGPD ZMDIRQ ZMDCS ZMDSO ZMDSI ZMD
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer Systems Homework IProblem #1 (25 points) Fill in the following table. Show your work as illustrated for (a). Decimal (a) (b) (c) (d) (e) 12,348 10,245 0111.0011.0010.1100.1001.0100.0010.1100 83.29.19.43 32-bit
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer Systems Homework IProblem #1 (25 points) Fill in the following table. Show your work as illustrated for (a). Decimal 32-bit binary Hexadecimal number (8 hex digits) 0000_303C DBF3_23AB 4-byte packed BCD number
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer Systems Homework II1(25) 2(40) 3(35) Total _ _ _ _Problem #1 (25 points) Consider the following assembly directives (see below). Show the content of relevant region of memory initialized by these directives.
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer Systems Homework III1(40) 2(30) 3(30) Total _ _ _ _Problem #1 (40 points) Consider the following C program. Assume all variables are allocated on the stack in the order as they appear in the program (e.g., th
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer SystemsHomework III1(40) 2(30) 3(30) Total___ _Problem #1 (40 points) Consider the following C program. Assume all variables are allocated on the stack in the order asthey appear in the program (e.g., th
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer SystemsHomework IV1(25) 2(25) 3(25) 4(25) Total___ _Problem #1 (25 points) Microcontroller MSP430 is using 32KHz crystal connected to LFXT1 Oscillator, 8MHz crystalconnected to XT2 Oscillator, and 3V pow
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer SystemsHomework IV1(25) 2(25) 3(25) 4(25) Total___ _Problem #1 (25 points) Microcontroller MSP430 is using 32KHz crystal connected to LFXT1 Oscillator, 8MHz crystalconnected to XT2 Oscillator, and 3V pow
University of Alabama - Huntsville - CPE - 323
CPE/EE 323 Introduction to Embedded Computer Systems Homework V1(20) 2(25) 3(20) 4(20) 5(25) Total (110)Problem #1. (20 points). ADC, DAC A (5 points). A sensor device gives an analog voltage that is directly proportional to atmospheric pressure. The se
University of Alabama - Huntsville - CPE - 323
CPE 323: Laboratory Assignment #1Getting Started withthe MSP430 IAR Embedded Workbenchby Alex Milenkovich, milenkovic@computer.orgObjectives: This tutorial will help you get started with the MSP30 IAR Embedded Workbenchand includes the following topi
University of Alabama - Huntsville - CPE - 323
Getting Started withthe MSP430 IAR Assemblyby Alex Milenkovich, milenkovic@computer.orgObjectives: This tutorial will help you get started with the MSP30 IAR Assembly programdevelopment. You will learn the following topics:Assembly programmingCreati
University of Alabama - Huntsville - CPE - 323
Assembly Language Programming: Subroutinesby Alex Milenkovich, milenkovic@computer.orgObjectives: Introduce subroutines, subroutine nesting, processor stack, and passing theparameters to subroutines.1.SubroutinesIn a given program, it is often neede
University of Alabama - Huntsville - CPE - 323
Getting Started with the DRFG4618 Hardware Platformby Alex Milenkovich, milenkovic@computer.orgObjectives: This tutorial will help you get started with the MSP30 IAR Assembly programdevelopment on the hardware platform DRFG4618. You will learn the foll
University of Alabama - Huntsville - CPE - 323
Getting Started with the EasyWeb2 HardwarePlatform: Digital I/O (LEDs, Buttons)by Alex Milenkovich, milenkovic@computer.orgObjectives: This tutorial will help you get started with the MSP30 IAR C program developmenton the hardware platform EasyWeb2. Y
University of Alabama - Huntsville - CPE - 323
TimerA with the EasyWeb2 Hardware Platformby Alex Milenkovich, milenkovic@computer.orgObjective: This tutorial discusses the use of MSP430s TimerA.Note: Required are all previous tutorials.1.Blink a LED Using TimerA ISRLet us consider the following
University of Alabama - Huntsville - CPE - 323
USART Module in UART Modewith the EasyWeb2 Hardware Platformby Alex Milenkovich, milenkovic@computer.orgObjective: This tutorial discusses the use of MSP430s USART Device.Note: Required are all previous tutorials.1.Echo a CharacterLet us consider a
University of Alabama - Huntsville - CPE - 323
ADC12 and DAC12 Modulesby Alex Milenkovich, milenkovic@computer.orgObjective: This tutorial discusses the use of MSP430s ADC12 and DAC12 peripheral devices.Note: Required are all previous tutorials.1.On-Chip Temperature SensorLet us consider a C app
University of Alabama - Huntsville - CPE - 427
Project Final ReportIntroductionThe format given here is fairly standard for technical reports, though some variations are acceptable. Thebasic elements of a report (title, abstract, introduction, methods and materials, results, discussion andconclusi
University of Alabama - Huntsville - CPE - 427
Consulting & Engineering Serviceswww.tanner.com/cesCES-mAMIs05DLTanner Consulting & Engineering ServicesPresentingMAMIS035DL Digital Low Power Standard Cell LibraryFor Mosis AMI 0.5 Sub-micron ProcessRevision AmAMIs 0.5Consulting & Engineering Se
University of Alabama - Huntsville - CPE - 427
Project Progress ReportIntroductionYou must submit a progress report of approximately 1000 words (two pages, typed single-spaced) to yourproject advisor by the end of the Nth (N = cfw_8 | 9 | 10) week of the semester. This report should help bothyou a
Wisconsin - PHY - 7070
PHYS851 Quantum Mechanics I, Fall 2009HOMEWORK ASSIGNMENT 3: SolutionsFundamentals of Quantum Mechanics1. [10pts] The trace of an operator is dened as T r cfw_A =set.mm|A|m , where cfw_|m is a suitable basis(a) Prove that the trace is independent