Go to Post Either way, I'll stay a FIRSTer for life. =) - Adare180 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 02-12-2004, 20:31
Gabriel Gabriel is offline
Registered User
#1409 (Fightin' Llamas)
 
Join Date: Jan 2003
Location: Great Barrington MA
Posts: 150
Gabriel is just really niceGabriel is just really niceGabriel is just really niceGabriel is just really nice
Send a message via AIM to Gabriel
A Computer Science Challenge For CD?

Awhile ago there was a jeopardy game on CD which I enjoyed. I thought, why not do a regular challenge that will test the kind of skills you need for FIRST rather than just trivia? Somebody could pose a different problem every week, maybe something that you've come across in your work or in your classes. Does anybody think this is a good idea?

I'll start with a problem I came across recently while working on optimizing a chess program for my AI class. It took me a good three or four hours to solve.

There is a small function that needs to run every time the program considers a move. Because the program searches to a depth of 12 or more moves ahead, hundreds of thousands of possible moves will need to be considered each time the program takes a turn. As a result, this function needs to be as fast as humanly possible. For this reason, it must be written in assembler and it CANNOT use anything costly such as loops. I'll allow you at most ONE if-statement.

This function must count the trailing zeros in a word (32-bits in real life but this doesn't really matter for the problem). For example if the word is ...01000 than the function should return 3. However in this particular assembler (PPC in real life, but lets use pseudo-code to make this easier), there is no instruction to count trailing zeros. There is an instruction to count leading zeros. (Lets call it GLZ)

Your mission, should you choose to accept it, is to count the trailing zeros in a given input using as few lines of a psuedo-code assembler as possible, no loops, no branches, no jumps, nothing costly. Other than GLZ, everything you'll need can be found in the MIPS instruction set, so nothing really obscure. Comment ever line and use labels so I can read your solution. I've come up with two already, but there are probably more out there.

I hope this is a fun problem.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
Register Now for the FIRST Women in Science & Technology Forum on Nov. 5! Damian Manda FIRST E-Mail Blast Archive 2 01-11-2004 21:56
Science Teachers Invited to Submit Proposals for Toyota TAPESTRY Grant Program Damian Manda FIRST E-Mail Blast Archive 0 28-04-2004 11:43
FYI: FIRST Robots at the NYC Hall of Science Rich Wong General Forum 9 11-07-2002 10:52
Full list of teams & competitions archiver 2001 14 24-06-2002 00:52


All times are GMT -5. The time now is 10:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi