Recap - Number Formats
Coddy Verilog 여정의 기초 섹션에 포함된 레슨. 90개 중 18번째.
챌린지
지정된 형식에 맞는 올바른 값을 작성하여 코드를 완성하세요.
할 일:
a를 decimal 170(10101010)에 해당하는 8-bit binary로 설정하세요b를 255에 해당하는 8-bit decimal로 설정하세요c를 FF에 해당하는 16-bit hex로 설정하세요d를 bit 2가 X이고 others가 1인 4-bit 값으로 설정하세요e를 all bits가 Z인 값(4 bits)으로 설정하세요
직접 해보기
module number_formats;
wire [7:0] a, b;
wire [15:0] c;
wire [3:0] d, e;
assign a = ______; // 170에 대한 8비트 이진수
assign b = ______; // 255에 대한 8비트 십진수
assign c = ______; // FF에 대한 16비트 16진수
assign d = ______; // 4비트: 비트 2는 X, 나머지는 1
assign e = ______; // 4비트: 모든 비트가 Z
initial begin
$display("a = %b", a);
$display("b = %b", b);
$display("c = %h", c);
$display("d = %b", d);
$display("e = %b", e);
$finish;
end
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 컴파일러