Skip to main content
edited body
Source Link
Michael Karas
  • 57.9k
  • 3
  • 74
  • 139

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago. Stay with me while I walk through this to my recommendation at the end.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC12332BMC14532B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago. Stay with me while I walk through this to my recommendation at the end.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC12332B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago. Stay with me while I walk through this to my recommendation at the end.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC14532B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.

added 73 characters in body
Source Link
Michael Karas
  • 57.9k
  • 3
  • 74
  • 139

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago. Stay with me while I walk through this to my recommendation at the end.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC12332B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC12332B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago. Stay with me while I walk through this to my recommendation at the end.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC12332B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.

Source Link
Michael Karas
  • 57.9k
  • 3
  • 74
  • 139

ThePhoton's answer is an excellent one. I would like to add some additional information here for your consideration. This stems from the fact that even though we have state of the art fancy FPGA and CPLD devices using HDLs and systhesis tools it can be informative to look closely at things designed years ago.

There are discrete logic parts that perform the priority encoding function. The logic implemented by these parts has been around for a long time when it was essential to reduce the number of transistors to a bare minimum. You can search on the web for logic parts with generic part numbers such as 74HC148 or MC14532B to find data sheets that include equivalent logic diagrams for these parts. The diagram below is one example taken from the TI data sheet for the 74HC148 part.

enter image description here

This logic implements the following truth table (taken from the same data sheet):

enter image description here

Note that the above part family uses low active input signals. Another data sheet for the ON Semiconductor MC14532B part shows a truth table for the encoder function using active high input signals similar to your Verilog example.

enter image description here

The same data sheet shows the logic equations for the MC12332B as follows:

enter image description here

You may want to consider coding similar equations directly into your Verilog code to see how it compares with your present example. It is highly likely to result in a much more favorable result.