使用多路复用器实现 5 变量函数

发布于 2024-08-19 05:14:24 字数 180 浏览 1 评论 0原文

如果我有一个 5 变量函数(如下)并且我想使用多路复用器来实现它,我该怎么做(使用尽可能少的多路复用器):

f(A,B,C,D,E) = A + C'D + BD' + B'D + B'CE

这是家庭作业,所以不提供解决方案,只是提供指导这是如何运作的。

谢谢!

If I have a 5-variable function (below) and I want to implement it using a multiplexer, how would I do that (using the minimum possible multiplexer):

f(A,B,C,D,E) = A + C'D + BD' + B'D + B'CE

This is homework, so don't provide a solution, just a guidance of how that works.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

花开半夏魅人心 2024-08-26 05:14:24

既然你明确提到

使用尽可能少的多路复用器

还有另一种方法,您只需要一个 2^(n-1) 输入多路复用器来实现输入功能(因此,在您的情况下,具有 2^4 个输入和 4 个选择输入的 MUX 将就够了)。这个想法是使用真值表的前 n-1 个输入作为 MUX 的选择输入,而其余一个则根据需要连接到数据输入以给出所需的结果。

由于我还无法发布图像,请参阅具体示例: https:// /www.dropbox.com/s/v8osbd8gtwhtfor/n-1inputmux.png

或者了解如何使用 MUX 实现简单逻辑门:https://www.dropbox.com/s/7cqbodha7lcoi9y/n-1inputmuxbasics.png


来源:

http://sifaka.uwaterloo.ca/~akenning/ course/ece124/

http://6004.mit.edu/

(我不能发布两个以上的真实链接......)

Since you explicitly mention

using the minimum possible multiplexer

there's another way of doing it in which you only need a 2^(n-1) input multiplexer to implement a n input function (so, in your case, a MUX with 2^4 inputs and 4 select inputs would suffice). The idea is to use the first n-1 inputs of the truth table as select inputs for the MUX while the remaining one is connected to the data inputs as appropriate to give the desired result.

Since I can't post images yet, see this for a concrete example: https://www.dropbox.com/s/v8osbd8gtwhtfor/n-1inputmux.png

Or for how to implement simple logic gates with MUXes: https://www.dropbox.com/s/7cqbodha7lcoi9y/n-1inputmuxbasics.png


Sources:

http:// sifaka.uwaterloo.ca/~akenning/courses/ece124/

http:// 6004.mit.edu/

(I can't post more than two real links...)

小嗲 2024-08-26 05:14:24

Fanhoso 和 Ignacio Vazquez-Abrams 通过的答案已经过时或完全无用。

  1. 计算变量的频率:

f(A,B,C,D,E) = A + C'D + BD' + B'D + B'CE

A: 1x;
B: 3x;
C: 2x;
D: 3x;
E: 1x;

出现次数最多的变量将成为选择器输入,如下所示以最有效的方式使用它们(否则,必要的门的数量将会增加)。因此在本例中它将是 AE|BCD(其中 BCD 形式为选择器输入)。

  1. 对于此步骤和后续步骤,我们需要知道包含哪些最小项,因此您应该传递最小项的规范和。我发现你的函数如下所示:

f(A,B,C,D,E) = Σ{ 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17 , 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }

按照新的变量顺序对最小项(以二进制形式)进行排序:

         ABCDE -> AE|BCD|
    (2)  00010 -> 00|001|
    (3)  00011 -> 01|001|
    (5)  00101 -> 01|010|
      .
      .
      .
  1. 尽管如此,我们不知道所需信号将出现在哪些组中,因此我们需要根据选择器输入行中的相同信号再次对它们进行分组。

例如,选择器输入线上的 001 传输到数据输入线上的输入号 1。从00|001 (2),可以获得其他数字,即01|001 (3)。

             ABCDE -> AE|BCD|
input data no 1:
        (2)  00010 -> 00|001|
        (3)  00011 -> 01|001|
         .
         .
input data no 2:
        (5)  00101 -> 01|010|
          .
          .
          .
  1. 开始绘制方案之前的最后一件事是定义如何将信号 AE 与数据输入线连接,这意味着我们需要知道获得所需输出需要哪些门。在此示例中,输入行 1 包含:

    <前><代码> (2) 00010 -> 00|001|
    (3)00011→ 01|001|

因此,有必要将 A'(E 表示“不关心”)与数据输入行号 1 连接。当然,一旦您将所有小项正确分组。

The answers passed by Fanhoso and Ignacio Vazquez-Abrams are outdated or totally useless.

  1. Count the frequency of the variables:

f(A,B,C,D,E) = A + C'D + BD' + B'D + B'CE

A: 1x;
B: 3x;
C: 2x;
D: 3x;
E: 1x;

The variables that appear the most, will become selector inputs, as this way they're used in the most efficient way (otherwise, the amount of necessary gates would increase). So in this case it'll be AE|BCD (where BCD form SELECTOR INPUTS).

  1. For this and next steps, we need to know what minterms are included, so you should pass canonical sum of minterms. I figured out that your function looks as follows:

f(A,B,C,D,E) = Σ{ 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }

Sort the minterms (in binary form), in the new variables order:

         ABCDE -> AE|BCD|
    (2)  00010 -> 00|001|
    (3)  00011 -> 01|001|
    (5)  00101 -> 01|010|
      .
      .
      .
  1. Still, we don't know in what groups the desired signals will appear, so we need to group them once again, according to the same signals in the selector inputs line.

For example 001 on the selector inputs line transfers to input number 1 on the data input line. From 00|001 (2), it's possible to obtain other numbers i.e. 01|001 (3).

             ABCDE -> AE|BCD|
input data no 1:
        (2)  00010 -> 00|001|
        (3)  00011 -> 01|001|
         .
         .
input data no 2:
        (5)  00101 -> 01|010|
          .
          .
          .
  1. The last thing before starting to draw a scheme, is to define how to connect signals AE with data input lines, meaning we need to know which gates are necessary to obtain desired outputs. In this example the input line 1 consists of:

     (2)  00010 -> 00|001|
     (3)  00011 -> 01|001|
    

So it's necessary to connect A' (E is "don't care") with the data input line number 1. Of course, the combination in your case will be totally different, once you group properly all the minterms.

说好的呢 2024-08-26 05:14:24

Ignacio 接受的答案是错误的,因为当 4x1 MUX 就足够时,它需要 32x1 MUX。

使用 MUX 实现 5 变量函数的算法类似于4 变量函数的算法

  • 绘制函数的真值表。
  • 根据真值表,绘制卡诺图。
  • 选择具有 n 个输入的多路复用器,其中 n 是 kmap 中的行数。 MUX 使用一些变量作为选择线。
  • 通过仅按行分组(与传统方式不同)来最小化 k-map。
  • 使用从 k-map 导出的方程实现

电路真值表 真值表

f = (a ∨ ((Øc ∧ d) ∨ ((b ∧ Ød) ∨ ((Øb ∧ d) ∨ (Øb ∧ (c ∧ e)))))):

a   b   c   d   e   f
F   F   F   F   F   F
F   F   F   F   T   F
F   F   F   T   F   T
F   F   F   T   T   T
F   F   T   F   F   F
F   F   T   F   T   T
F   F   T   T   F   T
F   F   T   T   T   T
F   T   F   F   F   T
F   T   F   F   T   T
F   T   F   T   F   T
F   T   F   T   T   T
F   T   T   F   F   T
F   T   T   F   T   T
F   T   T   T   F   F
F   T   T   T   T   F
T   F   F   F   F   T
T   F   F   F   T   T
T   F   F   T   F   T
T   F   F   T   T   T
T   F   T   F   F   T
T   F   T   F   T   T
T   F   T   T   F   T
T   F   T   T   T   T
T   T   F   F   F   T
T   T   F   F   T   T
T   T   F   T   F   T
T   T   F   T   T   T
T   T   T   F   F   T
T   T   T   F   T   T
T   T   T   T   F   T
T   T   T   T   T   T

对于第 0、1、4、14、15 行,F 为 false。

您可以使用如下所示的真值表生成器 一个来验证真值表是否正确。

K-map

“在此处输入图像描述"

选择多路复用器

需要 4x1 MUX。选择行将为 ab。 4x1 MUX 的真值表如下:

a b f
0 0 f0(c, d, e)
0 1 f1(c, d, e)
1 0 f2(c, d, e)
1 1 f3(c, d, e)

我们需要表达函数 f0f1f2f3 表示为 cde。这是使用 k-map 分组来完成的(在下一节中)。

最小化 k-map

分组仅按行进行。

输入图片此处描述

f0 = ((Øa ∧ (Øb ∧ d)) ∨ (Øa ∧ (Øb ∧ (c ∧ e))))

f1 = ((Øa ∧ (b ∧ Ød)) ∨ (Øa ∧ (b ∧ Øc)))

f2 = (a ∧ Øb)

f3 = (a ∧ b)

电路

电路f0

在此处输入图像描述

f1

在此处输入图像描述

f2

enter此处的图像描述

f3

在此输入图像描述

主电路

在此处输入图像描述

真值表验证

最终电路的真值表由 logisim (电路模拟器)是:

在此处输入图像描述

这与我们之前找到的真值表。这说明电路是正确的。

您可以在此处访问 logisim 电路。

Accepted answer by Ignacio is wrong because it requires a 32x1 MUX when a 4x1 MUX suffices.

The algorithm to implement a 5-variable function using MUX is similar to the algorithm for a 4-variable function:

  • Draw the truth table for the function.
  • From the truth table, draw a Karnaugh map.
  • Choose a multiplexer with n inputs where n is the number of rows in the kmap. MUX uses some of the variables as select lines.
  • Minimize the k-map by making groupings only row-wise (different from the traditional way).
  • Implement circuit using equations derived from k-map

Truth table

The truth table for f = (a ∨ ((¬c ∧ d) ∨ ((b ∧ ¬d) ∨ ((¬b ∧ d) ∨ (¬b ∧ (c ∧ e)))))):

a   b   c   d   e   f
F   F   F   F   F   F
F   F   F   F   T   F
F   F   F   T   F   T
F   F   F   T   T   T
F   F   T   F   F   F
F   F   T   F   T   T
F   F   T   T   F   T
F   F   T   T   T   T
F   T   F   F   F   T
F   T   F   F   T   T
F   T   F   T   F   T
F   T   F   T   T   T
F   T   T   F   F   T
F   T   T   F   T   T
F   T   T   T   F   F
F   T   T   T   T   F
T   F   F   F   F   T
T   F   F   F   T   T
T   F   F   T   F   T
T   F   F   T   T   T
T   F   T   F   F   T
T   F   T   F   T   T
T   F   T   T   F   T
T   F   T   T   T   T
T   T   F   F   F   T
T   T   F   F   T   T
T   T   F   T   F   T
T   T   F   T   T   T
T   T   T   F   F   T
T   T   T   F   T   T
T   T   T   T   F   T
T   T   T   T   T   T

F is false for rows 0, 1, 4, 14, 15.

You can use a truth table generator like this one to verify that the truth table is correct.

K-map

enter image description here

Choosing multiplexer

A 4x1 MUX is required. The select lines will be a and b. The truth table for the 4x1 MUX is as follows:

a b f
0 0 f0(c, d, e)
0 1 f1(c, d, e)
1 0 f2(c, d, e)
1 1 f3(c, d, e)

We need to express the functions f0, f1, f2, f3 in terms of c, d, e. This is done using k-map groupings (in the next section).

Minimizing k-map

The groupings are done only row-wise.

enter image description here

f0 = ((¬a ∧ (¬b ∧ d)) ∨ (¬a ∧ (¬b ∧ (c ∧ e))))

f1 = ((¬a ∧ (b ∧ ¬d)) ∨ (¬a ∧ (b ∧ ¬c)))

f2 = (a ∧ ¬b)

f3 = (a ∧ b)

Circuit

Subcircuits

f0

enter image description here

f1

enter image description here

f2

enter image description here

f3

enter image description here

Main circuit

enter image description here

Truth table verification

The truth table of the final circuit as computed by logisim (a circuit simulator) is:

enter image description here

This is exactly the same as the truth table that we found earlier. This means that the circuit is correct.

The logisim circuit can be accessed here.

情归归情 2024-08-26 05:14:24

5 个变量表示 2**5 (32) 个输入多路复用器,输入为 0 到 31。将这些项转换为二进制数并将相应的输入保持为高电平。对于 B'CE 我们有:

A B C D E
X 0 1 X 1

这给了我们 4 个数字,因为我们有 2 个不关心的数字。这四个数字是:

00101 = 5
00111 = 7
10101 = 21
10111 = 23

将输入 5、7、21 和 23 保持为高电平。

对其余术语重复上述操作。

5 variables means a 2**5 (32) input multiplexer, with inputs 0 through 31. Convert the terms into binary numbers and hold the corresponding inputs high. For B'CE we have:

A B C D E
X 0 1 X 1

This gives us 4 numbers, since we have 2 don't cares. The four numbers are:

00101 = 5
00111 = 7
10101 = 21
10111 = 23

Hold inputs 5, 7, 21, and 23 high.

Repeat for the rest of the terms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文