Wire Type
CoddyのVerilogジャーニー「基礎」セクションの一部。レッスン 6/90。
Verilogでは、使用する信号の種類を宣言する必要があります。最も一般的な型は wire です。
wire はコンポーネント間の物理的な接続を表します。回路内の実際のwireのようなものです。
- wireは値を保存できません。値を通過させるだけです
- wireは
assign文とともに使用されます - wireはモジュール同士を接続するために使用されます
wire の宣言
wire a; // 単一ビットのワイヤ
wire b, c; // 1行に複数のワイヤwire の仕組み
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オンラインコンパイラ