enter image description here

I am using following: Identical resistance of 1k ohms. For 3 bit flash adc we have (2^3)-1=7; which means we have to use 7 opamps, and 8 resistance. Opamp LM324 (V+ is applied directly form 9V battery and V- form the negative terminal of battery), Priority encoder: 74LS148 (8 line to 3 line) Analog signal form 9 volt battery which is being varied by using 5k potentiometer form 0 to 6 volt, Reference voltage is 6V.

Issue which i am having is that when analog signal is below reference voltage none of Led is on and when it exceed reference voltage all led goes in on state. Need help with this issue.

enter image description here

  • 2
    \$\begingroup\$ Where are the LEDs in this circuit? \$\endgroup\$ – akellyirl Nov 23 '14 at 10:09
  • \$\begingroup\$ You need to show us the details of how you wired the priority encoder. The unlabeled connections tell us nothing. \$\endgroup\$ – Dave Tweed Nov 23 '14 at 11:53
  • \$\begingroup\$ I am afraid that i am not having the proper circuitry at the moment. What i can let you know is that Pin 10 shorted with Vcc, and vcc is 5 volts. Now coming to input pins (which are 11,12,13,1,2,3,4). I applied input to encoder in this way: Starting from bottom (See first circuitry) is my opamp 1 which goes to pin 11, 2nd last opamp goes to pin 12 and so on. Since this Ic is active low, so enable pin which is number 5 pin is grounded. \$\endgroup\$ – Hasan Nov 23 '14 at 14:58

The 74LS148 has inverting inputs, so it encodes the highest priority LOW input. Therefore each of your comparators outputs needs to be HIGH until its reference voltage (on the voltage divider) is reached. You should swap the + and - inputs on each op-amp.

The comparators also have to be connected to the priority inputs in the correct order (lowest op-amp to input 6, next to input 5 etc.). If the order is reversed then it will go directly from 0 to 7 with no intermediate steps.

Another possible problem is that you are powering the op-amps from +9V, but the 74LS148 is only designed to take +5V. The breakdown voltage of LSTTL is 7V. It's possible that the inputs are being driven above 7V and causing the 74LS148 to malfunction.

  • \$\begingroup\$ It doesn't matter if the encoder inverts the inputs for it's own purpose. The funtion table says that you must have all 7 inputs high to get all outputs high. The output of the LM324 only reaches supply voltage - 1.5V, so no problem. \$\endgroup\$ – Kitana Nov 23 '14 at 10:59

The inputs of the encoder uses kind of big-endian numbering, thus input "0" has the highest value and input "7" the lowest.

I bet when you reverse the inputs of the encoder your circuit will work.

Edit/Hint: In the meantime i've seen that input "0" doesn't matter for the output.

  • \$\begingroup\$ You mean to say that i should fed all the outputs of comparator to Not gate first and then to encoder? \$\endgroup\$ – Hasan Nov 23 '14 at 11:30
  • \$\begingroup\$ @Hasan - neither Bruce nor I told you to do so. Bruce suggested to reverse comparator inputs, which i consider wrong. We both told to reverse the order of the encoder inputs. \$\endgroup\$ – Kitana Nov 23 '14 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.