HDLBits 系列(12)All about Karnaugh Map

目录

题目1

原题复现

我的设计

题目2

原题复现

我的设计


题目1

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

原题复现

Implement the circuit described by the Karnaugh map below.

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

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

f = a | ~bc;

我的设计

那么直接给出设计:

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

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的电路,下面给出我的设计:

我的设计

module top_module (
    input c,
    input d,
    output [3:0] mux_in
); 
	assign mux_in[0] = ({c,d} == 2'b00) ? 0 : 1;
	assign mux_in[1] = 0;
	assign mux_in[3] = ({c,d} == 2'b11) ? 1 : 0;
	assign mux_in[2] = ({c,d} == 2'b00 | {c,d} == 2'b10) ? 1 : 0;


endmodule

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李锐博恩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值