HDLBits刷题合集—10 Karnaugh Map to Circuit
HDLBits刷题合集—10 Karnaugh Map to Circuit
HDLBits-73 Kmap1
Problem Statement
实现下面卡诺图所描述的电路。
代码如下:
module top_module( input a, input b, input c, output out ); //不要习惯性写成“+”,要用或(“|”) assign out = a | b | c; endmodule
HDLBits-74 Kmap2
Problem Statement
实现下面卡诺图所描述的电路。
在写代码之前,尝试简化卡诺图。试试“和之积”和“积之和”两种形式。我们不能检查是否得到了卡诺图的最简形式。但是我们可以检查简化的卡诺图是否相等,还可以检查是否可以将卡诺图转换成电路。
代码如下:
module top_module( input a, input b, input c, input d, output out ); //sum-of-products assign out = ~b&~c | ~a&~d | b&c&d | a&c&d; //product-of-sums //assign out = (~b|c|~d) & (~a|~b|c) & (~a|~c|d) & (a|b|~c|~d); endmodule
HDLBits-75 Kmap3
Problem Statement
实现下面卡诺图所描述的电路。
代码如下:
module top_module( input a, input b, input c, input d, output out ); //sum-of-products assign out = a | ~b&c; //product-of-sums //assign out = (a|~b) & (a|c); endmodule
HDLBits-76 Kmap4
Problem Statement
实现下面卡诺图所描述的电路。
代码如下:
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
HDLBits-77 Exams/ece241 2013 q2
Problem Statement
有四个输((a、b、c、d)的单输出数字系统在输入端出现2、7或15时生成逻辑1,在输入端出现0、1、4、5、6、9、10、13、14时生成逻辑0。输入端不会出现3、8、11和12。例如,7对应于a、b、c、d分别设置为0,1,1,1。
确认输出out_sop为最简的积之和形式,输出out_pos为最简的和之积形式。
代码如下:
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 = (a | c) & (c | ~d) & (~a | d) & (~b | d); endmodule
HDLBits-78 Exams/m2014 q3
Problem Statement
实现下面卡诺图所描述的电路。其中d为无关项。
代码如下:
module top_module ( input [4:1] x, output f ); //sum-of-products //assign f = ~x[1]&x[3] | x[2]&x[4]; //product-of-sums assign f = (x[3] | x[4]) & (x[2] | x[3]) &(~x[1] | x[4]); endmodule
HDLBits-79 Exams/2012 q1g
Problem Statement
实现下面卡诺图所描述的电路。
代码如下:
module top_module ( input [4:1] x, output f ); //sum-of-products //assign f = ~x[2]&~x[4] | ~x[1]&x[3] | x[2]&x[3]&x[4]; //product-of-sums assign f = (x[3]|~x[4]) & (~x[2]|x[3]) & (~x[1]|x[2]|~x[4]) & (~x[1]|~x[2]|x[4]); endmodule
HDLBits-80 Exams/ece241 2014 q3
Problem Statement
对于下面的卡诺图,使用一个4选1多路选择器和尽可能多的2选1多路选择器实现电路,但是尽量少用(这里应该指2选1多路选择器)。不允许使用任何其他逻辑门,必须使用a和b作为多路选择器输入,如下面的4选1多路选择器所示。
代码如下:
module top_module ( input c, input d, output [3:0] mux_in ); assign mux_in = {c&d, ~d, 1'b0, c|d}; endmodule
Note
新手一枚,主要分享博客,记录学习过程,后期参考大佬代码或思想会一一列出。欢迎大家批评指正!
- HDLBits刷题合集—15 Finite State Machines-1
- HDLBits刷题合集—13 Shift Registers
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch10
- HDLBits刷题合集—12 Counters
- HDLBits刷题合集—11 Latches and Flip-Flops
- 4k HDR – 8 bit, 10 bit, 12 bit, and all the bits you need to know
- Use JsonReader.setLenient(true) to accept malformed JSON at line 10 column 2
- Short Guide to install Oracle 10 on Linux
- LINQ to SQL 性能 10 Tips
- 学习建议:10 steps to better research
- 10 Tips for Leading Your Team to Peak Performance(ZT)
- 条款10:令operator=返回一个reference to *this
- To_10_r_100_1---N个孩子站成一排,给每个人设定一个权重(已知)。按照如下的规则分配糖果
- Top 10 Things to Be Thankful for in .NET
- 【10】Find nth to last element of a singly linked list
- LINQ to SQL语句(10)之Insert
- How to think like a Computer Scientist: 课后习题第四章 10
- 10 ways to improve your programming skills
- Chinese Input Methods in Ubuntu 14, 13, 12, 11, and 10(How to Set Up Ubuntu Chinese IMEs)
- Effective C++ -----条款10: 令operator=返回一个reference to *this