×
Log in to StudySoup
Get Full Access to UT - ME 445 - Study Guide - Midterm
Join StudySoup for FREE
Get Full Access to UT - ME 445 - Study Guide - Midterm

Already have an account? Login here
×
Reset your password

ee445m

ee445m

Description

School: University of Texas at Austin
Department: Mechanical Engineering
Course: EMBEDDED AND REAL TIME SYSTEMS
Professor: Jonathan valvano
Term: Spring 2017
Tags: embedded, RTOS, OS, arm, and cortex
Cost: 50
Name: Embedded and Real time Systems Study Guide Set 01
Description: Some questions used to study and practice for the RTOS class.
Uploaded: 03/09/2017
4 Pages 89 Views 0 Unlocks
Reviews


ME445M: Embedded and Real Time Systems   Study guide Set #01 EE445M: EMBEDDED AND REAL TIME SYSTEMS Course offered by the Department of Electrical Engineering at University of Texas at Austin Study Guide Set #01 February 15, 2017 Disclaimer: The contents of this document is a study guide for The University of Texas at Austin EE445M Spring 2017, Embedded and real Time Systems. Reference: http://users.ece.utexas.edu/~valvano/arm


3) How many bits are minimally needed to represent all days in a year?



RTOS  Real Time Operating System  Note Taker: Hilgad Montelo (hilgad.montelo@utexas.edu)     Copyright © Hilgad Montelo. All rights reserved.   ME445M: Embedded and Real Time Systems   Study guide Set #01 RTOS Preparation 1) Write an assembly subroutine that selects bit 8. The input to the subroutine is a 32‐bit number in R0. The output in R0 is 0 if the input bit 8 is 0, and the output is 1 if the input bit 8 is 1. Answer: Mask8 AND R0,R0,#0x00000100 ;remove all bits except bit 8   LSR R0,R0,#8 ;move bit 8 into bit 0 position   BX LR  2) Write C function that selects bit 8. The input to the function is an unsigned 32‐bit number. The output of the function is 0 if the input bit 8 is 0, and the output is 1 if the input bit 8 is 1. Answer: unsigned long Mask8(unsigned long input)  {   unsigned long output;   output = input&0x00000100; // select bit 8   output = output>>8; // move bit 8 into bit 0 position   return output;  }  3) How many bits are minimally needed to represent all days in a year? What C data type should be used to store such values?   Answer: Number of Bits = 9 bits  C Data Type = uint16_t or unsigned short  4) For the following operation sequence, what will be the value of register R0 and condition code bits N, Z, V and C after execution of the sequence. Assume all values and registers are 8‐bit wide. Answer:    Copyright © Hilgad Montelo. All rights reserved.   ME445M: Embedded and Real Time Systems   Study guide Set #01 5) Consider the following operation sequence (in regular 32‐bit ARM assembly):   LDR R1,=-168  ASRS R2,R1,#2  CMP R1, R2  Mark which of the following branches will be taken after executing the above sequence:   Answer: 6) Consider the following assembly program: Answer:  AREA CODE ; Assume this starts at address 0x0000.1000  num DCD 0x87654321  Start LDR R0,=num  LDRSH R1,[R0]  What is the value in register R1 at the end of execution? Answer: The ARM can be configured to different “endianness” and the result  depends on that - default is little endian.  Big: 0xFFFF8765  Little: 0x00004321  7) Given the following ARM assembly program:    AREA DATA  0x20000000 00000000 res DCD 0   AREA CODE  0x000005D0 B500 f PUSH {LR}  0x000005D2 2801 CMP R0,#0x01  0x000005D4 D007 BEQ done  0x000005D6 B401 PUSH {R0}  0x000005D8 F1A00001 SUB R0, R0, #1  0x000005DC F7FFFFF8 BL f  0x000005E0 BC02 POP {R1}  0x000005E2 FB00F001 MUL R0, R0, R1  0x000005E6 F85DEB04 done POP {LR}  0x000005EA 4770 BX LR  0x000005EC F04F0002 Start MOV R0,#2  0x000005F0 F7FFFFEE BL f  0x000005F4 4900 LDR R1,=res  0x000005F6 6008 STR R0,[R1] Copyright © Hilgad Montelo. All rights reserved.   ME445M: Embedded and Real Time Systems   Study guide Set #01 Assume the stack pointer SP is initialized to 0x2001.0000. Show the contents of the stack and indicate the location of the stack pointer right after the point when the statement at address ‘f’ has just been executed for the second time. Answer: 8) Write the assembly code to create a 16‐bit signed variable called Num. Include the details that will place the variable in RAM. Answer:  AREA data  Num SPACE 2    9) Consider the following 8‐bit addition (assume registers are 8 bits wide, and assume the condition code bits are set in a way similar to the Cortex M4). What are the condition code bits? Load 0x88 into R1  Load 0xC8 into R2  Adds R3 = R1+R2 ; setting the condition codes  Answer: N Z V C 0 0 1 1


What C data type should be used to store such values?



Don't forget about the age old question of Explain the role of a Ribozyme.
We also discuss several other topics like bmgt207
Don't forget about the age old question of info 3130 uncc
Don't forget about the age old question of mtro 101 towson
We also discuss several other topics like What are some of the causes and consequences of obesity in middle childhood?
Don't forget about the age old question of econ 315

10) Write a subroutine in C or assembly called SOS_Detector that first reads PB7 nine times very quickly. If the nine consecutive inputs match the pattern "000111000", then return a 1, otherwise return a 0. SOS_Detector must be AAPCS compliant. Answer: Subroutine in C Subroutine in assembly int32_t SOS_Detector(void)  {   uint32_t i,data=0;   for(i=0; i<9; i++){   data = (data<<1)|(   GPIO_PORTB_DATA_R&0x80);   }   if(data == (0x38<<7)){   return 1;   }   return 0;  } SOS_Detector   MOV R0,#0   LDR R1,=GPIO_PORTB_DATA_R   MOV R2,#9  loop LDR R3,[R1] ; PORTB   AND R3,#0x80 ; PB7   LSL R0,#1   ORR R0,R0,R3 ;combine bits   SUBS R2,#1   BNE loop ;9 times   CMP R0,#(0x38<<7)   BEQ yes  no MOV R0,#0   B done  yes MOV R0,#1  done BX LR


What is the value in register R1 at the end of execution?



Copyright © Hilgad Montelo. All rights reserved.  
Page Expired
5off
It looks like your free minutes have expired! Lucky for you we have all the content you need, just sign up here