Recap - Build A Module
Coddy Verilog 여정의 기초 섹션에 포함된 레슨. 90개 중 36번째.
챌린지
이 challenge는 이 장에서 배운 모든 내용을 결합합니다. 처음부터 module을 Create하고 Instantiate하게 됩니다.
수행할 작업:
Part 1: <strong>flipflop</strong>이라는 module을 다음과 같이 Create하세요:
-
clk라는 이름의 1비트 input -
d라는 이름의 1비트 input -
reset이라는 이름의 1비트 input -
q라는 이름의 1비트 output (reg를 사용하고 always block에서 할당)
module은 다음과 같이 작동해야 합니다:
reset이 1이면q는 0이 됩니다.- 그렇지 않으면 각 clock edge에서
q는d가 됩니다.
Part 2: 이름을 사용한 port mapping으로 <strong>top</strong> module에 <strong>flipflop</strong> module을 Instantiate하세요.
다음 신호에 ports를 연결하세요:
- Port
clk→ 신호clock - Port
d→ 신호data - Port
reset→ 신호reset_signal - Port
q→ 신호out
직접 해보기
// 파트 1: flipflop 모듈 생성
// TODO: 포트 추가
// TODO: posedge clk과 posedge reset이 있는 always 블록 추가
// reset이 1이면, q <= 0
// 그렇지 않으면 q <= d
// 파트 2: 인스턴스화가 있는 Top 모듈
module top (
input clock,
input data,
input reset_signal,
output out
);
// TODO: 인스턴스 이름 ff1로 flipflop 인스턴스화
// 이름으로 포트 매핑 사용: .clk(clock), .d(data), .reset(reset_signal), .q(out)
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 컴파일러