Recap - Number Formats
Teil des Abschnitts Grundlagen der Verilog-Journey von Coddy. Lektion 18 von 90.
Aufgabe
Vervollständige den Code, indem du die richtigen Werte in den angegebenen Formaten einträgst.
Aufgabe:
- Setze
aauf 8-bit binary für decimal 170 (10101010) - Setze
bauf 8-bit decimal für 255 - Setze
cauf 16-bit hex für FF - Setze
dauf einen 4-bit-Wert, bei dem bit 2 X ist (others 1) - Setze
eauf all bits Z (4 bits)
Probier es selbst
module number_formats;
wire [7:0] a, b;
wire [15:0] c;
wire [3:0] d, e;
assign a = ______; // 8-Bit-Binär für 170
assign b = ______; // 8-Bit-Dezimal für 255
assign c = ______; // 16-Bit-Hex für FF
assign d = ______; // 4-Bit: Bit 2 ist X, andere 1
assign e = ______; // 4-Bit: alle Bits 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
endmoduleAlle Lektionen in Grundlagen
1Einführung
Was ist VerilogHardware vs. SoftwareIhr erstes ModulKommentareAbstraktionsebenen des Designs4Operators 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Übe selbstständig: Online-Verilog-Compiler