본문 바로가기

Verilog/HDLbits

[HDLBits] Exams/ece241 2014 q3

1. 문제 및 설명

  •  다음 카르노 맵에 대해, 아래 그림과 같이 동작할 수 있도록 top_module를 설계하시오 
  • Mux를 제외한 다른 논리 게이트는 사용할 수 없습니다.

 

 

 

2. 모듈 정의

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

 

 

 

3. 답

module top_module (
    input c,
    input d,
    output [3:0] mux_in
); 
    assign mux_in[0] = c?1:d;//c|d
    assign mux_in[1] = 1'b0;
    assign mux_in[2] = d?1'b0:1'b1;//!d
    assign mux_in[3] = c?d:0;//c&d

endmodule

'Verilog > HDLbits' 카테고리의 다른 글

[HDLBits] Dff8  (0) 2025.12.20
[HDLBits] Dff  (0) 2025.12.20
[HDLBits] Exams/2012 q1g  (0) 2025.12.16
[HDLBits] Exams/m2014 q3  (0) 2025.12.16
[HDLBits] Exams/ece241 2013 q2  (0) 2025.12.16