본문 바로가기

Verilog/HDLbits

[HDLBits] Vector5

1. 문제 및 설명

  • 아래 다이어그램을 설계하세요.

2. 모듈 정의

module top_module (
    input a, b, c, d, e,
    output [24:0] out );

 

 

 

3. 답

module top_module (
    input a, b, c, d, e,
    output [24:0] out );//

    // The output is XNOR of two vectors created by 
    // concatenating and replicating the five inputs.
    // assign out = ~{ ... } ^ { ... };
    assign out = ~{{5{a}}, {5{b}}, {5{c}}, {5{d}}, {5{e}}} ^ {5{a,b,c,d,e}};

endmodule

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

[HDLBits] Module pos  (0) 2025.11.02
[HDLBits] Module  (0) 2025.11.02
[HDLBits] Vector5  (0) 2025.09.08
[HDLBits] Vector4  (0) 2025.09.08
[HDLBits] Vectorr  (0) 2025.09.08