orite i have a comparator that gives out a 4Volts signal when it is high, now i need to take that output to a microcontrolle(8051) will the microcontroller recognise that as a digital one or as a zero
Answer your own question: download the data sheet for the 8051. Read the section on the specs for ViH and ViL for a port pin. It is all in the data sheet.
It will be logical one. also remember that the input shall always be lower then the supply voltage. If you use a supply voltage (on the microchip) in range 5 to 4 every things is OK. But if you use say 3.3 volt as supply voltage you may damage your UC
ok so just a series resistor(10k) from the output of the comparator to the input pin of the microcontroller, that will prevent any damaging to the microcontroller?