{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

DerekChiou_EE306_Spring2009_Lecture11

DerekChiou_EE306_Spring2009_Lecture11 - and a number of...

This preview shows pages 1–15. Sign up to view the full content.

© Derek Chiou Lecture 11: Programming (2) and Debugging Prof. Derek Chiou University of Texas at Austin

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2/25/2009 © Derek Chiou : EE306: Lecture 11 Recap LC-3 FSM Problem Solving (or, How to Program) Outline Continue with Programming Intro to Debugging 2
Greatest Common Divisor (1) GCD(a, b): If (b == 0) then a Else GCD(b, a mod b) 2/25/2009 © Derek Chiou : EE306: Lecture 11 3 b<-B == 0? a<-A Output a t = a mod b a <- b b <- a Is there a problem???

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Greatest Common Divisor GCD(a, b): If (b == 0) then a Else GCD(b, a mod b) 2/25/2009 © Derek Chiou : EE306: Lecture 11 4 b<-B == 0? a<-A Output a t = a mod b b<-t a<-b
A MOD B function 2/25/2009 © Derek Chiou : EE306: Lecture 11 5 t <- t - B > 0 t <- A == 0 t <- t + B

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
A MOD B function (improved) 2/25/2009 © Derek Chiou : EE306: Lecture 11 6 t <- t - B t <- A t <- t + B
Combined 2/25/2009 © Derek Chiou : EE306: Lecture 11 7 b<-B == 0? a<-A Output a b<-t a<-b t <- t - B t <- A t <- t + B

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Search For A Value in Memory Given a 16b value, a base address in memory,

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and a number of elements in memory, return the address of that value 2/25/2009 © Derek Chiou : EE306: Lecture 11 8 10 35 2-5 5 17 3044 1 0x100 0x101 0x102 0x103 0x104 0x105 0x106 0x107 17 2/25/2009 © Derek Chiou : EE306: Lecture 11 9 Sorting Given a base address and a number of elements in memory, sort them in-place 2/25/2009 © Derek Chiou : EE306: Lecture 11 10 10 35 2-5 5 17 3044 1 0x100 0x101 0x102 0x103 0x104 0x105 0x106 0x107 2/25/2009 © Derek Chiou : EE306: Lecture 11 11 Improved Search Given a sorted list, can we improve our search? 2/25/2009 © Derek Chiou : EE306: Lecture 11 12 10 35 2-5 5 17 3044 1 0x100 0x101 0x102 0x103 0x104 0x105 0x106 0x107 Translate to Code? 2/25/2009 © Derek Chiou : EE306: Lecture 11 13 Basic Constructs of Structured Programming 2/25/2009 © Derek Chiou : EE306: Lecture 11 14 Debugging 2/25/2009 © Derek Chiou : EE306: Lecture 11 15...
View Full Document

{[ snackBarMessage ]}

Page1 / 15

DerekChiou_EE306_Spring2009_Lecture11 - and a number of...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online