Wire Type
Coddy Verilog 여정의 기초 섹션에 포함된 레슨. 90개 중 6번째.
Verilog에서는 사용 중인 신호의 유형을 선언해야 합니다. 가장 일반적인 유형은 wire입니다.
wire는 구성 요소 간의 물리적 연결을 나타냅니다. 회로의 실제 전선과 같습니다.
- 와이어는 값을 저장할 수 없으며 값을 전달하기만 합니다
- 와이어는
assign문과 함께 사용됩니다 - 와이어는 모듈을 서로 연결하는 데 사용됩니다
Wire 선언하기
wire a; // 단일 비트 와이어
wire b, c; // 한 줄에 여러 와이어Wires 작동 방식
module wire_example;
wire x;
reg y;
assign x = y; // x는 항상 y를 따릅니다
endmodulex은(는) y에 연결되어 있습니다. y가 변경될 때마다 x도 즉시 변경됩니다.
Wires는 일반적으로 입력과 출력을 연결하는 데 사용됩니다:
module and_gate(
input a, // 'a'는 기본적으로 wire입니다
input b, // 'b'는 기본적으로 wire입니다
output c // 'c'는 기본적으로 wire입니다
);
assign c = a & b; // c는 이 할당에 의해 구동됩니다
endmodule이 예제에서 a, b, c는 모두 wire입니다.
wire는 회로의 여러 부분을 서로 연결하는 "접착제"입니다!
챌린지
해야 할 일:
temp라는 wire를 추가하세요
직접 해보기
module simple(
input a,
input b,
output c
);
assign c = a & b;
// 여기에 wire temp를 선언하세요
endmodule이 레슨에는 짧은 퀴즈가 포함되어 있습니다. 레슨을 시작해 문제를 풀고 진행 상황을 기록하세요.
기초의 모든 레슨
4Operators Part 1
Arithmetic OperatorsModulo OperatorComparison OperatorsRecap - Simple MathBitwise Operators7Assign And Gates
Continuous AssignmentAssign With OperatorsBuilt In Gate PrimitivesAND OR NOT GatesXOR XNOR GatesRecap - Logic Gate Circuit10Decision Making
If StatementIf - ElseRecap - Simple ComparatorCase StatementCasex And CasezRecap - ALU Design5Operators Part 2
Logical OperatorsReduction OperatorsShift OperatorsConcatenation OperatorConditional OperatorRecap - Operator Challenge3Number System
Binary RepresentationSized NumbersUnsized NumbersNegative NumbersSpecial Values X And ZRecap - Number Formats6Modules
Module StructureInput And Output PortsInout PortsModule InstantiationPort Mapping By NamePort Mapping By OrderRecap - Build A Module9Procedural Blocks
Always BlockInitial BlockSensitivity ListBlocking AssignmentNon Blocking AssignmentRecap - Always vs Initial15Traffic Light Controller
Defining The StatesState Machine Logic직접 연습해 보세요: 온라인 Verilog 컴파일러