Top Banner
SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign
18

SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

Mar 30, 2015

Download

Documents

Danna McGarry
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

SPIMbot: An Engaging, Problem-based Approach to Teaching

Assembly Language Programming

Craig ZillesUniversity of Illinois at Urbana-

Champaign

Page 2: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

2SPIMbot SIGCSE 2005 Craig Zilles

Executive Summary

Goal: Teaching assembly language in a way that Is motivating to students Scales to large enrollment classes Makes teaching fun

Two contributions: A tool: SPIMbot

Program virtual robots using assembly language A pedagogy: open-ended programming

contest A creative design/optimization opportunity

Page 3: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

3SPIMbot SIGCSE 2005 Craig Zilles

Motivating Students

One of the keys to learning is engagement:

Time plus energy equals learning. There is no substitute for time on task.

-Chickering and Gamson

We should design out-of-class work that our students work on willingly!

Page 4: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

4SPIMbot SIGCSE 2005 Craig Zilles

The Challenge, My Inspiration

Assembly language can be Tedious Error prone

Using robots to teach assembly language A UTEP computer architecture class Patricia Teller’s WCAE 2003 presentation

Page 5: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

5SPIMbot SIGCSE 2005 Craig Zilles

Why Robots?

They are inherently cool Something visceral about controlling

something Visual feedback

Non-contrived uses of I/O and interrupts Sensors, actuators, etc.

Problem-based assignments Engineering students like solving problems More on this later.

Page 6: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

6SPIMbot SIGCSE 2005 Craig Zilles

But, Difficulties with Robots

Physical robots … Must be purchased Require lab facilities Must be scheduled (if less than # of students) Must be maintained/upgraded

UIUC CS 232 has 100-150 students/semester 1 Professor and 2-3 TAs.

Page 7: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

7SPIMbot SIGCSE 2005 Craig Zilles

Virtual Robots

Achieve most of the benefits of real ones Modern ugrads happy with virtual

environments

Without cost, space, hassle, maintenance

Not constrained by real physics make environment emphasize desired

concepts

Page 8: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

8SPIMbot SIGCSE 2005 Craig Zilles

SPIMbot

extends Jim Larus’s widely used SPIM Available under an open source license

Models robot & interactions w/virtual world Updates world after every instruction

Display using simple X primitives Portable, minimal resources, not distracting

Emulates multiple robots simultaneously Organized for new scenario development

Page 9: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

9SPIMbot SIGCSE 2005 Craig Zilles

Page 10: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

10SPIMbot SIGCSE 2005 Craig Zilles

SPIMbot Demonstration

Page 11: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

11SPIMbot SIGCSE 2005 Craig Zilles

How Do I Use SPIMbot?

Goals: Let them practice what they’ve learned

Or so they learn

Have students write non-trivial programs A challenging, open-ended assignment

Exposure to the design (& optimization) process

Push the students to their abilities

But provide a graceful learning curve Start with structured assignments

Page 12: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

12SPIMbot SIGCSE 2005 Craig Zilles

How Do I Use SPIMbot? (cont.)

Tightly integrated assignments: 3 structured machine problems (MPs) An open-ended design contest

MPs introduce concepts, provide code which can be integrated into contest entry.

Introduce contest first: MPs serve as a bottom up implementation

Page 13: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

13SPIMbot SIGCSE 2005 Craig Zilles

SPIMbot Token Collection Scenario

Page 14: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

14SPIMbot SIGCSE 2005 Craig Zilles

Example Contest: Token Collection

SCAN: Request scan (I/O writes), wait, receive interrupt

TRAVERSE: Scan returns data encoded in a tree Must traverse the tree to find token locations

COLLECT: Orient to token (arctangent approximation), Drive,

Repeat

Page 15: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

15SPIMbot SIGCSE 2005 Craig Zilles

Structured MPs Leading to Contest

MP#1: interpret command seq. to control SPIMbot Control flow (if, loop), functions, simple I/O

MP #2: tree traversal & arctangent approximation Recursion, linked data structures, floating point

MP #3: simple interrupt handler and scanner I/O, interrupt handling, initial integration

Page 16: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

16SPIMbot SIGCSE 2005 Craig Zilles

Optimization: Pipelining

Scan part of the screen at a time Overlap scanning, traversing, and

collecting Waiting for scan? Drive to center of

region

Page 17: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

17SPIMbot SIGCSE 2005 Craig Zilles

Student Reaction

Enjoyment: Overwhelmingly positive

“I really liked the SpimBot Tournament. That was the coolest thing I have done in a class.”

Engagement: 75% of students attempt optimization (Spring 04)

See paper for example descriptions students report spending 10-20 hours/person (Fa 05)

Page 18: SPIMbot: An Engaging, Problem-based Approach to Teaching Assembly Language Programming Craig Zilles University of Illinois at Urbana-Champaign.

18SPIMbot SIGCSE 2005 Craig Zilles

Summary

Best learning occurs when self-motivated Make the students want to complete

homework

SPIMbot: a MIPS programmable robot Open source, scalable, and fun!

SPIMbot tournament: friendly competition A creative challenge for students

http://www-faculty.cs.uiuc.edu/~zilles/spimbot/