Designing The Logic
Coddy Verilog 여정의 기초 섹션에 포함된 레슨. 90개 중 44번째.
챌린지
논리를 설계한다는 것은 진리표를 바탕으로 회로에 어떤 방정식이 필요한지 알아내는 것을 의미합니다.
진리표:
| a | b | sum | carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
2단계: sum의 패턴 찾기
- a=0,b=1 또는 a=1,b=0일 때 sum = 1
- a와 b가 다를 때 sum = 1
- 다름 = XOR →
sum = a ^ b
3단계: carry의 패턴 찾기
- a=1이고 b=1일 때만 carry = 1
- 둘 다 = AND →
carry = a & b
4단계: 방정식 작성하기
sum = a ^ b
carry = a & b
할 일:
여러분의 과제는 module 안에 누락된 논리 방정식을 추가하는 것입니다.
1. sum에 대한 assign 문 추가하기 (a XOR b)
2. carry에 대한 assign 문 추가하기 (a AND b)
직접 해보기
module half_adder (
input a,
input b,
output sum,
output carry
);
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 컴파일러