Designing The Logic
Coddy'nin Verilog Journey'sinin Temeller bölümünün bir parçası. Ders 44 / 90.
Görev
Mantığı tasarlamak, doğruluk tablosuna göre devrenin hangi denklemlere ihtiyaç duyduğunu belirlemek anlamına gelir.
Doğruluk Tablosu:
| a | b | sum | carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Adım 2: sum için örüntüyü bulma
- sum = 1, a=0,b=1 veya a=1,b=0 olduğunda
- sum = 1, a ve b farklı olduğunda
- Farklı = XOR →
sum = a ^ b
Adım 3: carry için örüntüyü bulma
- carry = 1 yalnızca a=1 ve b=1 olduğunda
- İkisi de = AND →
carry = a & b
Adım 4: Denklemleri yazma
sum = a ^ b
carry = a & b
Yapılacaklar:
Görevin, eksik mantık denklemlerini module içine eklemektir.
1. sum için bir assign ifadesi ekle (a XOR b)
2. carry için bir assign ifadesi ekle (a AND b)
Kendin dene
module half_adder (
input a,
input b,
output sum,
output carry
);
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