Tuesday 3 December 2019

How to make a 7 to 3 priority encoder?



I'm trying to make a 7 to 3 priority encoder for a circuit diagram for a class. The problem is that we have to take in a 7 bit number and output a 3 bit answer representing the maximum number of consecutive ones in the input.


Example:


0011100 = 011 (3)
1111111 = 111 (7)
0000000 = 000 (0)

The issue at the moment is that regardless of the input, it is always outputting 111 (7).


I have circuits for handling every possible combination of consecutive ones in the input, and am then piping that into a 7 to 3 priority encoder, but for some reason the encoder is not working the way it should. What am I doing wrong? Or is there a better way that I should be doing this?


Original Circuit diagram:


circuit



Attempt 2:


another try




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...