EECS 373 Practice Midterm / Homework #3 Fall 2014

Similar documents
EECS 373 Practice Midterm & Homework #2 Fall 2011

EECS 373 Midterm Winter 2013

EECS 373 Midterm Winter 2012

EECS 373 Midterm 2 Fall 2018

EECS 373 Midterm Winter 2016

EECS 373 Midterm 2 Exam Winter 2018

EECS 373 Midterm Winter 2017

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Fall 2018 Homework #3

EECS 270 Midterm Exam

EECS 373 Design of Microprocessor-Based Systems

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.

EECS 373, Homework 4, Fall 2018 Assigned: Wednesday 10/3; Due: Wednesday 10/10 at 10pm

University of Toronto Mississauga. Flip to the back cover and write down your name and student number.

Introduction to I2C & SPI. Chapter 22

May the Schwartz be with you!

EECS 373. Design of Microprocessor-Based Systems. Prabal Dutta University of Michigan. Announcements. Homework #2 Where was I last week?

One and a half hours. Section A is COMPULSORY

EECS 373 Design of Microprocessor-Based Systems

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

Hardware Implementation of AMBA Processor Interface Using Verilog and FPGA

EECS 373 Design of Microprocessor-Based Systems

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

EECS 373 Lab 3: Introduction to Memory Mapped I/O

EECS 373 Design of Microprocessor-Based Systems

esi-multichannel Timer

EE 231 Fall EE 231 Homework 8 Due October 20, 2010

CoreAHBtoAPB3 v3.1. Handbook

Good Evening! Welcome!

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

First Name: Last Name: PID: CSE 140L Exam. Prof. Tajana Simunic Rosing. Winter 2010

The University of Michigan - Department of EECS EECS 370 Introduction to Computer Architecture Midterm Exam 1 February 17, 2011

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

EECS 470 Midterm Exam

Exam 1. Date: February 23, 2016

Architectural design proposal for real time clock for wireless microcontroller unit

Universität Dortmund. ARM Cortex-M3 Buses

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

APB4 GPIO. APB4 GPIO Datasheet Roa Logic, All rights reserved

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

University of Florida EEL 4744 Fall 1998 Dr. Eric M. Schwartz

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

Final Exam. Date: May 12, 2017

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

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

Engineering 100 Midterm Exam Technical Part Fall 2010

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

A VHDL 8254 Timer core

AMBA 3 AHB Lite Bus Architecture

Interfacing an Intel386 TM EX Microprocessor to an CAN Controller

Question Total Possible Test Score Total 100

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. Spring 2010 May 10, 2010

Design of Microprocessor-Based Systems Part II

CS303 LOGIC DESIGN FINAL EXAM

Microcontroller basics

1 Contents 2 2 Overview 3 3 Hardware Interface 4 4 Software Interface Register Map Interrupts 6 5 Revision History 8

Chapter 1: Basics of Microprocessor [08 M]

Digital Design with FPGAs. By Neeraj Kulkarni

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Ref: AMBA Specification Rev. 2.0

Topics. Midterm Finish Chapter 7

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AN:p ENGINEERING. ECE241F - Digital Syst~ms Final Examination

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

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

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

EECS 452 Midterm Closed book part Fall 2010

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

EE 109L Review. Name: Solutions

Exam 1. Date: February 23, 2018

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

problem maximum score 1 8pts 2 6pts 3 10pts 4 15pts 5 12pts 6 10pts 7 24pts 8 16pts 9 19pts Total 120pts

Verilog for Synthesis Ing. Pullini Antonio

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

ECE 551 Digital System Design and Synthesis. Instructor: Kewal K. Saluja. Midterm Exam

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

Code No: R Set No. 1

VLSI DESIGN OF AMBA BASED AHB2APB BRIDGE

CSE 466 Exam 1 Winter, 2010

Microcomputers. Outline. Number Systems and Digital Logic Review

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

EECS 470 Midterm Exam Fall 2006

Digital Integrated Circuits

Scheme G. Sample Test Paper-I

EE 109L Final Review

EECS 470 Midterm Exam

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Name: University of Michigan uniqname: (NOT your student ID number!)

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

University of Florida EEL 3744 Spring 2017 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 22 February Mar-17 1:44 PM

Problem Set 10 Solutions

Control in Digital Systems

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

ENEE245 Digital Circuits and Systems Lab Manual

Q1: /20 Q2: /30 Q3: /24 Q4: /26. Total: /100

Lecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

University of Florida EEL 4744 Summer 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 July Oct-14 6:41 PM

Interconnects, Memory, GPIO

System Design Kit. Cortex-M. Technical Reference Manual. Revision: r0p0. Copyright 2011 ARM. All rights reserved. ARM DDI 0479B (ID070811)

Transcription:

Exam #: EECS 373 Practice Midterm / Homework #3 Fall 2014 Name: Uniquename: Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so. Scores: Problem # Points 1 /10 2 /10 3 /15 4 /20 5 /15 6 /10 7 /10 8 /10 Total /100 NOTES: PUT YOU NAME/UNIQUENAME ON EVERY PAGE TO ENSURE CREDIT! Can refer to the ARM Assembly Quick Ref. Guide and 1 page front/back cheat sheet Can use a basic/scientific calculator (but not a phone, PDA, or computer) Don t spend too much time on any one problem. You have 80 minutes for the exam. The exam is 9 pages long, including the cover sheet. Show your work and explain what you are doing. Partial credit w/o this is rare.

1) Fill-in-the-blank or circle the best answer. [10 pts, all or no points for each question] a) The ARM EABI specifies that the first parameter of a function call should be stored in register and the return address is stored in register. b) The ARM Thumb-2 instruction set has 16-bit / 32-bit / 16- and 32-bit encodings. c) A 40 MHz clock with a 20% duty cycle is high for ns per cycle. d) An ARM EABI-compliant procedure that calls another procedure should always / sometimes / never save and restore the lr register. e) The SPI bus does / does not support flow control using the ACK bit. f) A UART / SPI / I2C is an asynchronous communications interface. g) I2C bus transfers are asynchronous / synchronous and use dedicated chip select lines / addresses embedded in frames. h) In the Verilog hardware description language, an @(posedge clock) block would be used when implementing a mux / adder / flip-flop / priority encoder. i) If multiple devices share a single interrupt line and generate interrupts at the same rate, then processor workload remains constant / grows linearly / grows quadratically with the number of devices. j) The RESET vector and initial stack pointer goes in the.text /.data /.bss section. 2/9

2) Assembly, C, and the ABI. Consider the following program. [10] /** * Print an int. */ void printint(int a) { printf("%d\n", a); } /** * Sum the first n elements of array a. */ int add(int a[], int n) { int i, sum=0; for (i = 0; i < n; i++) sum+=a[i]; printint(sum); return(sum); } /** * Test program. Should print out 10. */ main () { int x[] = {1, 2, 3, 4, 5}; add(x, 4); } Rewrite only the add function in ARM assembly, and make sure that your code conforms to the EABI for both the callee part (saving the registers, handing input parameters, etc.) and the caller part (passing parameters for the printint call, etc.). Do not use recursion to implement your code. The assembly code should assemble without errors. Write clearly and comment the code. 3/9

3) ARM Assembly Language. [15] a) Assume you wrote the ARM assembly language instruction: add r9, r9, r11 What is the machine encoding of this instruction in hex? Use the table below. [5] Machine Code: b) Assume that r3=0xaabbccdd and r1=0x00001000, and all other registers and memory are initialized to zero. After running the following code, what are the values of registers r1, r3, and r5? Annotate each line of code to show your partial results. [5] str r3, [r1, #1] ldrb r5, [r1], #2 orr r5, r5, #0x0f strh r3, [r1, #-4]! ldr r3, [r1] r1 = r3 = r5 = c) Convert the following 16-bit, two s complement hex numbers into signed decimal. [5] Hex Decimal ====== ======= 0x1000 0xfffc 0xffff 4/9

4) Memory-Mapped I/O. [20] a) Assume you have a memory-mapped register location REG_FOO on a 32-bit architecture. Modify main to add 7 to REG_FOO s value. Your code should compile without any warnings. [10] #include <stdio.h> #include <inttypes.h> #define REG_FOO 0x40000140 main () { // Your code here to declare reg and // add 7 to REG_FOO s value. } printf( 0x%x\n, *reg); // Prints out new value b) Sketch the glue logic needed to interface a D flip-flop (DFF) to the APB. The PSEL line is the peripheral select (i.e. it goes high when the processor is addressing the DFF). The DFF will be attached to data bits zero (PWDATA[0] and PRDATA[0]), perhaps through tri-state drivers. You should be able to change the value of the DFF by writing the memory location corresponding to the PSEL and read the current value of the DFFs by reading the location. Assume that the DFF has an enable (ENA) line that, when not asserted, ignores any inputs (e.g. D and CLK) but continues to drive Q and Q#. The APB signals are: PCLK, PADDR, PWRITE, PSEL, PENABLE, PWDATA, PRDATA. [10] 5/9

5) Serial Buses. [15] a) I2C. The standard-mode I2C specification uses open-drain logic. Under this scheme, bus devices drive the SCL and SDA bus lines low (to 0 V) but rely on a shared, external pullup resistor (typically 10 kω) to send a high bit (at 3.3V or 5V) by pulling-up the bus line. How long will a low-to-high transition take, after the SDA line has been at 0V for a long time, if low is 0 V, VCC is 3 V, a high is 80% of VCC (e.g. 2.4 V), the aggregate bus capacitance is 50 pf, and a 10 kω pull-up resistor is used? Show your work. [8] b) Assume you have four devices connected to a microcontroller over a shared I2C bus that is running at 400 khz and using standard addressing. If the microcontroller reads one data byte from each of the four devices sequentially, what is the maximum data transfer rate in bits/second possible from each device? You analysis should report the useful data that are delivered per unit time. Note that time includes both the time required to send useful data and the time required for communication overhead (e.g. any start/stop/ack bits, addressing bytes, etc.). Show your work. [7] 6/9

6) Logic Design. Design a digital circuit that takes an input clock of 100 MHz clock (CLKIN) and converts it into an output clock of 5 MHz with a 30% duty cycle (CLKOUT). You may use synchronously resettable D flip-flops and n-bit binary counters (make sure to specify the value of n). You may express combinational logic as Boolean expressions or using standard logic gates. Label things and write neatly. [10] 7/9

7) Say your code writes the value 0x76543210 to memory location 0x20000604, on an ARM Cortex-M3. Assume this memory location sits in an SRAM with no access delay (i.e. a zero wait state). If you could attach a logic analyzer to the AHB bus, draw a timing diagram that shows what you would expect to see on the logic analyzer for this write operation. Make sure the actual values being transferred on the bus are clearly labeled. [10] AHB Bus FCLK ^ ^ ^ ^ HADDR[31:0] HWRITE HWDATA[31:0] HREADY(OUT) 8/9

8) Write a C function void enable_interrupts(int x) that enables interrupt x. You need not check to validate that x is a legal interrupt number. The table below might be useful. [10] void enable_interrupts(int x) { } 9/9