Exam 1. EE319K Spring 2013 Exam 1 (Practice 1) Page 1. Date: February 21, 2013; 9:30-10:45am. Printed Name:

Similar documents
EE319K Fall 2013 Exam 1B Modified Page 1. Exam 1. Date: October 3, 2013

EE319K (Gerstlauer), Spring 2013, Midterm 1 1. Midterm 1. Date: February 21, 2013

EE319K Spring 2015 Exam 1 Page 1. Exam 1. Date: Feb 26, 2015

Exam 1 Fun Times. EE319K Fall 2012 Exam 1A Modified Page 1. Date: October 5, Printed Name:

EE319K Exam 1 Summer 2014 Page 1. Exam 1. Date: July 9, Printed Name:

Exam 1. Date: Oct 4, 2018

Exam 1. Date: February 23, 2016

Exam 1. Date: March 1, 2019

(2) Part a) Registers (e.g., R0, R1, themselves). other Registers do not exists at any address in the memory map

Exam 1. Date: March 1, 2019

Exam 1. Date: February 23, 2018

EE319K Spring 2016 Exam 1 Solution Page 1. Exam 1. Date: Feb 25, UT EID: Solution Professor (circle): Janapa Reddi, Tiwari, Valvano, Yerraballi

Exam 1. Date: February 23, 2018

Introduction to Embedded Systems EE319K (Gerstlauer), Spring 2013

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

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

A block of memory (FlashROM) starts at address 0x and it is 256 KB long. What is the last address in the block?

Final Exam. Date: May 12, 2017

LDR R0,=0x L: LDREX R1, [R0] ORR R1, #4 STR R1, [R0] (5) Part a) Why does the 9S12 code not have a critical section?

Subroutines and the Stack

Final Exam. Date: May 14, Printed Name:

C:\Users\Jacob Christ\Documents\MtSAC\ELEC74 Mt SAC - chipkit\homework Sheets.docx

Bitwise Instructions

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design

ARM Cortex-M4 Architecture and Instruction Set 4: The Stack and subroutines

EE445M/EE380L.6 Quiz 2 Spring 2017 Solution Page 1 of 5

University of California, San Diego CSE 30 Computer Organization and Systems Programming Winter 2014 Midterm Dr. Diba Mirza

Introduction to C. Why C? Difference between Python and C C compiler stages Basic syntax in C

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

MIDTERM#1. 2-(3pts) What is the difference between Von Neumann & Harvard processor architectures?

Lecture 4 (part 2): Data Transfer Instructions

EE345L Spring 2004 Quiz 1 Page 1 of 5. Last Name: First Name:

Signature: 1. (10 points) Basic Microcontroller Concepts

CMPSCI 201 Fall 2005 Midterm #2 Solution

EECS 373 Midterm Winter 2012

ECE 471 Embedded Systems Lecture 5

Systems Architecture The ARM Processor

CMPSCI 201 Fall 2006 Midterm #2 November 20, 2006 SOLUTION KEY

Assembly Language Programming

CprE 288 Introduction to Embedded Systems

EECS 373 Practice Midterm / Homework #3 Fall 2014

ECE251: Thursday September 13

ECE251: Tuesday September 18

EE445L Fall 2016 Quiz 2A Solution Page 1

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

Processor Status Register(PSR)

INSTRUCTION SET ARCHITECTURE

Assembly Language Programming

Solution to the Problems and Questions

EE251: Thursday September 20

EE251: Tuesday September 5

CprE 288 Introduction to Embedded Systems Course Review for Exam 3. Instructors: Dr. Phillip Jones

ARM Assembly Language. Programming

Embedded assembly is more useful. Embedded assembly places an assembly function inside a C program and can be used with the ARM Cortex M0 processor.

Program SoC using C Language

C:\Users\jacob\Documents\MtSAC\ELEC74 Mt SAC - chipkit\homework Sheets.docx

LAB 1 Using Visual Emulator. Download the emulator Answer to questions (Q)

CMPSCI 201 Fall 2004 Midterm #1 Answers

ARM Cortex-M4 Programming Model

CMPSCI 201 Fall 2004 Midterm #2 Answers

Final Exam. 11 May 2018, 120 minutes, 26 questions, 100 points

16.317: Microprocessor Systems Design I Spring 2015

EE 308: Microcontrollers

all: arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb main.c \ -T generic-hosted.ld -o main.out -g arm-none-eabi-objdump -S main.out > main.

ARM Cortex M3 Instruction Set Architecture. Gary J. Minden March 29, 2016

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

ECE251: Tuesday September 11

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

ARM Instruction Set Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Hi Hsiao-Lung Chan, Ph.D. Dept Electrical Engineering Chang Gung University, Taiwan

Central Processing Unit

University of Florida EEL 4744 Spring 2012 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 22 February Jun-12 4:55 PM

CDA 3103 Computer Organization Exam 1 (Sep. 22th, 2014)

COMP3221: Microprocessors and. and Embedded Systems. Instruction Set Architecture (ISA) What makes an ISA? #1: Memory Models. What makes an ISA?

Stack Frames. September 2, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 September 2, / 15

ECE251: Tuesday September 12

Parallel I/O and Keyboard Scanning

ARM PROGRAMMING. When use assembly

ARM ASSEMBLY PROGRAMMING

Computer Architecture Prof. Smruthi Ranjan Sarangi Department of Computer Science and Engineering Indian Institute of Technology, Delhi

ARM Architecture and Instruction Set

ET2640 Microprocessors

The ARM Cortex-M0 Processor Architecture Part-2

Real Time Clock with Temperature Sensor and RS485/Modbus Comunications

Real-Time Systems / Real-Time Operating Systems EE445M/EE380L.6, Spring 2016

Introduction to C. Write a main() function that swaps the contents of two integer variables x and y.

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #9: Exam Review w/ Solutions

ARM Shift Operations. Shift Type 00 - logical left 01 - logical right 10 - arithmetic right 11 - rotate right. Shift Amount 0-31 bits

EE4144: ARM Cortex-M Processor

EEL 4511 Dr. Gugel LAST NAME FIRST NAME Spring 2016, Real-time DSP Exam #1

ARM Assembly Programming

VE7104/INTRODUCTION TO EMBEDDED CONTROLLERS UNIT III ARM BASED MICROCONTROLLERS

ARM Assembly Language

ARM Processors ARM ISA. ARM 1 in 1985 By 2001, more than 1 billion ARM processors shipped Widely used in many successful 32-bit embedded systems

CS 151 Quiz 4. Instructions: Student ID. (Last Name) (First Name) Signature

McGill University Faculty of Engineering FINAL EXAMINATION Fall 2007 (DEC 2007)

This training course provides additional details about the CPU architecture of the MCUs in the M16C/2x and M16C/6x series.

University of Illinois at Urbana-Champaign First Midterm Exam, ECE 220 Honors Section

AVR Logical and Bitwise Instructions

Transcription:

EE319K Spring 2013 Exam 1 (Practice 1) Page 1 Exam 1 Date: February 21, 2013; 9:30-10:45am Printed Name: Last, First Your signature is your promise that you have not cheated and will not cheat on this exam, nor will you help others to cheat on this exam: Signature: Instructions: Closed book and closed notes. No calculators or any electronic devices (turn cell phones off). You must put your answers on pages 2-6 only. You have 75 minutes, so allocate your time accordingly. Show your work, and put your answers in the boxes. Please read the entire quiz before starting.

EE319K Spring 2013 Exam 1 (Practice 1) Page 2 Question 1 (10 points) Consider the following 8-bit addition (assume registers are 8 bits wide) Load 0x40 into R1 Load 0x4B into R2 Add R3 = R1+R2 a. What will be the 8-bit result in Register R3 (in hex)? b. What is 8-bit result in Register R3 (as unsigned decimal)? 139 c. What is 8-bit result in Register R3 (as signed decimal)? -117 d. What will be the value of the carry (C) bit? 0 e. What will be the value of the carry (V) bit? 1 Question 2 (10 points). Interface the LED to PE0 using negative logic. The desired LED operating point is 1.8V at 1.2 ma. The output voltage V OL of the microcontroller is 0.5 V. You may also use 3.3 power and ground, as you need them. Show the equation used to calculate the resistor value and the circuit diagram showing the connections. LM3S/LM4F PE0

EE319K Spring 2013 Exam 1 (Practice 1) Page 3 Question 3 Part a) (10 points). Write an assembly subroutine, called ROL, that rotates a 32-bit number given in R1 a number of times given in R2. That is, the input is passed by value in Registers R1 and R2, and the output is returned in Register R3. You may use Registers R3 and R12 as scratch registers without saving and restoring them. Notice that rotating an n-bit number k places to the left is the same as rotating it n-k places to the right. (Check the ROR instruction) ;---------- ROL ------- ; Inputs: R1 has number to rotate; R2 has places to rotate ; Output: R3 has result (R1 rotated left R2 places) ROL ROR R3,R1,R2 ;Rotate right R1 by R2 places BX LR Part b) (5 points). What specific modifications must be done to the subroutine in part (a) so that the subroutine is AAPCS compliant? ROL RSB R1,R1,#32 ;R1 = 32-R1 ROR R0,R0,R1 BX LR ;Rotate right R0 by R1 places

EE319K Spring 2013 Exam 1 (Practice 1) Page 4 Question 4 (15 points) Assume the stack pointer (SP) is initialized to 0x2000.0408. Registers R0, R1, R2 and R12 are initialized to 12, 3, 8 and 5 respectively. Answer the following: Part a) Show is the content of the stack and the SP after the following sequence of operations: PUSH {R0} PUSH {R1-R2} PUSH {R12} 0x200003F4 0x20000408 0x2000040C Part b) Given the state of the stack after part a), show the content of the stack, the SP and registers R3, R4 after the following operation: POP {R3-R4} 0x200003F4 0x20000408 0x2000040C R3: R4: Part c) Given the state of the stack after part b), show the content of the stack, the SP and registers R0- R3 after the following operation: PUSH {R0-R1} POP {R0-R3} 0x2000040C R0: R1: R2: R3:

EE319K Spring 2013 Exam 1 (Practice 1) Page 5 Question 5 (20 points) You may use the following definitions or add others if you need. Bit-specific addressing is allowed but not required (use the dashed block below to make declarations for bit-specific addressing if needed) #define GPIO_PORTB_DATA_R (*((volatile unsigned long *)0x400053FC)) #define GPIO_PORTB_DIR_R (*((volatile unsigned long *)0x40005400)) #define GPIO_PORTB_AFSEL_R (*((volatile unsigned long *)0x40005420)) #define GPIO_PORTB_DEN_R (*((volatile unsigned long *)0x4000551C)) #define SYSCTL_RCGCGPIO_R (*((volatile unsigned long *)0x400FE608)) #define SYSCTL_RCGCGPIO_GPIOB 0x00000002 // port B Clock Gating Control Part (a) Write a C function Init that initializes Port B, pins 0 and 7 as outputs, and pins 3 and 4 are to be made input. (Ignore pull-up, pull-down resistors or high-amp drivers for outputs). Part b) Assume the initialization in part a) has been executed. Write C function that toggles PB0 and PB7 only when both inputs PB3 and PB4 are high. Otherwise PB0, PB7 are both off.

EE319K Spring 2013 Exam 1 (Practice 1) Page 6 Question 6 (30 points) a. What are the three registers that are initialized on Reset? b. In C what is the size in bytes for each of the following data types: Data Type uint16_t int32_t int8_t Size(in bytes) c. Register R1 has the value 0x80008001, what is its value after the following operations are performed independently: Operation LSR R1,R1,#3 LSL R1,R1,#4 ASR R1,R1,#1 R1 d. What is the purpose of the following statements in your assembly code: Statement EXPORT Start THUMB AREA DATA ALIGN=2 Purpose e. Answer the following fill in the blank or True/False questions: The Cortex M4 architecture is a Von-Neumann architecture The ARM ISA does not support Indirect addressing In Thumb mode all instructions are 2 bytes long ARM architecture supports bi-endian representation The remainder operation in C is When a C Program can calls an assembly subroutine the 2 nd parameter it passes can be found in register Same appendix as HW4