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

Similar documents
Block diagram of processor (Harvard)

PHYS 319. Things to do before next week's lab Whirlwind tour of the MSP430 CPU and its assembly language Activity 1.

Lecture test next week

Before next weeks lab:

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

Interrupts CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

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

Using peripherals on the MSP430 (if time)

MICROPROCESSOR BASED SYSTEM DESIGN

CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA)

Introduction to general architectures of 8 and 16 bit micro-processor and micro-controllers

CONTENTS: Program 1 in C:

Today's plan: Announcements General Strategy Microcontroller programming concepts/last bits of assembly Activity 2

CPE/EE 323 Introduction to Embedded Computer Systems Homework III

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview

CPU: SOFTWARE ARCHITECTURE INSTRUCTION SET (PART

Hacettepe University

CPE 323 Introduction to Embedded Computer Systems: MSP430: Assembly Language and C. Instructor: Dr Aleksandar Milenkovic Lecture Notes

Getting Started with the MSP430 IAR Assembly

Texas Instruments Mixed Signal Processor Tutorial Abstract

Create and Add the Source File

Interrupts, Low Power Modes

MICROCONTROLLERS 8051

Wireless Sensor Networks (WSN)

Microcontrollers. Microcontroller

ECE2049 E17 Lecture 4 MSP430 Architecture & Intro to Digital I/O

Lecture 5: MSP430 Interrupt

Common Computer-System and OS Structures

Why embedded systems?

CPE 323 MSP430 MSP430 Assembly Language Programming


Week 4: Embedded Programming Using C

What is an Interrupt?

Organization in Memory

C Language Programming

Befehle des MSP430. ADC Add carry to destination. ADD Add source to destination. ADDC[ Add source and carry to destination

Microcomputer Architecture and Programming

Computer Architecture and System Software Lecture 06: Assembly Language Programming

Microprocessors and Microcontrollers. Assignment 1:

Chapter 8 Architecture and Instruction Set

Digital Blocks Semiconductor IP

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

EE 332 Real Time Systems Midterm Examination Solution Friday February 13, :30 pm to 4:30 pm

8051 microcontrollers

MSP430 instruction set *

Microprocessor Systems

AVR Microcontrollers Architecture

Review Activity 1 CALL and RET commands in assembler

ECE2049-E18 Lecture 6 Notes 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

Digital Blocks Semiconductor IP

Description of the Simulator

8051 Microcontrollers

8051 Overview and Instruction Set

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Intel Instruction Set (gas)

Designing for Ultra-Low Power with MSP430

EKT222 Miroprocessor Systems Lab 5

Fig 1. Block diagram of a microcomputer

Tutorial 1: Programming Model 1

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

MICROPROCESSOR MEMORY ORGANIZATION

Module Contents of the Module Hours COs

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

Have difficulty identifying any products Not incorporating embedded processor FPGA or CPLD In one form or another

Chapter 7 Central Processor Unit (S08CPUV2)

CS401 - Computer Architecture and Assembly Language Programming Glossary By

538 Lecture Notes Week 1

Basic System Memory Architecture View (Functional)

Digital Blocks Semiconductor IP

Microcontrollers. vs Microprocessors

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

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

MSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send)

Introduction to Embedded Systems

Getting Started with the Texas Instruments ez430

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Accumulator and memory instructions 1. Loads, stores, and transfers 2. Arithmetic operations 3. Multiply and divide 4. Logical operations 5. Data test

ET2640 Microprocessors

TYPES OF INTERRUPTS: -

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang

x86 architecture et similia

@databasescaling Wednesday, 18 th April 2013

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

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

PART - B (Answer all five units, 5 X 10 = 50 Marks)

MSP430. More on MSP430

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

ECE2049-E17 Lecture 6 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

CSE 351 Midterm - Winter 2015

C Language Programming, Interrupts and Timer Hardware

Set No.1. Code No: R


Lab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

EEE111A/B Microprocessors

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

CSE351 Autumn 2012 Midterm Exam (5 Nov 2012)

UNIT 2 (ECS-10CS72) VTU Question paper solutions

Computer Systems Lecture 9

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

Transcription:

CSE421-Microprocessors & Microcontrollers-Spring 2013 (March 26, 2013) NAME: MIDTERM#1 1- (2pts) What does MSP stand for in MSP430? Why? Mixed Signal Processor. It contains both analog and digital circuitry. 2-(3pts) What is the difference between Von Neumann & Harvard processor architectures? In Harvard Architecture, the volatile (data) and nonvolatile (program) memories are treated as separate systems,each with its own address and data bus. In von Neumann Architecture, there is only a single memory system in the von Neumann or Princeton architecture. Thismeans that only one set of addresses covers both the volatile and nonvolatile memories. 3- (5pts) List the differences between a microprocessor and a microcontroller. A microprocessor contains a complete digital processor,which includes at least the arithmetic logic unit and associated registers. A microprocessor needs many other components to support it. These include a (large) external memory and the other components that can be found on the motherboard of a personal computer. The integration of as many functions as possible on to the same chip as the processor gives rise to the microcontrollers. Microcontrollers have nearly fixed hardware built around a central processingunit (CPU).The CPU controls a range of peripherals, which may provide both digitaland analog functions such as timers and analog-to-digital converters. Small devices usually include both volatile and nonvolatile memory on the chip but larger processorsmay need separate memory. Their operation is usually programmed using a languagesuch as C or C++. Microprocessors have larger address bus (32, 64-bit) whereas microcontrollers can address (8, 16-bit) a small memory with no paging or banking. OS can run on microprocessors whereas small microcontrollers are unlikely to use an OS at all. Sometimes, a specialized real-time OS (RTOS) is used in microcontrollers for real-time apps. 1

4- (30pts) For the following machine code, write down the corresponding instruction. Refer to cheat sheet. a. (5pts) 0x4031 03B6 MOV.W #0x03b6,SP b. (5pts) 0x8DFB FFF5 SUB.B @R13+,0xfff5(R11) c. (5pts) 0xF6EF 4031 AND.B @R6,0x4031(R15) d. (5pts) 0xD2E2 002A BIS.B #4, 2Ah(SR) e. (5pts) 0x40B2 5A80 0120 MOV.W #5A80, 0x0120(SR) f. (5pts) 0x1005 RRC.w R5 5- (10pts) Consider the machine code 0x23FE. You are also given the PC value as 0x312a. a. (5pts) Tell me which jump instruction is being executed. JNE/JNZ offset=0x3fe b. (5pts) Calculate the new PC value for the case when the status register zero bit (Z) is 0. Refer to Fig. 2. If status register zero bit is 0 and no jump happens. Therefore, new PC= 0x312c. If status register zero bit is 1 and jump happens. Therefore, new PC= 0x312a +2+(-4) = 0x3128 because (0x3FE *2 = 0x3FC = -0x004 (two s complement)) 6- (10pts) Write the assembly for the following: while (! (P1IN & 0x01)); go: BIT.B #1, &P1IN JEQ go 2

7-(10pts) Convert the following C-code into assembly. Complete the corresponding assembly below the C-code. C-code: #include <msp430xg46x.h> void main (void){ volatile unsigned int i; WDTCTL = WDTPW WDTHOLD; P2DIR = 0x04; //Stop Watchdog Timer //Configure P2.2 as Output } while(1){ i=30000; do (i--); while (i!=0); P2OUT ^= 0x04; } //Infinite loop //Delay //Toggle Port P2.2 using an exclusive-or Assembly: - LOOP mov.w #0x7530,0x0000(SP) DECREMENT dec.w 0x0000(SP) tst.w 0x0000(SP) jne DECREMENT xor.b #4,&P2OUT ;Toggle P2.2 using an exclusive-or jmp LOOP ;Infinite loop 3

8-(12pts) Use the assembly that you wrote in question 7. Define a subroutine called DELAY. - bis.b #4,&P2OUT ; Configure P2.2 as Output LOOP call #DELAY xor.b #4,&P2OUT ;Toggle P2.2 using an exclusive-or jmp LOOP ;Infinite loop DELAY sub.w #2,SP ; Allocate 1 word (2 bytes) on stack mov.w #0x7530,0x0000(SP) DECREMENT dec.w 0x0000(SP) tst.w 0x0000(SP) jne DECREMENT add.w #2,SP ; Yes: finished, release space on stack ret 9-(10pts) The assembly in question 8 is re-written such that the delay value is passed as an argument. Fill in the blanks accordingly. - bis.b #4,&P2OUT ; Configure P2.2 as Output push.w #0x7530 ; Push delay parameter on to stack LOOP call #DELAY incd.w SP ; Release space used for parameter xor.b #4,&P2OUT ; Toggle P2.2 using an exclusive-or jmp LOOP ; Infinite loop DELAY; DECREMENT dec.w 0x4(SP) tst.w 0x4(SP) jne DECREMENT ret 10-(8pts) What happens when an interrupt is requested in MSP430? The PC and SR are pushed on the stack. What happens after the interrupt service routine? First SR pops, and next PC pops from the stack. 4

CHEAT SHEET Fig.1 Format I (Double Operand Instruction) Fig.2 Jump InstructionFormat Fig.3 Single Operand InstructionFormat Fig.4 Addressing modes Fig.5. MSP430 Instruction Set 5