Welcome to the most active Linux Forum on the web.
 LinuxQuestions.org 6-bit Unsigned Number
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

 09-25-2006, 09:39 PM #1 ckoniecny Member   Registered: Oct 2005 Posts: 162 Rep: 6-bit Unsigned Number Whats the biggest number you can fit in a 6-bit unsigned number? Is it: 32+16+8+4+2+1=63 ?
 09-25-2006, 09:57 PM #2 pankaj99 Member   Registered: Mar 2006 Location: India Distribution: Fedora Posts: 47 Rep: -------------------------------------------------------------- yes Last edited by pankaj99; 09-25-2006 at 09:59 PM.
09-26-2006, 07:58 AM   #3
dmail
Member

Registered: Oct 2005
Posts: 970

Rep:
Quote:
 Originally Posted by ckoniecny Whats the biggest number you can fit in a 6-bit unsigned number? Is it: 32+16+8+4+2+1=63 ?
This is correct, but there will become a time when you run out of paper lol

b = bits,n = number;

n = 2^b -1

 09-26-2006, 08:47 AM #4 Matir LQ Guru   Registered: Nov 2004 Location: San Jose, CA Distribution: Ubuntu Posts: 8,507 Rep: And, for the record, for signed values: Code: ```max=2^bits-1 min=-(2^bits)```
09-26-2006, 08:56 AM   #5
pankaj99
Member

Registered: Mar 2006
Location: India
Distribution: Fedora
Posts: 47

Rep:
Quote:
 Originally Posted by Matir And, for the record, for signed values: Code: ```max=2^bits-1 min=-(2^bits)```
for signed numbers it should be
max=2^(bits-1) - 1
min=-( 2^(bits-1) )

09-26-2006, 09:47 AM   #6
Matir
LQ Guru

Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep:
Quote:
 Originally Posted by pankaj99 for signed numbers it should be max=2^(bits-1) - 1 min=-( 2^(bits-1) )
I stand corrected. My apologies, left out the -1.

Last edited by Matir; 09-26-2006 at 09:49 AM.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post lilzz Linux - Newbie 8 08-20-2006 08:16 PM bluechicken Programming 1 06-27-2005 02:27 PM linux_lover2005 Programming 3 04-26-2005 11:38 PM GodSendDeath Programming 8 03-29-2005 01:19 PM Entropius Linux - Distributions 3 09-08-2004 12:24 PM

LinuxQuestions.org

All times are GMT -5. The time now is 12:16 AM.

 Contact Us - Advertising Info - Rules - Privacy - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -