ECE251: Thursday September 13

Size: px
Start display at page:

Download "ECE251: Thursday September 13"

Transcription

1 ECE251: Thursday September 13 Lab 9: Some Details Stack and Subroutines, continued--chapter 8 Stack Example SUBROUTINES More Details Initializing the Stack/Pointer Passing Parameters to Subroutines via Registers Homework #2 is due today at 4 pm Homework #3 will be due in two weeks- Sept. 27 Lab 3 continues next week. Lab 4 online soon. Mid-Term Exam is 3 weeks from today: October 4 Practical Exam 1 is week of October 8 during lab 1

2 Lab 9: Independent Lab Project Objectives: This lab will give you the opportunity to apply your understanding of the TM4C processor to creating and completing an independent project. In this lab, you will learn: How to evaluate possible projects by your interest and your likely ability to complete that project. How to manage your time on a project that can span half a semester or more. How to document your lab results in the form of a project description that future students could use. More about some specific technology, based on your project choice. HAVE FUN with this project! 2

3 Lab 9: Input Device Ideas Input Devices and units on hand Microphone Sensor Module: Amazon: DAOKI High Sensitivity Sound Microphone Sensor Detection Module KY-037 Module(PDF) Water Level Sensor GPS Module Data Sheet(PDF) Amazon: Water Sensor AliExpress: GY-NEO6MV2 NEO-6 Data Sheet 60 KHz WWVB Receiver Amazon: Receiver MAS6180C Data Sheet Plus much more online info Tilt Ball Switch Sensor 4+ Units oddwires: Tilt/Ball Switch Sensor Amazon: Gikfun Tilt Switch Sensor Infrared Body Motion Sensor Amazon: Gowoops HC-SR501 Ultrasonic Distance Sensor 3

4 Lab 9: Output Device Ideas Output Devices and units on hand LED Single Color Many Units Amazon: LEDs with resistors LED RGB Many Units Kingbright Full Color LED (PDF) LED Matrix Display Driver 4 Units MAX7219 8x8 Display (PDF) LED Display Driver Active Buzzer 5 v. 4+ Units Amazon: CYT1036 Cylewet 5v. Active Buzzer Instructables: How to Use a Buzzer Passive Buzzer 3-12 v. 5 V Relay Module Amazon: KY-019 CHENBO 1Channel Relay Module 1 Digit 7-Segment Display Many Units Jameco Tech Tips User Manual (PDF) Stepper Motors 5 Units 4

5 Lab 9: Next Steps Create a Written Project Proposal for TA Discussion Week after Practical #1; i.e. week of October 15 No Particular Proposal Structure Required Basis for Creating a Project Commitment a few weeks later Use Online Course Documents regarding Project Options and Device Ideas This Proposal Will be 10% of your Lab 9 Grade Spend some time and thought on this Discuss with your TA and/or Instructor and/or Grader Be sensitive to possible difficulty with project. Keep it relatively simple. Will be easy to add to it later (with TA approval). 5

6 Review: Calling a Subroutine BL label (Branch and Link) Step 1: LR = PC + 4 Step 2: PC = label Notes: label is name of subroutine Assembler translates label to memory address After call, LR holds return address (the instruction following the BL instruction) Caller Program MOV r4, # BL foo... Subroutine/Callee foo... MOV r4, #

7 Review: Exiting a Subroutine (Branch and Exchange) PC = LR Caller Program MOV r4, # BL foo... Subroutine/Callee foo... MOV r4, #

8 Subroutine Calling Another Subroutine MAIN QUAD PUSH {LR} Function MAIN Function QUAD Function What s happening in this code? What s at ENDL? Why did we PUSH and later POP register LR in Subroutine QUAD? This is a KEY concept! 8

9 Subroutine Calling Another Subroutine MAIN QUAD PUSH {LR} Function MAIN Function QUAD Function 9

10 Example: = 4 xxxxxxxx 0x x200001FC 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x x QUAD PUSH {LR} 0x x x x A 0x E 0x x

11 Example: = 4 xxxxxxxx 0x x200001FC 0x02 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x x C QUAD PUSH {LR} 0x x x x A 0x E 0x x

12 Example: = 4 xxxxxxxx 0x x200001FC 0x02 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x x Preserve Link Register (LR) QUAD PUSH {LR} 0x x x x A 0x E 0x x

13 Example: = 4 xxxxxxxx 0x x200001FC 0x02 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x A QUAD PUSH {LR} 0x x x x A 0x E 0x x

14 Example: = 4 xxxxxxxx 0x x200001FC 0x02 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x E 0x QUAD PUSH {LR} 0x x x x A 0x E 0x x

15 Example: = 4 xxxxxxxx 0x x200001FC 0x04 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x E 0x QUAD PUSH {LR} 0x x x x A 0x E 0x x

16 Example: = 4 xxxxxxxx 0x x200001FC 0x04 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x E 0x E QUAD PUSH {LR} 0x x x x A 0x E 0x x

17 Example: = 4 xxxxxxxx 0x x200001FC 0x04 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x x QUAD PUSH {LR} 0x x x x A 0x E 0x x

18 Example: = 4 xxxxxxxx 0x x200001FC 0x10 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x x QUAD PUSH {LR} 0x x x x A 0x E 0x x

19 Example: = 4 xxxxxxxx 0x x200001FC 0x10 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x200001FC 0x x QUAD PUSH {LR} 0x x x x A 0x E 0x x

20 Example: = 4 xxxxxxxx 0x x200001FC 0x10 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x x Recover Link Register (LR) QUAD PUSH {LR} 0x x x x A 0x E 0x x

21 Example: = 4 xxxxxxxx 0x xxxxxxxx 0x200001FC 0x10 0x200001F8 0x x C QUAD PUSH {LR} SP LR PC 0x QUAD PUSH {LR} 0x x x x A 0x E 0x x

22 Initializing the Stack/Pointer Before USING the Stack, that block of memory must be reserved, and the STACK POINTER (SP) initialized to point to the appropriate address in R/W memory. The TM4C Processor doesn t know where it will be. The uvision software doesn t know where it will be. Your program doesn t need to know where it will be! This is handled by the Startup.s file you import into your project. It creates a 0x400 byte stack with the appropriate initial value for SP for this stack. See some sample code following. Startup is similar. Check it next time you run your software with Vision! Hint: This could be a homework or quiz question! 22

23 Initializing stack in startup code ; Stack Area ;*************************************************************** ;LABEL DIRECTIVE VALUE COMMENT Stack EQU 0x ; stack size AREA STACK, NOINIT, READWRITE, ALIGN=3 StackMem SPACE Stack ;*************************************************************** ; Reset Area ;*************************************************************** ;LABEL DIRECTIVE VALUE COMMENT AREA RESET, CODE, READONLY THUMB Vectors EXPORT Vectors DCD StackMem + Stack ; Top of Stack DCD Reset_Handler ; Reset Handler ;*************************************************************** 23

24 Register ARM Procedure Call Standard Interesting, but not key information in ECE 251 Usage Subroutine Preserved r0 Argument 1 and return value No Notes If return has 64 bits, then r0:r1 hold it. If argument 1 has 64 bits, r0:r1 hold it. r1 Argument 2 No r2 Argument 3 No If the return has 128 bits, r0-r3 hold it. r3 Argument 4 No If more than 4 arguments, use the stack r4 General-purpose V1 Yes Variable register 1 holds a local variable. r5 General-purpose V2 Yes Variable register 2 holds a local variable. r6 General-purpose V3 Yes Variable register 3 holds a local variable. r7 General-purpose V4 Yes Variable register 4 holds a local variable. r8 General-purpose V5 YES Variable register 5 holds a local variable. r9 Platform specific/v6 No Usage is platform-dependent. r10 General-purpose V7 Yes Variable register 7 holds a local variable. r11 General-purpose V8 Yes Variable register 8 holds a local variable. r12 (IP) Intra-procedure-call register No It holds intermediate values between a procedure and the sub-procedure it calls. r13 (SP) Stack pointer Yes SP has to be the same after a subroutine has completed. r14 (LR) Link register No LR does not have to contain the same value after a subroutine has completed. r15 (PC) Program counter N/A Do not directly change PC 24

25 Procedure Call Standard Low Registers 32 bits R1 R2 R3 R4 Not saved. Hold arguments, results, or temporary values. Caller shouldn t expect them to be retained. R5 R6 R7 R8 General Purpose Register Called must save them. Caller expects these values are retained. High Registers R9 R10 R11 32 bits xpsr Link Register R12 R13 (SP) R14 (LR) R15 (PC) R13 (MSP) R13 (PSP) BASEPRI PRIMASK FAULTMASK CONTROL Special Purpose Register 25

26 Example: R2 = *+R1*R1 (Inner Product) S... MUL R2,, MUL R3,R1,R1 ADD R2,R2,R

27 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R3 LR PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 27

28 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R3 LR 3 PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 28

29 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R3 LR 3 4 PC 0x C S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C B 0x x x x C 0x x x x A 29

30 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R3 LR 3 4 PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 30

31 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R3 Address of the next instruction after the branch is saved into LR. 3 4 LR 0x PC 0x C S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 31

32 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R LR 0x PC 0x C S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 32

33 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R LR 0x PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 33

34 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R LR 0x PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 34

35 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R LR 0x PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 35

36 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 25 R1 4 R2 25 R3 16 LR 0x Memory Address 0x x C 0x S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 PC 0x A S MUL R2,... MUL R3,... ADD R2,R3 0x x x C 0x x x x A 36

37 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R3 Copy LR to PC when returning from a subroutine! LR 0x PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 37

38 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R LR 0x PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 38

39 Passing Arguments to Subroutine via Registers Example: z = x 2 + y 2 S MUL R2,, MUL R3,R1,R1 ADD R2,R2,R3 R1 R2 R LR 0x PC 0x S MUL R2,... MUL R3,... ADD R2,R3 Memory Address 0x x C 0x x x x C 0x x x x A 39

40 For Loop sum=0 For i=0 to 10 sum=sum+i MOV r0, #0 ; i MOV r1, #0 ; sum loop endloop CMP r0, #10 ; ; 10 is loop limit BGE endloop ADD r1, r1, r0 ADD r0, r0, #1 B loop What is value in r1 when program gets to endloop? 40

41 While C then S Loop Construct loop CMP {Boolean comarison C} B{false} endloop ; execute instructions S here B loop endloop 41

42 Repeat S until C Loop Construct loop ; execute instructions S here endloop B{Condition C true} loop 42

43 Some Helpful Suggestions RTT*! It has important information and helpful examples. It will make a difference in understanding! Read the labs! Don t just skip to the lab procedures. The lab write-up has important information and will usually include lab prework. Read the lecture slides! They have useful examples. I.e. Start becoming a professional engineer using the key sources available to you! * Read The Textbook 43

44 Summary Lab #9 Intro Initializing the Stack space and SP Saving LR when needed Passing Parameters to subroutines via stack Next Lecture: Subroutines and passing info Recursive subroutines Debugging HW and SW 44

ECE251: Tuesday September 11

ECE251: Tuesday September 11 ECE251: Tuesday September 11 Finish Branch related instructions Stack Subroutines Note: Lab 3 is a 2 week lab, starting this week and covers the Stack and Subroutines. Labs: Lab #2 is due this week. Lab

More information

ECE251: Tuesday September 12

ECE251: Tuesday September 12 ECE251: Tuesday September 12 Finish Branch related instructions Stack Subroutines Note: Lab 3 is a 2 week lab, starting this week and covers the Stack and Subroutines. Labs: Lab #2 is due this week. Lab

More information

Stacks and Subroutines

Stacks and Subroutines Chapters 8 Stacks and Subroutines Embedded Systems with ARM Cortext-M Updated: Tuesday, March 6, 2018 Basic Idea llarge programs are hard to handle lwe can break them to smaller programs lthey are called

More information

ECE251: Tuesday September 18

ECE251: Tuesday September 18 ECE251: Tuesday September 18 Subroutine Parameter Passing (Important) Allocating Memory in Subroutines (Important) Recursive Subroutines (Good to know) Debugging Hints Programming Hints Preview of I/O

More information

ECE251: Thursday September 27

ECE251: Thursday September 27 ECE251: Thursday September 27 Exceptions: Interrupts and Resets Chapter in text and Lab #6. READ ALL this material! This will NOT be on the mid-term exam. Lab Practical Exam #1 Homework # due today at

More information

EE251: Tuesday September 5

EE251: Tuesday September 5 EE251: Tuesday September 5 Shift/Rotate Instructions Bitwise logic and Saturating Instructions A Few Math Programming Examples ARM Assembly Language and Assembler Assembly Process Assembly Structure Assembler

More information

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

ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018 ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018 (PRINT) Instructions: No calculators, books, or cell phones; do not communicate with any other student. One side of a single

More information

Computer Organization Laboratory. Class Notes. Instructor: Ken Q. Yang Dept. of ECE, URI

Computer Organization Laboratory. Class Notes. Instructor: Ken Q. Yang Dept. of ECE, URI Computer Organization Laboratory Class Notes Instructor: Ken Q. Yang Dept. of ECE, URI Section 0 Course Objectives, Plans, and Lab Tools Course Objectives: What to learn? Computer Architecture Concepts

More information

Subroutines and the Stack

Subroutines and the Stack 3 31 Objectives: A subroutine is a reusable program module A main program can call or jump to the subroutine one or more times The stack is used in several ways when subroutines are called In this lab

More information

EE251: Thursday September 20

EE251: Thursday September 20 EE251: Thursday September 20 Parallel I/O aka General Purpose I/O aka GPIO Common Devices: Switches, LEDs, Keypads Read Lab 4 carefully, and Chapter 14 in text Think about what you would like to review

More information

ARM PROGRAMMING. When use assembly

ARM PROGRAMMING. When use assembly ARM PROGRAMMING Bùi Quốc Bảo When use assembly Functions that cannot be implemented in C, such as special register accesses and exclusive accesses Timing-critical routines Tight memory requirements, causing

More information

Assembly Language Programming

Assembly Language Programming Experiment 3 Assembly Language Programming Every computer, no matter how simple or complex, has a microprocessor that manages the computer s arithmetical, logical and control activities. A computer program

More information

Programming the ARM. Computer Design 2002, Lecture 4. Robert Mullins

Programming the ARM. Computer Design 2002, Lecture 4. Robert Mullins Programming the ARM Computer Design 2002, Lecture 4 Robert Mullins 2 Quick Recap The Control Flow Model Ordered list of instructions, fetch/execute, PC Instruction Set Architectures Types of internal storage

More information

EE251: Tuesday October 23

EE251: Tuesday October 23 EE251: Tuesday October 23 Higher Frequency Clock via Phase Locked Loop TIMER MODULE: SysTick-Basis of next week s lab Section 12.4 and 18 in text describes our SysTick Section 2.5 of Valvano s Real Time

More information

Exam 1. Date: February 23, 2016

Exam 1. Date: February 23, 2016 Exam 1 Date: February 23, 2016 UT EID: 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:

More information

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

CprE 288 Introduction to Embedded Systems Course Review for Exam 3. Instructors: Dr. Phillip Jones CprE 288 Introduction to Embedded Systems Course Review for Exam 3 Instructors: Dr. Phillip Jones 1 Announcements Exam 3: See course website for day/time. Exam 3 location: Our regular classroom Allowed

More information

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

ARM Cortex-M4 Architecture and Instruction Set 4: The Stack and subroutines ARM Cortex-M4 Architecture and Instruction Set 4: The Stack and subroutines M J Brockway February 13, 2016 The Cortex-M4 Stack SP The subroutine stack is full, descending It grows downwards from higher

More information

ARM Architecture and Assembly Programming Intro

ARM Architecture and Assembly Programming Intro ARM Architecture and Assembly Programming Intro Instructors: Dr. Phillip Jones http://class.ece.iastate.edu/cpre288 1 Announcements HW9: Due Sunday 11/5 (midnight) Lab 9: object detection lab Give TAs

More information

Practical 1 Review. ECE Rick

Practical 1 Review. ECE Rick Practical 1 Review ECE 362 https://engineering.purdue.edu/ee362/ Rick Lab TA Survey We do a midterm review of lab TAs. Survey link is at the bottom of the "Lab Experiments" page. Complements? Criticism?

More information

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

Exam 1. EE319K Spring 2013 Exam 1 (Practice 1) Page 1. Date: February 21, 2013; 9:30-10:45am. Printed Name: 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

More information

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

EE319K Fall 2013 Exam 1B Modified Page 1. Exam 1. Date: October 3, 2013 EE319K Fall 2013 Exam 1B Modified Page 1 Exam 1 Date: October 3, 2013 UT EID: Printed Name: Last, First Your signature is your promise that you have not cheated and will not cheat on this exam, nor will

More information

EE4144: ARM Cortex-M Processor

EE4144: ARM Cortex-M Processor EE4144: ARM Cortex-M Processor EE4144 Fall 2014 EE4144 EE4144: ARM Cortex-M Processor Fall 2014 1 / 10 ARM Cortex-M 32-bit RISC processor Cortex-M4F Cortex-M3 + DSP instructions + floating point unit (FPU)

More information

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

Stack Frames. September 2, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 September 2, / 15 Stack Frames Geoffrey Brown Bryce Himebaugh Indiana University September 2, 2016 Geoffrey Brown, Bryce Himebaugh 2015 September 2, 2016 1 / 15 Outline Preserving Registers Saving and Restoring Registers

More information

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

EE319K (Gerstlauer), Spring 2013, Midterm 1 1. Midterm 1. Date: February 21, 2013 EE319K (Gerstlauer), Spring 2013, Midterm 1 1 Midterm 1 Date: February 21, 2013 UT EID: Printed Name: Last, First Your signature is your promise that you have not cheated and will not cheat on this exam,

More information

CM0506 Exploring the LPC4088 Instruction Set: 4b

CM0506 Exploring the LPC4088 Instruction Set: 4b CM0506 Exploring the LPC4088 Instruction Set: 4b Michael Brockway February 13, 2016 1 Introduction This lab activity continues exploring subroutine calling, this time looking at C or C++ code calling subroutines

More information

Advanced Assembly, Branching, and Monitor Utilities

Advanced Assembly, Branching, and Monitor Utilities 2 Advanced Assembly, Branching, and Monitor Utilities 2.1 Objectives: There are several different ways for an instruction to form effective addresses to acquire data, called addressing modes. One of these

More information

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

EE319K Spring 2015 Exam 1 Page 1. Exam 1. Date: Feb 26, 2015 EE319K Spring 2015 Exam 1 Page 1 Exam 1 Date: Feb 26, 2015 UT EID: 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

More information

Final Exam. Date: May 12, 2017

Final Exam. Date: May 12, 2017 Final Exam Date: May 12, 2017 UT EID: 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:

More information

Using the MIPS Calling Convention. Recursive Functions in Assembly. CS 64: Computer Organization and Design Logic Lecture #10 Fall 2018

Using the MIPS Calling Convention. Recursive Functions in Assembly. CS 64: Computer Organization and Design Logic Lecture #10 Fall 2018 Using the MIPS Calling Convention Recursive Functions in Assembly CS 64: Computer Organization and Design Logic Lecture #10 Fall 2018 Ziad Matni, Ph.D. Dept. of Computer Science, UCSB Administrative Lab

More information

Problem Sheet 1: ANSWERS (NOT ) (NOT ) 3. 37, ,

Problem Sheet 1: ANSWERS (NOT ) (NOT ) 3. 37, , Problem Sheet 1 1. Convert 512 10 toa16-bittwo's complement binarynumber [P&H, Ex.4.1] 2. Convert 1; 023 10 to a 16-bit two's complement binary number [P&H, Ex.4.2] 3. What hexadecimal number does the

More information

Systems Architecture The Stack and Subroutines

Systems Architecture The Stack and Subroutines Systems Architecture The Stack and Subroutines The Stack p. 1/9 The Subroutine Allow re-use of code Write (and debug) code once, use it many times A subroutine is called Subroutine will return on completion

More information

NET3001. Advanced Assembly

NET3001. Advanced Assembly NET3001 Advanced Assembly Arrays and Indexing supposed we have an array of 16 bytes at 0x0800.0100 write a program that determines if the array contains the byte '0x12' set r0=1 if the byte is found plan:

More information

Review Session 1 Fri. Jan 19, 2:15 pm 3:05 pm Thornton 102

Review Session 1 Fri. Jan 19, 2:15 pm 3:05 pm Thornton 102 Review Session 1 Fri. Jan 19, 2:15 pm 3:05 pm Thornton 102 1. Agenda Announcements Homework hints MIPS instruction set Some PA1 thoughts MIPS procedure call convention and example 1 2. Announcements Homework

More information

Programming with Arrays Intro to Pointers CS 16: Solving Problems with Computers I Lecture #11

Programming with Arrays Intro to Pointers CS 16: Solving Problems with Computers I Lecture #11 Programming with Arrays Intro to Pointers CS 16: Solving Problems with Computers I Lecture #11 Ziad Matni Dept. of Computer Science, UCSB Thursday, 5/17 in this classroom Starts at 2:00 PM **SHARP** Please

More information

Exam 1. Date: Oct 4, 2018

Exam 1. Date: Oct 4, 2018 Exam 1 Date: Oct 4, 2018 UT EID: Professor: Valvano 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

More information

CprE 288 Introduction to Embedded Systems ARM Assembly Programming: Translating C Control Statements and Function Calls

CprE 288 Introduction to Embedded Systems ARM Assembly Programming: Translating C Control Statements and Function Calls CprE 288 Introduction to Embedded Systems ARM Assembly Programming: Translating C Control Statements and Function Calls Instructors: Dr. Phillip Jones 1 Announcements Final Projects Projects: Mandatory

More information

Exam 1. Date: March 1, 2019

Exam 1. Date: March 1, 2019 Exam 1 Date: March 1, 2019 UT EID: 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:

More information

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

(2) Part a) Registers (e.g., R0, R1, themselves). other Registers do not exists at any address in the memory map (14) Question 1. For each of the following components, decide where to place it within the memory map of the microcontroller. Multiple choice select: RAM, ROM, or other. Select other if the component is

More information

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

Introduction to C. Write a main() function that swaps the contents of two integer variables x and y. Introduction to C Write a main() function that swaps the contents of two integer variables x and y. void main(void){ int a = 10; int b = 20; a = b; b = a; } 1 Introduction to C Write a main() function

More information

COMP 303 Computer Architecture Lecture 3. Comp 303 Computer Architecture

COMP 303 Computer Architecture Lecture 3. Comp 303 Computer Architecture COMP 303 Computer Architecture Lecture 3 Comp 303 Computer Architecture 1 Supporting procedures in computer hardware The execution of a procedure Place parameters in a place where the procedure can access

More information

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

EE319K Spring 2016 Exam 1 Solution Page 1. Exam 1. Date: Feb 25, UT EID: Solution Professor (circle): Janapa Reddi, Tiwari, Valvano, Yerraballi EE319K Spring 2016 Exam 1 Solution Page 1 Exam 1 Date: Feb 25, 2016 UT EID: Solution Professor (circle): Janapa Reddi, Tiwari, Valvano, Yerraballi Printed Name: Last, First Your signature is your promise

More information

MIPS Functions and Instruction Formats

MIPS Functions and Instruction Formats MIPS Functions and Instruction Formats 1 The Contract: The MIPS Calling Convention You write functions, your compiler writes functions, other compilers write functions And all your functions call other

More information

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

EE319K Exam 1 Summer 2014 Page 1. Exam 1. Date: July 9, Printed Name: EE319K Exam 1 Summer 2014 Page 1 Exam 1 Date: July 9, 2014 UT EID: 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

More information

CSCI 402: Computer Architectures. Instructions: Language of the Computer (3) Fengguang Song Department of Computer & Information Science IUPUI.

CSCI 402: Computer Architectures. Instructions: Language of the Computer (3) Fengguang Song Department of Computer & Information Science IUPUI. CSCI 402: Computer Architectures Instructions: Language of the Computer (3) Fengguang Song Department of Computer & Information Science IUPUI Recall Big endian, little endian Memory alignment Unsigned

More information

CS64 Week 5 Lecture 1. Kyle Dewey

CS64 Week 5 Lecture 1. Kyle Dewey CS64 Week 5 Lecture 1 Kyle Dewey Overview More branches in MIPS Memory in MIPS MIPS Calling Convention More Branches in MIPS else_if.asm nested_if.asm nested_else_if.asm Memory in MIPS Accessing Memory

More information

ESET 369 Embedded Systems Software, Fall 2017

ESET 369 Embedded Systems Software, Fall 2017 ESET 369 Embedded Systems Software, Fall 2017 Syllabus Contact Information: Professor: Dr. Byul Hur Office: Fermier 008A Telephone: (979) 845-5195 FAX: E-mail: byulmail@tamu.edu Web: rftestgroup.tamu.edu

More information

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

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

More information

Tutorial 1: Programming Model 1

Tutorial 1: Programming Model 1 Tutorial 1: Programming Model 1 Introduction Objectives At the end of this lab you should be able to: Use the CPU simulator to create basic CPU instructions Use the simulator to execute the basic CPU instructions

More information

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

Exam 1 Fun Times. EE319K Fall 2012 Exam 1A Modified Page 1. Date: October 5, Printed Name: EE319K Fall 2012 Exam 1A Modified Page 1 Exam 1 Fun Times Date: October 5, 2012 Printed Name: Last, First Your signature is your promise that you have not cheated and will not cheat on this exam, nor will

More information

Exam 1. Date: February 23, 2018

Exam 1. Date: February 23, 2018 Exam 1 Date: February 23, 2018 UT EID: 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:

More information

The ARM Cortex-M0 Processor Architecture Part-1

The ARM Cortex-M0 Processor Architecture Part-1 The ARM Cortex-M0 Processor Architecture Part-1 1 Module Syllabus ARM Architectures and Processors What is ARM Architecture ARM Processors Families ARM Cortex-M Series Family Cortex-M0 Processor ARM Processor

More information

Exam 1. Date: February 23, 2018

Exam 1. Date: February 23, 2018 Exam 1 Date: February 23, 2018 UT EID: 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:

More information

ECE 471 Embedded Systems Lecture 8

ECE 471 Embedded Systems Lecture 8 ECE 471 Embedded Systems Lecture 8 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 21 September 2018 Announcements HW#2 was due HW#3 will be posted today. Work in groups? Note

More information

Exam 1. Date: March 1, 2019

Exam 1. Date: March 1, 2019 Exam 1 Date: March 1, 2019 UT EID: 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:

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) More MIPS Machine Language

CS 61C: Great Ideas in Computer Architecture (Machine Structures) More MIPS Machine Language CS 61C: Great Ideas in Computer Architecture (Machine Structures) More MIPS Machine Language Instructors: Randy H. Katz David A. PaGerson hgp://inst.eecs.berkeley.edu/~cs61c/sp11 1 2 Machine Interpreta4on

More information

ECE254 Lab3 Tutorial. Introduction to MCB1700 Hardware Programming. Irene Huang

ECE254 Lab3 Tutorial. Introduction to MCB1700 Hardware Programming. Irene Huang ECE254 Lab3 Tutorial Introduction to MCB1700 Hardware Programming Irene Huang Lab3 Requirements : API Dynamic Memory Management: void * os_mem_alloc (int size, unsigned char flag) Flag takes two values:

More information

Support for high-level languages

Support for high-level languages Outline: Support for high-level languages memory organization ARM data types conditional statements & loop structures the ARM Procedure Call Standard hands-on: writing & debugging C programs 2005 PEVE

More information

ECE254 Lab3 Tutorial. Introduction to Keil LPC1768 Hardware and Programmers Model. Irene Huang

ECE254 Lab3 Tutorial. Introduction to Keil LPC1768 Hardware and Programmers Model. Irene Huang ECE254 Lab3 Tutorial Introduction to Keil LPC1768 Hardware and Programmers Model Irene Huang Lab3 Part A Requirements (1) A function to obtain the task information OS_RESULT os_tsk_get(os_tid task_id,

More information

ECE 473 Computer Architecture and Organization Project: Design of a Five Stage Pipelined MIPS-like Processor Project Team TWO Objectives

ECE 473 Computer Architecture and Organization Project: Design of a Five Stage Pipelined MIPS-like Processor Project Team TWO Objectives ECE 473 Computer Architecture and Organization Project: Design of a Five Stage Pipelined MIPS-like Processor Due: December 8, 2011 Instructor: Dr. Yifeng Zhu Project Team This is a team project. All teams

More information

Program SoC using C Language

Program SoC using C Language Program SoC using C Language 1 Module Overview General understanding of C, program compilation, program image, data storage, data type, and how to access peripherals using C language; Program SoC using

More information

CS 4110 Programming Languages & Logics. Lecture 35 Typed Assembly Language

CS 4110 Programming Languages & Logics. Lecture 35 Typed Assembly Language CS 4110 Programming Languages & Logics Lecture 35 Typed Assembly Language 1 December 2014 Announcements 2 Foster Office Hours today 4-5pm Optional Homework 10 out Final practice problems out this week

More information

E85 Lab 8: Assembly Language

E85 Lab 8: Assembly Language E85 Lab 8: Assembly Language E85 Spring 2016 Due: 4/6/16 Overview: This lab is focused on assembly programming. Assembly language serves as a bridge between the machine code we will need to understand

More information

ECE 471 Embedded Systems Lecture 12

ECE 471 Embedded Systems Lecture 12 ECE 471 Embedded Systems Lecture 12 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 25 September 2017 HW#4 was posted. Announcements 1 Homework 3 Be sure to put your name in the

More information

Lecture 6: Assembly Programs

Lecture 6: Assembly Programs Lecture 6: Assembly Programs Today s topics: Procedures Examples Large constants The compilation process A full example 1 Procedures Local variables, AR, $fp, $sp Scratchpad and saves/restores, $fp Arguments

More information

Control Instructions. Computer Organization Architectures for Embedded Computing. Thursday, 26 September Summary

Control Instructions. Computer Organization Architectures for Embedded Computing. Thursday, 26 September Summary Control Instructions Computer Organization Architectures for Embedded Computing Thursday, 26 September 2013 Many slides adapted from: Computer Organization and Design, Patterson & Hennessy 4th Edition,

More information

ece4750-tinyrv-isa.txt

ece4750-tinyrv-isa.txt ========================================================================== Tiny RISC-V Instruction Set Architecture ========================================================================== # Author :

More information

ARM Assembly Language. Programming

ARM Assembly Language. Programming Outline: ARM Assembly Language the ARM instruction set writing simple programs examples Programming hands-on: writing simple ARM assembly programs 2005 PEVE IT Unit ARM System Design ARM assembly language

More information

See P&H 2.8 and 2.12, and A.5-6. Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University

See P&H 2.8 and 2.12, and A.5-6. Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See P&H 2.8 and 2.12, and A.5-6 Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University Upcoming agenda PA1 due yesterday PA2 available and discussed during lab section this week

More information

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

EE 332 Real Time Systems Midterm Examination Solution Friday February 13, :30 pm to 4:30 pm EE 332 Real Time Systems Midterm Examination Solution Friday February 13, 2004 2:30 pm to 4:30 pm Student Name Student Number Question Mark #1 / 15 #2 / 20 #3 / 25 TOTAL / 60 General: Two hours (2:30 pm

More information

Interrupts and Low Power Features

Interrupts and Low Power Features ARM University Program 1 Copyright ARM Ltd 2013 Interrupts and Low Power Features Module Syllabus Interrupts What are interrupts? Why use interrupts? Interrupts Entering an Exception Handler Exiting an

More information

EE251: Thursday November 15

EE251: Thursday November 15 EE251: Thursday November 15 Major new topic: MEMORY A KEY topic HW #7 due today; HW #8 due Thursday, Nov. 29 Lab #8 finishes this week; due week of Nov. 26 All labs MUST be completed/handed-in by Dec.

More information

ECE 3610 MICROPROCESSING SYSTEMS

ECE 3610 MICROPROCESSING SYSTEMS 24.361 Lab. 4 31 ECE 3610 MICROPROCESSING SYSTEMS Laboratory 4 LAB 4: ASSEMBLER DIRECTIVES, THE STACK, SUBROUTINES, AND BUBBLE SORTING 1 INTRODUCTION This lab deals with the use of the stack and subroutines

More information

Procedures and Stacks

Procedures and Stacks Procedures and Stacks Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. March 15, 2018 L10-1 Announcements Schedule has shifted due to snow day Quiz 2 is now on Thu 4/12 (one week later)

More information

Assembly labs start this week. Don t forget to submit your code at the end of your lab section. Download MARS4_5.jar to your lab PC or laptop.

Assembly labs start this week. Don t forget to submit your code at the end of your lab section. Download MARS4_5.jar to your lab PC or laptop. CSC258 Week 10 Logistics Assembly labs start this week. Don t forget to submit your code at the end of your lab section. Download MARS4_5.jar to your lab PC or laptop. Quiz review A word-addressable RAM

More information

CprE 288 Translating C Control Statements and Function Calls, Loops, Interrupt Processing. Instructors: Dr. Phillip Jones Dr.

CprE 288 Translating C Control Statements and Function Calls, Loops, Interrupt Processing. Instructors: Dr. Phillip Jones Dr. CprE 288 Translating C Control Statements and Function Calls, Loops, Interrupt Processing Instructors: Dr. Phillip Jones Dr. Zhao Zhang 1 Announcements Final Projects Projects: Mandatory Demos Deadweek

More information

CSE /003, Fall 2014, Homework 4 Due October 7, 2014 in Class (at 2:00pm for 002, 3:30pm for 003)

CSE /003, Fall 2014, Homework 4 Due October 7, 2014 in Class (at 2:00pm for 002, 3:30pm for 003) CSE2312-002/003, Fall 2014, Homework 4 Due October 7, 2014 in Class (at 2:00pm for 002, 3:30pm for 003) The following problems are from Chapter 2 of the ARM Edition of the Patterson and Hennessy textbook

More information

More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6

More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6 More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6 Ziad Matni Dept. of Computer Science, UCSB Administrative CHANGED T.A. OFFICE/OPEN LAB

More information

ECE251: Tuesday Aug. 29

ECE251: Tuesday Aug. 29 ECE251: Tuesday Aug. 29 ARM Cortex Architecture: Data Movement Loading memory data into registers Storing register data into memory Indexed Addressing Reading: Chapters 1 and 5 Labs: #1 due this week at

More information

University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Final Examination

University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Final Examination University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Final Examination ECE 253F - Digital and Computer Systems Friday December 10, 2010 Duration:

More information

CS 61C: Great Ideas in Computer Architecture Strings and Func.ons. Anything can be represented as a number, i.e., data or instruc\ons

CS 61C: Great Ideas in Computer Architecture Strings and Func.ons. Anything can be represented as a number, i.e., data or instruc\ons CS 61C: Great Ideas in Computer Architecture Strings and Func.ons Instructor: Krste Asanovic, Randy H. Katz hdp://inst.eecs.berkeley.edu/~cs61c/sp12 Fall 2012 - - Lecture #7 1 New- School Machine Structures

More information

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 3: Toolchain, ABI, Memory Mapped I/O Sept. 12 th, 2018 Slides developed in part by Prof. Dutta 1 Announcements

More information

ECE 473 Computer Architecture and Organization Lab 4: MIPS Assembly Programming Due: Wednesday, Oct. 19, 2011 (30 points)

ECE 473 Computer Architecture and Organization Lab 4: MIPS Assembly Programming Due: Wednesday, Oct. 19, 2011 (30 points) ECE 473 Computer Architecture and Organization Lab 4: MIPS Assembly Programming Due: Wednesday, Oct. 19, 2011 (30 points) Objectives: Get familiar with MIPS instructions Assemble, execute and debug MIPS

More information

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

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design Professor Sherief Reda http://scale.engin.brown.edu School of Engineering Brown University Spring 2016 1 ISA is the HW/SW

More information

(5) Question 2. Give the two most important factors for effective debugging. Jonathan W. Valvano

(5) Question 2. Give the two most important factors for effective debugging. Jonathan W. Valvano EE445M/EE380L Quiz 1 Spring 2013 Page 1 of 5 First Name: Last Name: March 1, 2013, 10:00 to 10:50am Quiz 1 is a closed book exam. You may have one 8.5 by 11 inch sheet of hand-written crib notes, but no

More information

CS 110 Computer Architecture Lecture 6: More MIPS, MIPS Functions

CS 110 Computer Architecture Lecture 6: More MIPS, MIPS Functions CS 110 Computer Architecture Lecture 6: More MIPS, MIPS Functions Instructor: Sören Schwertfeger http://shtech.org/courses/ca/ School of Information Science and Technology SIST ShanghaiTech University

More information

ECE 471 Embedded Systems Lecture 12

ECE 471 Embedded Systems Lecture 12 ECE 471 Embedded Systems Lecture 12 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 1 October 2018 HW#4 was posted. Announcements Permissions! Unless your user is configured to

More information

F28HS Hardware-Software Interface. Lecture 10: ARM Assembly Language 5

F28HS Hardware-Software Interface. Lecture 10: ARM Assembly Language 5 F28HS Hardware-Software Interface Lecture 10: ARM Assembly Language 5 Software interrupt SWI operand operand is interrupt number halts program saves PC branches to interrupt service code corresponding

More information

Control Instructions

Control Instructions Control Instructions Tuesday 22 September 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary Previous Class Instruction Set

More information

ARM ASSEMBLY PROGRAMMING

ARM ASSEMBLY PROGRAMMING ARM ASSEMBLY PROGRAMMING 1. part RAB Računalniška arhitektura 1 Intro lab : Addition in assembler Adding two variables : res := stev1 + stev2 Zbirni jezik Opis ukaza Strojni jezik ldr r1, stev1 R1 M[0x20]

More information

11/10/2016. Review the Problem to Be Solved. ECE 120: Introduction to Computing. What Shall We Keep in the Registers? Where Are the Pieces in Memory?

11/10/2016. Review the Problem to Be Solved. ECE 120: Introduction to Computing. What Shall We Keep in the Registers? Where Are the Pieces in Memory? University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Letter Frequency Coding Review the Problem to Be Solved The task: given an ASCII

More information

CS 61C: Great Ideas in Computer Architecture. MIPS Instruction Formats

CS 61C: Great Ideas in Computer Architecture. MIPS Instruction Formats CS 61C: Great Ideas in Computer Architecture MIPS Instruction Formats Instructor: Justin Hsia 6/27/2012 Summer 2012 Lecture #7 1 Review of Last Lecture New registers: $a0-$a3, $v0-$v1, $ra, $sp Also: $at,

More information

ECE 471 Embedded Systems Lecture 5

ECE 471 Embedded Systems Lecture 5 ECE 471 Embedded Systems Lecture 5 Vince Weaver http://www.eece.maine.edu/ vweaver vincent.weaver@maine.edu 17 September 2013 HW#1 is due Thursday Announcements For next class, at least skim book Chapter

More information

Assembly Language Programming

Assembly Language Programming Assembly Language Programming ECE 362 https://engineering.purdue.edu/ee362/ Rick Reading and writing arrays Consider this C code again: int array1[100]; int array2[100]; for(n=0; n

More information

ARM Assembler Workbook. CS160 Computer Organization Version 1.1 October 27 th, 2002 Revised Fall 2005

ARM Assembler Workbook. CS160 Computer Organization Version 1.1 October 27 th, 2002 Revised Fall 2005 ARM Assembler Workbook CS160 Computer Organization Version 1.1 October 27 th, 2002 Revised Fall 2005 ARM University Program Version 1.0 January 14th, 1997 Introduction Aim This workbook provides the student

More information

Systems Architecture The ARM Processor

Systems Architecture The ARM Processor Systems Architecture The ARM Processor The ARM Processor p. 1/14 The ARM Processor ARM: Advanced RISC Machine First developed in 1983 by Acorn Computers ARM Ltd was formed in 1988 to continue development

More information

ARM Interrupts. EE383: Introduction to Embedded Systems University of Kentucky. James E. Lumpp

ARM Interrupts. EE383: Introduction to Embedded Systems University of Kentucky. James E. Lumpp ARM Interrupts EE383: Introduction to Embedded Systems University of Kentucky James E. Lumpp Includes material from: - Jonathan Valvano, Introduction to ARM Cortex-M Microcontrollers, Volume 1 Ebook, EE

More information

CMPSCI 201 Fall 2005 Midterm #2 Solution

CMPSCI 201 Fall 2005 Midterm #2 Solution CMPSCI 201 Fall 2005 Midterm #2 Solution Professor William T. Verts 10 Points Convert the decimal number -47.375 into (a) binary scientific notation (i.e., ±1.xxxx 2 Y ), and (b) the equivalent binary

More information

2) Using the same instruction set for the TinyProc2, convert the following hex values to assembly language: x0f

2) Using the same instruction set for the TinyProc2, convert the following hex values to assembly language: x0f CS2 Fall 28 Exam 2 Name: ) The Logisim TinyProc2 has four instructions, each using 8 bits. The instruction format is DR SR SR2 OpCode with OpCodes of for add, for subtract, and for multiply. Load Immediate

More information

Computer Organization & Assembly Language Programming (CSE 2312)

Computer Organization & Assembly Language Programming (CSE 2312) Computer Organization & Assembly Language Programming (CSE 2312) Lecture 16: Processor Pipeline Introduction and Debugging with GDB Taylor Johnson Announcements and Outline Homework 5 due today Know how

More information

CS 61C: Great Ideas in Computer Architecture More MIPS, MIPS Functions

CS 61C: Great Ideas in Computer Architecture More MIPS, MIPS Functions CS 61C: Great Ideas in Computer Architecture More MIPS, MIPS Functions Instructors: John Wawrzynek & Vladimir Stojanovic http://inst.eecs.berkeley.edu/~cs61c/fa15 1 Machine Interpretation Levels of Representation/Interpretation

More information