Decimal Equivalent of Largest Unsigned Binary: 8bits=256, n bits

  • Thread starter Thread starter ccky
  • Start date Start date
  • Tags Tags
    Binary
Click For Summary
SUMMARY

The largest unsigned binary number for 8 bits is 255, represented in binary as 11111111, calculated using the formula 2^8 - 1. For n bits, the maximum value is determined by the formula 2^n - 1. The conversion from decimal to binary can be performed using repeated division by two or by determining the binary representation through subtraction of powers of two. This discussion provides a clear methodology for converting decimal numbers to binary format and vice versa.

PREREQUISITES
  • Understanding of binary number systems
  • Familiarity with powers of two
  • Basic arithmetic operations
  • Knowledge of number base conversion techniques
NEXT STEPS
  • Study the process of converting decimal numbers to binary using repeated division
  • Learn about binary arithmetic and its applications
  • Explore the concept of signed vs. unsigned binary numbers
  • Investigate the implications of binary representation in computer systems
USEFUL FOR

Students studying computer science, software engineers working with low-level programming, and anyone interested in understanding binary number systems and their conversions.

ccky
Messages
15
Reaction score
0

Homework Statement


What is the decimal equivalent of the largest unsigned binary that can be obtained with:
a.8bits. b:n bits

Homework Equations





The Attempt at a Solution


A:2^8=256. 2^8-1=255 how I can change the number to binary number?
B.I can't get the direction of n bits
 
Physics news on Phys.org
Repeated division by two - they walk you through this both ways here: http://www.purplemath.com/modules/numbbase.htm

For n bits the maximum number is 2^n -1.

Actually for these two examples you don't need to do any arithmetic. Just ask yourself: what is the largest number that can be displayed on a 4 digit odometer?
 
ccky said:
A:2^8=256. 2^8-1=255 how I can change the number to binary number?
B.I can't get the direction of n bits

Hope this can be some sort of a tool to help you:
Suppose your have a decimal number X and you want to convert it into the binairy number N made of n bits.

1st of all, in a general fashion:

X=a_{0}*2^{0}+a_{1}*2^{1}+a_{2}*2^{2}...a_{n-1}*2^{n-1}

If n=8, the highest number will be 255, and in binairy it is written as 11111111.
Keep in mind that each "number 1" is the value of a specific a_{i}

And the reading directions of these values are opposite i.e. a_{0} is the first "1" from the right of 11111111, a_{1} is the 2nd one.

For example: 11001001
a_{0} =1
a_{1} =0
a_{2} =0
.
.
.
a_{7} =1

2nd of all:
How did I transform 255 to the number 11111111?

Here's a general method (Bear in mind there are other methods):

Take your n bit number (let's consider 186 to add diversity, and in this case it's 8 bits):

Is 186 >= 2^{7}=128? Yes.
thus: a_{7}=1.

Now take 186 and substract 2^{7} => 58.
And redo the operation:

Is 58 >= 2^{6}=64? No.
thus: a_{6}=0.

Do not substract anything since 58<64

Now go to the 3rd digit.

Is 58 >= 2^{5}=32? Yes.
thus a_{5}=1.

58-32=26.

Is 26 >= 2^{4}=16? Yes.
thus a_{4}=1.

Is 26-16=10 > 2^{3}=8? Yes.
thus a_{3}=1.

Is 10-8 >= 2^{2}=4? No.
thus a_{2}=0.

Is 10-8>= 2^{1}=2? Yes.
thus a_{2}=1.

Is 2-2 >= 2^{0}=1? No.
thus the last digit on the right is 0.

Result: 10111010

Verification: 128+0+32+16+8+0+2+0=186. The operation is correct.

Hope this helps and clearify the idea of binairy to decimal transformation and vice-versa .
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K