Recap - Build A Module
Teil des Abschnitts Grundlagen der Verilog-Journey von Coddy. Lektion 36 von 90.
Aufgabe
Diese Herausforderung vereint alles, was du in diesem Kapitel gelernt hast. Du wirst ein module von Grund auf erstellen und es instanziieren.
Was zu tun ist:
Part 1: Ein module namens <strong>flipflop</strong> erstellen mit:
- 1-Bit-input namens
clk - 1-Bit-input namens
d - 1-Bit-input namens
reset - 1-Bit-output namens
q(verwende reg, zugewiesen in einem always block)
Das module sollte folgendermaßen funktionieren:
- Wenn
reset1 ist, wirdqzu 0 - Andernfalls wird
qbei jeder Taktflanke zud
Part 2: Das <strong>flipflop</strong>-module im <strong>top</strong>-module mithilfe von port mapping nach Namen instanziieren
Verbinde die ports mit den folgenden Signalen:
- Port
clk→ Signalclock - Port
d→ Signaldata - Port
reset→ Signalreset_signal - Port
q→ Signalout
Probier es selbst
// Teil 1: Erstelle das flipflop-Modul
// TODO: Ports hinzufügen
// TODO: always-Block mit posedge clk und posedge reset hinzufügen
// Wenn reset 1 ist, q <= 0
// Sonst q <= d
// Teil 2: Top-Modul mit Instanziierung
module top (
input clock,
input data,
input reset_signal,
output out
);
// TODO: Instantiiere flipflop mit Instanzname ff1
// Verwende Port-Mapping nach Namen: .clk(clock), .d(data), .reset(reset_signal), .q(out)
endmoduleAlle Lektionen in Grundlagen
1Einführung
Was ist VerilogHardware vs. SoftwareIhr erstes ModulKommentareAbstraktionsebenen des Designs4Operators 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Übe selbstständig: Online-Verilog-Compiler