Verilog学习笔记HDLBits——Karnaugh Map to Circuit

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


前言

卡诺图:
本节的练习为卡诺图,卡诺图是逻辑函数的一种图形表示。一个逻辑函数的卡诺图就是将此函数的最小项表达式中的各最小项相应地填入一个方格图内,此方格图称为卡诺图。

一、Karnaugh Map to Circuit

1. 3-variable

Practice:Implement the circuit described by the Karnaugh map below.
翻译:实现下面卡诺图所描述的电路(可以先化简卡诺图得到最简逻辑表达式)。
在这里插入图片描述

Solution(不唯一,仅供参考):

module top_module(
    input a,
    input b,
    input c,
    output out  ); 
	assign out = a|b|c;
endmodule

Timing Diagram
在这里插入图片描述

2. 4-variable

Practice:Implement the circuit described by the Karnaugh map below.
翻译:实现下面卡诺图所描述的电路(可以先化简卡诺图得到最简逻辑表达式)。
在这里插入图片描述

Solution(不唯一,仅供参考):

module top_module(
    input a,
    input b,
    input c,
    input d,
    output out  ); 
    assign out = (~a&~d)|(~b&~c)|(b&c&d)|(a&~b&d);
endmodule

Timing Diagram
在这里插入图片描述

3. 4-variable

Practice:Implement the circuit described by the Karnaugh map below.
翻译:实现下面卡诺图所描述的电路(可以先化简卡诺图得到最简逻辑表达式)。
在这里插入图片描述
注意卡诺图的变化

Solution(不唯一,仅供参考):

module top_module(
    input a,
    input b,
    input c,
    input d,
    output out  ); 
	assign out = a|(~b&c);
endmodule

Timing Diagram
在这里插入图片描述

4. 4-variable

Practice:Implement the circuit described by the Karnaugh map below.

翻译:实现下面卡诺图所描述的电路(可以先化简卡诺图得到最简逻辑表达式)。
在这里插入图片描述
非常具有代表性的卡诺图,最好记住它的表达式

Solution(不唯一,仅供参考):

module top_module(
    input a,
    input b,
    input c,
    input d,
    output out  ); 
	assign out = a^b^c^d;
endmodule

Timing Diagram
在这里插入图片描述

5. Minimum SOP and POS

Practice:A single-output digital system with four inputs (a,b,c,d) generates a logic-1 when 2, 7, or 15 appears on the inputs, and a logic-0 when 0, 1, 4, 5, 6, 9, 10, 13, or 14 appears. The input conditions for the numbers 3, 8, 11, and 12 never occur in this system. For example, 7 corresponds to a,b,c,d being set to 0,1,1,1, respectively.
翻译:一个四输入 a, b, c, d 和一输出的逻辑电路,当输入为 2, 7 或 15 时,输出为 1, 当输入为 0, 1, 4, 5, 6, 9, 10, 13, 或 14 时,输出为 0,当输入为 3,8,11 或 12 时输出为任意值。举例来说,7 对应输入 abcd 为0,1,1,1。

注意: 该电路的SOP和POS必须均为化简后的最小值

Solution(不唯一,仅供参考):

module top_module (
    input a,
    input b,
    input c,
    input d,
    output out_sop,
    output out_pos
); 
    assign out_sop = c&d | (~a&~b&c);//最小项之和
    assign out_pos = c&(~b|d)&(~a|d); //嘴大项之积
endmodule

6. Karnaugh map

Practice:Implement this function. d is don’t-care, which means you may choose to output whatever value is convenient.
翻译:实现以下卡诺图的功能。d是don’t-care,这意味着您可以选择输出任何方便的值。
在这里插入图片描述

Solution(不唯一,仅供参考):

module top_module (
    input [4:1] x, 
    output f );
    assign f = (~x[1]&x[3]) | (x[2]&x[4]);
endmodule

7. Karnaugh map

Practice:Consider the function f shown in the Karnaugh map below. Implement this function.(The original exam question asked for simplified SOP and POS forms of the function.)
翻译:考虑下面卡诺图中显示的函数f。实现这个功能。
在这里插入图片描述

Solution(不唯一,仅供参考):

module top_module (
    input [4:1] x,
    output f
); 
    assign f = (~x[2]&~x[4])|(~x[1]&x[3])|(x[2]&x[3]&x[4]);
endmodule

8. K-map implemented with a multiplexer

Practice:For the following Karnaugh map, give the circuit implementation using one 4-to-1 multiplexer and as many 2-to-1 multiplexers as required, but using as few as possible. You are not allowed to use any other logic gate and you must use a and b as the multiplexer selector inputs, as shown on the 4-to-1 multiplexer below.
翻译:根据题目给出的卡诺图,用一个 4-1 的多路选择器和尽可能多的 2-1 多路选择器来实现电路,不允许使用其他逻辑门,必须使用 ab 作为选择器的输入。只需实现标记为top_module的部分,整个电路(包括 4 对 1 多路复用器)来实现卡诺图。
在这里插入图片描述

Solution(不唯一,仅供参考):

module top_module (
    input c,
    input d,
    output [3:0] mux_in
); 
    assign mux_in[0] = c|d;
    assign mux_in[1] = 0;
    assign mux_in[2] = (~c&~d)|(c&~d);
    assign mux_in[3] = c&d;
endmodule

Timing Diagram
在这里插入图片描述

总结

1、 遇到卡诺图时,可以先考虑化简得出最简逻辑表达式。表达式可用最小项之和与最大项之积表达。
2、本节的练习还是比较简单的,只要画出最简逻辑表达式就行了,当题目提供的卡诺时,注意观察卡诺图的00、01、10、11的位置,有的卡诺图摆放的位置不一样。

继续加油!!!!!

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值