본문 바로가기

Verilog/HDLbits

[HDLBits] Vector4

1. 문제 및 설명

  • 8비트 숫자를 32비트로 부호 확장하는 회로를 설계하시오.

2. 모듈 정의

module top_module (
    input [7:0] in,
    output [31:0] out );

 

 

 

3. 답

module top_module (
    input [7:0] in,
    output [31:0] out );//

    assign out = {{24{in[7]}}, in};

endmodule

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

[HDLBits] Vector5  (0) 2025.11.02
[HDLBits] Vector5  (0) 2025.09.08
[HDLBits] Vectorr  (0) 2025.09.08
[HDLBits] Vector3  (1) 2025.08.27
[HDLBits] Gates4  (0) 2025.08.27