Optimized mult

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Optimized mult

stansbuj
A high school student of mine has optimized the multiplication. It looks to see which operand is the smaller value, and adds the larger value that many times. For 25 * 25, it makes no difference. But for 1000*2 or 2*1000, it makes a big difference in the amount of time to execute the multiply.

Jack Stansbury
Computer Science Teacher
Poolesville High School
Poolesville, MD
Reply | Threaded
Open this post in threaded view
|

Re: Optimized mult

cadet1620
Administrator
stansbuj wrote
A high school student of mine has optimized the multiplication. It looks to see which operand is the smaller value, and adds the larger value that many times. For 25 * 25, it makes no difference. But for 1000*2 or 2*1000, it makes a big difference in the amount of time to execute the multiply.
It's good that he's thinking about how to improve his program. It sounds like he may be the kind of student that would benefit from looking ahead to the multiplication discussion in section 12.1.1 and 12.3.1.

Is your class planning to do the software portion of the book?

--Mark
Reply | Threaded
Open this post in threaded view
|

RE: Optimized mult

stansbuj

Thanks Mark. We’ll take a look at those two sections in chapter 12. Most of the kids have gone through chapters 1-3 so far, and 4 is due this Friday. A few have started on the assembler. This Friday will mark ΒΌ of the class, so they all should get to the software part. The furthest we got two years ago was chapter 6 or 7 I believe, but we should get further than that now. It’s a fun course! I did this kind of work before I became at teacher; I worked at DEC for five years writing assembly and BLISS on VAX diagnostic software, but that was many years ago.

 

Jack

 

From: cadet1620 [via Nand2Tetris Questions and Answers Forum] [mailto:[hidden email]]
Sent: Wednesday, September 25, 2013 9:22 PM
To: Stansbury, Jack
Subject: Re: Optimized mult

 

stansbuj wrote

A high school student of mine has optimized the multiplication. It looks to see which operand is the smaller value, and adds the larger value that many times. For 25 * 25, it makes no difference. But for 1000*2 or 2*1000, it makes a big difference in the amount of time to execute the multiply.

It's good that he's thinking about how to improve his program. It sounds like he may be the kind of student that would benefit from looking ahead to the multiplication discussion in section 12.1.1 and 12.3.1.

Is your class planning to do the software portion of the book?

--Mark


If you reply to this email, your message will be added to the discussion below:

http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/Optimized-mult-tp4027326p4027328.html

To unsubscribe from Optimized mult, click here.
NAML