Saturday 15 September 2018

How to make a digital comparator with multiple inputs?


I have been attempting to make a digital comparator but I am struggling to get in more than one input. The idea is that I have 2 sets of 2 numbers (4 inputs total) and I want to have the output take all 4 numbers into account rather than just 2. Here is what I roughly have so far:


circuit so far


What I want the circuit to do is have the two inputs in the two sets treated as separately. Any ideas on how to achieve this would be very welcome.



Answer




The starting point for a problem like this is to draw out a truth table of the logic that you intend to have the circuit synthesize. Your intention is still somewhat vague even after the comments.


If we guess that the input pairs c:d and b:a are actually representing two 2-bit binary numbers then the following truth table shows the output for when c:d == b:a.


enter image description here


You can then add additional output columns to the table to represent the other outputs you may desire.


This should get you started. I won't present the whole final solution because you learn little from that. The mechanics for reducing the table shown for one output can be done following one of a number of known procedures including Karnaugh Maps.


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...