Go to Post To find something they are so passionate about that it oozes into everything they do, and others can't help but want to follow them into this Counter-Culture where good is not good enough, Great is all they strive for. - Kims Robot [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-10-2010, 11:14
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 333
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Low Level Bit Hacks You Absolutely Must Know

For those software folks who are looking deeper into embedded systems development:

http://www.catonmat.net/blog/low-lev...tely-must-know

Enjoy,

Mike
  #2   Spotlight this post!  
Unread 21-10-2010, 14:04
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Low Level Bit Hacks You Absolutely Must Know

Check out Hacker's Delight for even more (crazy) bit hacking algorithms.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
  #3   Spotlight this post!  
Unread 24-10-2010, 11:48
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,612
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Low Level Bit Hacks You Absolutely Must Know

Thanks for sharing,

An embedded programming refresher is always useful especially with the growth of graphical programs that abstract away bit level details.
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
  #4   Spotlight this post!  
Unread 25-10-2010, 12:07
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Low Level Bit Hacks You Absolutely Must Know

Since they are based on discrete and Boolean mathematics, bit hacks are actually equally valid for LV and any language with rich numerical types and operators. It may not be obvious, but the Boolean operators in LV work on all integer types, and make for concise implementation of many of them.

If you like the general bit hacks and truly want to remember and use them well, I encourage you to try your hand at proofs for them. They don't have to be fully rigorous, but that is of course a useful thing to practice too.

Greg McKaskle
  #5   Spotlight this post!  
Unread 25-10-2010, 12:40
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Low Level Bit Hacks You Absolutely Must Know

If any of my students use any of these bit hacks without commenting them, I will smack them.
  #6   Spotlight this post!  
Unread 25-10-2010, 12:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Low Level Bit Hacks You Absolutely Must Know

Quote:
Originally Posted by EricVanWyk View Post
If any of my students use any of these bit hacks without commenting them, I will smack them.
The first 3 deserve maybe only a noogie, don't you think?


  #7   Spotlight this post!  
Unread 25-10-2010, 12:56
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,817
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Low Level Bit Hacks You Absolutely Must Know

Any programmer who doesn't comment his/her work, no matter the project, deserves to be deprived of caffeine for a week or more. If that doesn't do the trick, proceed to the harsher methods... like noogies and smacks with a mouse cord...
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #8   Spotlight this post!  
Unread 25-10-2010, 13:04
Taylor's Avatar
Taylor Taylor is offline
Professor of Thinkology, ThD
AKA: @taylorstem
FRC #3487 (Red Pride Robotics)
Team Role: Teacher
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Indianapolis, IN, USA 46227
Posts: 4,603
Taylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond reputeTaylor has a reputation beyond repute
Re: Low Level Bit Hacks You Absolutely Must Know

Quote:
Originally Posted by EricH View Post
Any programmer who doesn't comment his/her work, no matter the project, deserves to be deprived of caffeine for a week or more. If that doesn't do the trick, proceed to the harsher methods...
Isn't caffeine depravation pretty much the harshest method available? Programming is one application where "shoot first, ask questions later" may not apply.
__________________
Hi!

Last edited by Taylor : 25-10-2010 at 19:46.
  #9   Spotlight this post!  
Unread 25-10-2010, 15:17
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Low Level Bit Hacks You Absolutely Must Know

Quote:
Originally Posted by EricVanWyk View Post
If any of my students use any of these bit hacks without commenting them, I will smack them.
But altering register values via bitwise operations in nested ternary commands is so much fun!
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
  #10   Spotlight this post!  
Unread 25-10-2010, 17:27
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Low Level Bit Hacks You Absolutely Must Know

Quote:
Originally Posted by artdutra04 View Post
But altering register values via bitwise operations in nested ternary commands is so much fun!
Smack!
  #11   Spotlight this post!  
Unread 25-10-2010, 18:16
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 589
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: Low Level Bit Hacks You Absolutely Must Know

artdura04, you're amazing. The only thing I can think to add to that is that it has to be done inside an obfuscated macro using a templated function pointer and several magic numbers.
__________________


GSR Dean's List Finalist 2011
  #12   Spotlight this post!  
Unread 25-10-2010, 23:01
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: Low Level Bit Hacks You Absolutely Must Know

or you can be a super-meanie and use a classic turing-style method for making a hello world program, like I did:
Code:
#include <stdio.h>
int main(){char* p=new char[1024];++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;while(*p){++p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++p;++*p;++*p;++*p;++p;++*p;--p;--p;--p;--p;--*p;}++p;++*p;++*p;putchar(*p);++p;++*p;putchar(*p);++*p;++*p;++*p;++*p;++*p;++*p;++*p;putchar(*p);putchar(*p);++*p;++*p;++*p;putchar(*p);++p;++*p;++*p;putchar(*p);--p;--p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;putchar(*p);++p;putchar(*p);++*p;++*p;++*p;putchar(*p);--*p;--*p;--*p;--*p;--*p;--*p;putchar(*p);--*p;--*p;--*p;--*p;--*p;--*p;--*p;--*p;putchar(*p);++p;++*p;putchar(*p);++p;putchar(*p);return 0;}
its evil
Closed Thread


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
You know Chief Delphi has to many "You know ____ when...." threads when... Mike Ciance Chit-Chat 18 01-06-2004 15:10
Someone must know archiver 2001 10 24-06-2002 04:15


All times are GMT -5. The time now is 07:19.

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