HDLBits 系列(12)All about Karnaugh Map

举报
李锐博恩 发表于 2021/07/15 03:46:54 2021/07/15
【摘要】 目录 题目1 原题复现 我的设计 题目2 原题复现 我的设计 题目1 这篇博文主要就是练习一下卡诺图的东西,然后选取几个经典的案例吧,如下: 原题复现 Implement the circuit described by the Karnaugh map below. d的意思就是不关系,也即do not care的意思。 把有利于化简的d看做1...

目录

题目1

原题复现

我的设计

题目2

原题复现

我的设计


题目1

这篇博文主要就是练习一下卡诺图的东西,然后选取几个经典的案例吧,如下:

原题复现

Implement the circuit described by the Karnaugh map below.

d的意思就是不关系,也即do not care的意思。

把有利于化简的d看做1,否则为0比较能够化简出最简的表达式:

f = a | ~bc;

我的设计

那么直接给出设计:


  
  1. module top_module(
  2. input a,
  3. input b,
  4. input c,
  5. input d,
  6. output out );
  7. assign out = a | ~b&c;
  8. endmodule

 

题目2

原题复现

这个题目很简单,下面再给出一个稍微有点变了样子的卡诺图相关题目:
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.You are implementing just the portion labelled top_module, such that the entire circuit (including the 4-to-1 mux) implements the K-map.

简言之就是让设计上图中的top_module的电路,下面给出我的设计:

我的设计


  
  1. module top_module (
  2. input c,
  3. input d,
  4. output [3:0] mux_in
  5. );
  6. assign mux_in[0] = ({c,d} == 2'b00) ? 0 : 1;
  7. assign mux_in[1] = 0;
  8. assign mux_in[3] = ({c,d} == 2'b11) ? 1 : 0;
  9. assign mux_in[2] = ({c,d} == 2'b00 | {c,d} == 2'b10) ? 1 : 0;
  10. endmodule

 

 

 

 

 

 

文章来源: reborn.blog.csdn.net,作者:李锐博恩,版权归原作者所有,如需转载,请联系作者。

原文链接:reborn.blog.csdn.net/article/details/103225436

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。