4 Bit Counter
Coddy'nin Verilog Journey'sinin Temeller bölümünün bir parçası. Ders 84 / 90.
Görev
0'dan 15'e kadar sayan ve tekrar 0'a dönen 4 bitlik bir counter oluşturun.
Modül Arayüzü
| Port | Yön | Genişlik | Açıklama |
|---|---|---|---|
clk | input | 1 bit | Saat sinyali |
reset | input | 1 bit | counter değerini 0'a sıfırla |
count | output | 4 bits | Mevcut counter değeri |
Doğruluk Tablosu
| Saat Döngüsü | count |
|---|---|
| Sıfırlamadan sonra | 0 |
| 1 | 1 |
| 2 | 2 |
| ... | ... |
| 15 | 15 |
| 16 | 0 (başa döner) |
Göreviniz aşağıdaki modülü tamamlamaktır.
Yapılacaklar:
resetdurumundacountdeğerini 0 olarak ayarlayın- Her yükselen saat kenarında
countdeğerini 1 artırın count15'e ulaştığında, sonraki artırma işlemi 0'a dönmelidir
Kendin dene
module counter (
input clk,
input reset,
output reg [3:0] count
);
// TODO: posedge clk ve posedge reset ile always bloğu ekle
// Reset'te: count <= 0
// Aksi halde: count <= count + 1
endmoduleTemeller bölümündeki tüm dersler
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 LogicKendi başına pratik yap: Online Verilog derleyicisi