0

Using combinational circuits, such as AND and OR, including MUX's and Decoders, how do you design a circuit that has 3 8bit inputs with the output as the largest of the 3 inputs?

||...||       ||...||       ||...||  <- Inputs
----------------------------------
|                                |
|                                |
----------------------------------
              ||...||                <- Output

What would the circuit need to look like in order to achieve such an outcome?

jimbob
  • 461
  • 2
  • 8
  • 17

1 Answers1

1

We could reduce the problem to find a combinational circuit that has 2 8bit inputs with the output as the largest of the 2 inputs. If we solve this problem, we can basically duplicate this circuit we found and use the inputs as being the output from the first comparison and the third 8bit input. So, let's do it.

First, we could make our circuity like this:

A               B
|               |
|               |
-----------------
| Comparator    |->-----------------
-----------------                  |
                                 -----
                                 |Mux|
                             A->-| 0 |
                                 |Out|->- Bigger
                             B->-| 1 |
                                 -----

The comparator is a module that will output 1 if B > A, 0 otherwise. This module can be built based on any simple circuit available online.

This solve the problem with only two inputs. So you can use this module and build new ones with as many inputs as you desire.

Divino Neto
  • 798
  • 1
  • 6
  • 8
  • Wouldn't this be saying that it would be choosing each bit that is the larger of the two? So if A was 1010 and B was 0101, then the output would just be 1111? – jimbob May 02 '16 at 23:52
  • Imagine that the inputs are just A = 101 and B = 010. Using your comparators, the output of each will be 011. Then after the MUX the output will be 110, which is incorrect. – jimbob May 03 '16 at 00:06
  • I think I wasn't clear enough about the comparator. Sorry about that. But it has only a 1 bit output, which is if B is bigger then A. Each little module outputs goes for the CIn of the next module(i - 1). The output from the last of all(0) is the that interests to you. So you are not choosing each bit in the mux, but the hole number based on which number is bigger. If it still isn't clear enough, I could easily make a schematic. – Divino Neto May 03 '16 at 01:46
  • Ok,I do understand now. However, try out the same 101 and 010. The first module will output 0, then 2nd will output 1 and the final will output 1. Then the comparator claims that 010 is the bigger value. – jimbob May 03 '16 at 03:58
  • If you meant exclusive or on the Cin or (B and ~A) then try 001 and 110. – jimbob May 03 '16 at 04:17
  • Ok. I got what you meant. I will edit this part in just a second. But did you understand the whole idea? I mean, if I give a new Comparator, do you understand how all the rest works? – Divino Neto May 04 '16 at 11:43