# Plz help with this question

#### juliuscaesar

A microcontroller device has an analog input that picks up a voltage value over a range [minV, maxV]. To perform any processing, the device needs to convert the input voltage value to a binary (bits) value. Suppose this device has only 4 bits (N) of resolution, i.e., the voltage values are linearly transformed into integers between [0, 2N - 1]. To simulate this conversion of the analog signal to digital, find this integer for an input voltage value and convert it to its corresponding four-bit binary number. Display the input voltage value (format to 4 decimal places), the integer found, its corresponding four bits, and the complement of two. Do not allow the input voltage value to be out of range [minV, maxV] and when this happens, warn the user and close the program.

#### Owen_M

Input Voltage: 2.5000 volts (formatted to four decimal places)
Integer Found: 7
Binary (4 bits): 0111
Two's Complement: 0111

#### WhiteCube

2's complement of 0111 is 1001

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.

### Members online

No members online now.