HDLBits - Vectors

2024. 12. 9. 23:01·HDLBits/Verilog

https://hdlbits.01xz.net/wiki/Vector0

Vector의 사용법에 대해 알아보는 문제

input [2:0] vec이 있을때,
각각의 vector를 하나씩 output으로 선언할 수도 있고,
통째로 원하는 만큼 선언도 가능하다.
쉽게 보면 C언어의 배열? 같은 느낌인데
Wire를 묶어서 생각하면 된다고 나는 이해했다.

module top_module ( 
    input  wire [2:0] vec,
    output wire [2:0] outv,
    output wire o2,
    output wire o1,
    output wire o0  
); 
// Module body starts after module declaration
    assign outv = vec;
    assign o2 = vec[2];
    assign o1 = vec[1];
    assign o0 = vec[0];

endmodule
저작자표시 비영리 변경금지 (새창열림)
'HDLBits/Verilog' 카테고리의 다른 글
  • HDLBits-Vector2
  • HDLBits - Vector1
  • HDLBits - 7458 chip
  • HDLBits - Declaring wires
Zi_Yoon
Zi_Yoon
머리 속에 정리하는 곳 <전자공학>
  • Zi_Yoon
    ZY_repo
    Zi_Yoon
  • 전체
    오늘
    어제
    • 분류 전체보기 (70)
      • HDLBits (25)
        • Verilog (19)
        • Circuits (4)
        • Verification (0)
      • IDEC 교육 (1)
        • Embedded C (13)
        • Verilog HDL (8)
      • Hardware (8)
        • RISC-V Project (1)
        • Computer Architecture (0)
        • AMBA (2)
        • FPGA (0)
        • 논문 읽기 (1)
        • ETC. (4)
      • 42서울 (13)
        • 리눅스 (12)
        • 네트워크 (1)
      • 생각 (1)
      • 취업 (1)
  • 블로그 메뉴

    • 홈
    • 태그
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    signal trap
    IDEC
    verilator
    ARM
    c
    AppArmor
    hdlbits
    lsblk
    verilog
    embedded
    fucntion
    pointer
    AMBA
    QUARTUS
    charater
    centos
    debian
    APT
    vm
    fpga
    RISC-V
    보안 쉘
    비대칭 키
    research rabbit
    세션 키
    axi
    ssh
    bit-wise and
    AXI4
    Keil
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
Zi_Yoon
HDLBits - Vectors
상단으로

티스토리툴바