Please explain digital sensors.

a) Every where i look i hear digital sensors are 0 or 1, but what about the temp sensor ds18b20. Is it because it runs on a bus allows it to be digital but to give range with in 0/1?

b) If i had another type of digital sensor that worked on a 0/1 basis, say a temperature one, is it the code/sketch that turns it from 0 to 1. I.e the code/sketch say, once reach 85'c (more precisely the voltage) class as on?

Many thanks, this might sound like a noob question but i cant get my head around this part.

Digital sensors have an interface (often of type I2C or SPI) that allows the Arduino and sensor to communicate.

The end result is usually an 8 to 16 bit binary value corresponding to the sensor reading.

So they are more than just on off? It was just that it appeared that analogue gave a range from 0 to 1 and digital was either 0 or 1.
Regards

Yes, much more, although some have an on/off alarm output.

It appears you need to do some more in depth research into sensors.
Generalizations never answers anything.

Go to a suppliers web site and search their offerings, example:
Read through their applications material.
https://www.adafruit.com/category/35

An analog temperature sensor like the lm35 will give you a voltage between 0 and 5V that corresponds to a temperature (look into the datasheet how).
A digital temperature like the ds18b20 sensor will send you the temperature encoded binary. E.g. 00011010 may mean 26°C. Of course, usually it is more complicated (look into the datasheet how).

The advantage of the latter is that you don't have to worry so much about voltage drops in the cable and such. I would say it is a little more robust against small errors, but as it is with digital communication, strange things may happen, like here:

Cool, cheers for the responses guys. Yes i did look into a few data sheets, this was what was confusing me.