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

  • Thread starter ccky
  • Start date
  • Tags
    Binary
In summary, the conversation discusses the decimal equivalent of the largest unsigned binary number that can be obtained with either 8 bits or n bits. The solution involves using repeated division by two and converting the resulting remainders into binary digits. The process is demonstrated using the example of converting 186 to its binary equivalent.
  • #1
ccky
15
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
  • #2
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?
 
  • #3
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=[itex]a_{0}[/itex]*[itex]2^{0}[/itex]+[itex]a_{1}[/itex]*[itex]2^{1}[/itex]+[itex]a_{2}[/itex]*[itex]2^{2}[/itex]...[itex]a_{n-1}[/itex]*[itex]2^{n-1}[/itex]

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 [itex]a_{i}[/itex]

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

For example: 11001001
[itex]a_{0}[/itex] =1
[itex]a_{1}[/itex] =0
[itex]a_{2}[/itex] =0
.
.
.
[itex]a_{7}[/itex] =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 >= [itex]2^{7}[/itex]=128? Yes.
thus: [itex]a_{7}[/itex]=1.

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

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

Do not substract anything since 58<64

Now go to the 3rd digit.

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

58-32=26.

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

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

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

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

Is 2-2 >= [itex]2^{0}[/itex]=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 .
 

1. What is the largest unsigned binary number that can be represented with 8 bits?

The largest unsigned binary number that can be represented with 8 bits is 255. This is because 8 bits (or 1 byte) can hold a maximum value of 2^8 - 1, which is equal to 256 - 1 = 255.

2. How many bits are needed to represent the decimal number 256 in binary?

To represent the decimal number 256 in binary, 9 bits are needed. This is because 256 is greater than the maximum value that can be represented with 8 bits (255). Therefore, an additional bit is needed to hold the value 256 in binary.

3. Can the decimal number 256 be represented with 8 bits in signed binary?

No, the decimal number 256 cannot be represented with 8 bits in signed binary. This is because signed binary uses the leftmost bit to represent the sign (positive or negative) of a number, reducing the maximum value that can be represented by one bit. Therefore, the largest signed binary number that can be represented with 8 bits is 127.

4. What is the decimal equivalent of the largest unsigned binary number that can be represented with n bits?

The decimal equivalent of the largest unsigned binary number that can be represented with n bits is 2^n - 1. This is because the maximum value that can be represented with n bits is 2^n, and by subtracting 1, we get the largest unsigned binary number.

5. How many different numbers can be represented with 8 bits in unsigned binary?

With 8 bits, a total of 256 different numbers can be represented in unsigned binary. This is because 8 bits can hold 2^8 = 256 different combinations of 0s and 1s, each representing a different number.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
955
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
2K
Back
Top