# Homework Help: What to do when the digital output bits number exceeds the system's number of bits?

1. Apr 11, 2012

### Femme_physics

Last edited by a moderator: May 5, 2017
2. Apr 11, 2012

### NewtonianAlch

Re: What to do when the digital output bits number exceeds the system's number of bit

Overflow, and it starts again from the beginning?

3. Apr 11, 2012

### M Quack

Re: What to do when the digital output bits number exceeds the system's number of bit

The largest number you can represent with 9 bits is (1 1111 1111)_2 = (511)_10 = 2^9 -1. (assuming that you don't use one bit for the sign, i.e. you also allow negative numbers).

You can in fact represent 512 different numbers, but the first one is always 0.

4. Apr 11, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

So if I get a result that contains 10 bits and I have 9 bits does this mean I have to go to the highest possible value I can present?

I.e., Since I got 1000000000 (10 bits), I change it to 111111111 (9 bits) because I don't have more than 9 bits. Would that be valid in terms of my homework calculations?

5. Apr 11, 2012

### chiro

Re: What to do when the digital output bits number exceeds the system's number of bit

What is the range for your voltage? (i.e. what is the minimum voltage and what is the maximum voltage) allowed for your digital representation?

6. Apr 11, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

Min is 0 max is 8

(I wrote it above :) )

7. Apr 11, 2012

### Staff: Mentor

Re: What to do when the digital output bits number exceeds the system's number of bit

With 9 bits, you can represent up to 111111111 and this number is not = 2⁹

Res= 8 / (2ⁿ - 1)

8. Apr 11, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

Now I'm even more confused. Where does this -1 comes from? It did not appear in our teacher's resolution formula.

I understand that, so is it valid to say that the answer for the output of a binary (512)10 is indeed 111111111? ("9" times "1")

9. Apr 12, 2012

### Staff: Mentor

Re: What to do when the digital output bits number exceeds the system's number of bit

9 bits allows (512)10 states, these range from 000000000 up to 111111111
N.B. the 1st output state of a 9-bit counter is 000000000 which we may pronounce "zero". The 2nd output state is 000000001 which we pronounce "one". .... The final output is that counter's 512th state which is all 1's and we pronounce that number "five hundred and eleven".

You want to use the binary words 000000000 - 111111111 to represent 0.000 - 8.000 volts
So you set 000000000 = 0.000V, and 111111111 = 8.000V

There are 511 counts/intervals/steps/increments between 000000000 and 111111111
so each step must represent what increment in voltage? As far as I can see, there can be only one correct answer. :uhh:

(It's possible that some people might consider the ADC's accuracy to be half of this figure, since you can digitize an analog sample without introducing a rounding/quantizing error of more than half that increment.)

10. Apr 12, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

I see. Then according to that logic the answer I wrote must apply.

11. Apr 12, 2012

### Staff: Mentor

Re: What to do when the digital output bits number exceeds the system's number of bit

I mean, determine how many volts?

12. Apr 12, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

That would be the value of the resolution, of course: 0.015625 V !

13. Apr 12, 2012

### Staff: Mentor

Re: What to do when the digital output bits number exceeds the system's number of bit

I believe it would be.
I thought I've been showing you how that can't be the correct value. :uhh:

Because, if you start from 0v and go up through the total 511 steps, an increment of 0.015625 V would take you to 511*0.015625 V, and on my calculator this does not equal 8.000V. So something is wrong!

For it all to make sense, the correct way to calculate resolution must be 8.000 ÷ 511, just as I demonstrated earlier (and despite what your teacher may or may not have told you).

Of course, 8 ÷ 511 is very close to 8 ÷ 512, but it's not close enough to avoid the problem that 111111111 isn't coming out as 8.000V. All clear now?

Last edited: Apr 12, 2012
14. Apr 12, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

PERFECTLY. :) Thanks.

But I should still use my original formula for resolution for general purposes, yes? Unless I see a contradition such as this-- then I can use your method!

15. Apr 12, 2012

### Staff: Mentor

Re: What to do when the digital output bits number exceeds the system's number of bit

When you are a student, you do exactly as your teacher directs.
EVEN IF you see a contradiction; he's doing the marking! http://img651.imageshack.us/img651/4796/iconsmileclown.gif [Broken]

Last edited by a moderator: May 5, 2017
16. Apr 12, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

Yes and no, he's preparing us for an external test. He's just doing the pre-test. :)

Ahh...but we got a contradiction in this exercise which I don't recalled him telling us how to handle (TBH I think he skipped a bunch of material). Ergo, I must figure out my own way of handling it.

But I can just write an explanation, I guess, because I fully understood you :)

You're helping me a great deal, NascentOx.. I appreciate it

17. Apr 12, 2012

### I like Serena

Re: What to do when the digital output bits number exceeds the system's number of bit

Actually, the formula of the teacher is not really wrong.
The voltage range 0-8 V is divided into subranges that map onto a digital number.
0 matches with the range 0V up to but less than 8V*1/512.
511 matches with the range 8V*511/512 up to 8V.

In practice it's always a surprise how an electronic circuit actually maps these numbers.
Electronic engineers are usually not mathematically precise.
But I don't really expect 7.999 V to be mapped to 510.

Anyway, you can expect 8V to be mapped to 511, since a higher number is not possible with 9 bits.

Last edited: Apr 12, 2012
18. Apr 13, 2012

### Femme_physics

Re: What to do when the digital output bits number exceeds the system's number of bit

Thanks, that's what I did. Funnily enough I scored the notebook of someone who already took the course and he used the formula with the "-1" at the the denominator.
Either way, as long as it's all clear :)

Thanks

19. Apr 13, 2012

### Staff: Mentor

Re: What to do when the digital output bits number exceeds the system's number of bit

I believe you are right. I was actually picturing the D-A converter while describing how to ensure that 0-511 maps neatly to the 0-8v range, and a denominator of 2ⁿ -1 ensures this.

I think you are correct about the A-D converter having 2ⁿ intervals between 0 and 8V.
If you have a chance, can you see whether that 2ⁿ -1 denominator refers a DAC or an ADC?

20. Apr 13, 2012

### I like Serena

Re: What to do when the digital output bits number exceeds the system's number of bit

To make it mathematically neat, a DAC converter should map 0 to 8V*0.5/512.
And it should map 511 to 8V*511.5/512.

That way forward and backward conversion would be identical and proof to noise, which are attractive features IMO.

Anyway, I highly doubt that DAC's in practice show this behavior.
Some people will feel that 0 should be mapped to 0V and/or 511 should be mapped to 8.0V, even though this generates an asymmetric conversion mapping.
Depending on the application they will probably have good reason too!

To the OP: I wouldn't worry overmuch about a denominator of 2n or 2n-1.

Last edited: Apr 13, 2012