[HDLBits] Zero

2024. 10. 15. 14:16·Verilog/HDLBits
반응형
 

Zero - HDLBits

 

hdlbits.01xz.net


# 들어가며

HDLBits는 Verilog의 백준 같은 사이트이다. 여러가지 문제들이 있고, 그 문제를 직접 submit 할 수 있는 사이트이다. 혼자서 베릴로그를 공부하는 나에게는 굉장히 도움이 많이 되는 고마운 사이트이다.

 

코드를 submit 하고 나서는 다음과 같은 4개의 상태가 표시된다. 물론 Success를 받을 수 있도록 하는 것이 목표이다!

  • Compile Error — Circuit did not compile.
  • Simulation Error — Circuit compiled successfully, but simulation did not complete.
  • Incorrect — Circuit compiled and simulated, but the outputs did not match the reference.
  • Success! — Circuit was correct

# 문제

Build a circuit with no inputs and one output that outputs a constant 0

Now that you've worked through the previous problem, let's see if you can do a simple problem without the hints.

 

input이 없이 output으로만 이루어진 회로를 구성하시오. output은 항상 0을 출력해야합니다.

Module Declaration

module top_module(
    output zero
);

Baseline Code

module top_module(
    output zero
);// Module body starts after semicolon

endmodule

# 정답

module top_module(
    output zero
);// Module body starts after semicolon
	assign zero = 1'b0;
endmodule

# 풀이

wire zero에다가 0을 인가(assign)하면 되는 문제였다. 그렇게 되면 회로에서 출력은 항상 0이 될 것이다. 조심해야 할 것은, 그냥 0을 적는 것 보다 1'b0로 형식을 맞춰서 적는것이 좋다.

반응형

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

[HDLBits] Always if2  (1) 2024.12.16
[HDLBits] Wire  (0) 2024.10.15
[HDLBits] Getting Started  (0) 2024.10.15
'Verilog/HDLBits' 카테고리의 다른 글
  • [HDLBits] Always if2
  • [HDLBits] Wire
  • [HDLBits] Getting Started
kmuhan
kmuhan
나의 배움 너에게 가르침
  • kmuhan
    kmuhan의 도움이 되는 개발
    kmuhan
  • 전체
    오늘
    어제
    • 분류 전체보기 (24)
      • Web (5)
      • Algorithm (1)
      • Python (1)
      • Error (1)
      • Information (2)
      • Statistics (0)
      • Computer Network (0)
      • AI (9)
        • AI Hardware (8)
        • Paper reviews (1)
      • Verilog (5)
        • HDLBits (4)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    머신러닝
    firebase
    인공지능
    verilog
    베릴로그
    최적화
    인공지능 하드웨어
    TPU
    Systolic Array
    HDL
    딥러닝
    GPU
    nvidia
    hdlbits
    WEB
    React
    Firestore
    Deep Learning
    국민대학교
    Machine Learning
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
kmuhan
[HDLBits] Zero
상단으로

티스토리툴바