Verilog语法基础HDL Bits训练 09

Circuits:Karnaugh Map to Circuit

一、3-variable

在这里插入图片描述
本小节讲通过卡诺图化简得出表达式
本题化简完毕是
在这里插入图片描述

  • RTL代码
module top_module(
    input a,
    input b,
    input c,
    output out  ); 

    assign out = ~(~a & ~b & ~c);
        
endmodule
  • 仿真波形图
    在这里插入图片描述

二、4-variable

在这里插入图片描述
卡诺图化简结果为
在这里插入图片描述

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

endmodule
  • 仿真波形图
    在这里插入图片描述

三、4-variable

在这里插入图片描述
卡诺图化简为(要注意看外一行的数字,有陷阱)
在这里插入图片描述

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

endmodule
  • 仿真波形图
    在这里插入图片描述

四、4-variable

在这里插入图片描述

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

endmodule
  • 仿真波形图
    在这里插入图片描述

五、Minimum SOP and POS

在这里插入图片描述
SOP是以1为中心圈卡诺圈,POS是以0为中心圈卡诺圈,二者用的是同一张卡诺图。

  • RTL代码
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

六、Karnaugh map

在这里插入图片描述

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

endmodule

七、Karnaugh map

在这里插入图片描述

  • RTL代码
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

八、K-map implemented with a multiplexer

在这里插入图片描述

  • RTL代码
module top_module (
    input c,
    input d,
    output [3:0] mux_in
); 

    assign mux_in[0] = c | d;
    assign mux_in[1] = 1'b0;
    assign mux_in[2] = ~d;
    assign mux_in[3] = c & d;

endmodule
  • 仿真波形图
    在这里插入图片描述
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值