beginner question

P

popeyeray

I'm in a beginners programming class and just want to know if i'm on the
right track here:

1. Using ASCII with a 7-bit binary number:

How many characters can be defined using this representation?

I believe the answer is 256

am I correct if not can you give me an idea why. Any help greatly
appreciated.

Ray Leon
(e-mail address removed)
 
A

Andrea Francia

popeyeray said:
I'm in a beginners programming class and just want to know if i'm on the
right track here:

1. Using ASCII with a 7-bit binary number:

How many characters can be defined using this representation?

No more than 128 characters (2^7 = 128).

In the ASCII some bit configuration (from 0 to 31) are used for control
purpose and may not be represented in all renderers.

By the way, in Java uses Unicode to store characters in String.
 
R

Roedy Green

1. Using ASCII with a 7-bit binary number:

How many characters can be defined using this representation?

I believe the answer is 256

am I correct if not can you give me

just 128. you need 8 bits to get all 256.

look at the pattern

1 bit -> 2 possibilities

2 bits -> 4 possibilities

3 bits -> 8 possibilities

....

7 bits -> 128 possibilities
 
P

popeyerayaz

just 128.  you need 8 bits to get all 256.

look at the pattern

1 bit -> 2 possibilities

2 bits -> 4 possibilities

3 bits -> 8 possibilities

...

7 bits -> 128 possibilities

Thank you, then the minimum and maximum for the 7 bit binary number
will be 128 also if i'm not mistaken.
 
J

John B. Matthews

1. Using ASCII with a 7-bit binary number:
How many characters can be defined using this representation?
I believe the answer is 256

[...] you need 8 bits to get all 256.
look at the pattern
1 bit -> 2 possibilities
2 bits -> 4 possibilities
3 bits -> 8 possibilities
...
7 bits -> 128 possibilities

Thank you, then the minimum and maximum for the 7 bit binary number
will be 128 also if i'm not mistaken.

You are mistaken: for an unsigned 7 bit binary number, the minimum will
be zero and the maximum will be 127; that is 128 unique numbers,
encoding 128 possible characters, in all. For a popular convention on
signed binary numbers see:

<http://en.wikipedia.org/wiki/Two's_complement>

John
 
R

Roedy Green

hank you, then the minimum and maximum for the 7 bit binary number
will be 128 also if i'm not mistaken.

either 0..127, 128 possibilities
or -64 .. +63 if you use 2-s complement, again 128 possibilities
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top