A Program for Bit-Slicing
I wrote this short program in C because I needed to do some bit-slicing in some homework. It's not too generic (accepts only 32 bit integers) but it can help in most cases.
An example usage of the program:
bs 0x12345678 31 4
Will give the following output:
0x12345678[31:4] = 0x1234567
You can download the source code (written in C) here:
Compile it with gcc:
gcc -o bs bitslice.c
And add it to /usr/local/bin for easy access:
sudo cp bs /usr/local/bin/
Now you can use it from the command line this way:
bs 0x12345678 31 4
Enjoy
No related posts.
1 Comment to A Program for Bit-Slicing
Leave a Reply
About Me
Tags
Bash
Collaboration
Command Line Interface
Courses
Debug
Ebooks
Email
Facebook
Firefox
Gnome
Google
Hardware
Illusions
Linux
Linux Development
Macros
Manpages
Multimedia
Networks
Object Oriented Programming
Off-Topic
Open Knowledge
Operating Systems
Productivity
Programming
Religion
Science
Security
sed
Sharing
Shell Scripts
Short Posts
Small Code
Social Media
Studies
Terminal
TIps
Tools
Troubleshooting
Ubuntu
University
Vim
Web Development
Web Services
Websites
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- iPhone
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Regular Expressions
- Science
- Security
- Shell Scripts
- Short Posts
- Social Networks
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Calendar
Archives
- September 2010 (2)
- August 2010 (2)
- July 2010 (5)
- June 2010 (1)
- May 2010 (1)
- April 2010 (3)
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (1)

I am a student studying IB in India and i am doing my extended essay(small research) in Math. I need to generate large prime numbers (highest prime numbers of digits from 1-44). And i guess I’m hitting my cpu’s wall after 18 digits. Could u help me with this. I guess i’ll need to bit slice and generate a virtual 256 bit environment.
Thanks.
My system config:
Processor: intel i7 920 @ 2.67 Ghz (4cores\8threads)
Ram: 3 GB DDR3 1333 MHz
Mobo: Asus P6T Deluxe
OS: Vista Unlimate 32-bit.