본문 바로가기

Language/Verilog & SV24

[Verilog] Sequential/parallel block 목차Sequential block(순차블록): begin-endDeclaration of data, local parameter, parameter, let, and statementsr은 순차적으로 #d마다 변화합니다.parameter d = 50;reg [7:0] r; // a waveform controlled begin // by sequential delay #d r = ’h35; #d r = ’hE2; #d r = ’h00; #d r = ’hF7; #d -> end_wave;// trigger an event // called end_waveend Parallel block(병렬블록): fork-joinThe timin.. 2025. 1. 28.
[System Verilog] Bitwise, 감소 연산자(Reduction Operators) 목차 Reduction Operator Reduction Operator들은 벡터를 단 하나의 비트로만 줄입니다.Bitwise 연산입니다.If there are the characters Z and X, the result can be a known value.Example​ a = 5’b10101 b = 4’b0011 c = 3’bz00 d = 3’bx011 Character Operation performed Example Type&And all bits&a = 1’b0, &d = 1’b0Unary~&Nand all bits~&a = 1’b1Unary|Or all bits|a = 1’b1, |c = 1’bXUnary~|Nor all bits~|a= 1’b0Unary^Xor all bits^a = 1’.. 2024. 11. 16.
[Verilog Problem] NOR Gate Problem descriptionmodule은 TOP이고 Input inA, inB Output out를 가지고 있습니다.inA와 inB는 NOR Gate를 통해 out으로 나갑니다.Codemodule TOP ( input inA, input inB, output out); assign out=~(inA|inB);endmoduleDescription"|"는 bit, "||"는 논리 연산자 입니다."~|"은 NOR bit 연산자 입니다. 2024. 5. 24.
[Verilog Problem] XNOR Gate Problem descriptionmodule은 TOP이고 Input inA, inB Output out를 가지고 있습니다.inA와 inB는 XNOR Gate를 통해 out으로 나갑니다.Codemodule TOP ( input inA, input inB, output out); assign out=~(inA^inB);//assign out = inA~^inB;endmoduleDescription"^" XOR bit 연산자입니다."~^", "^~" XNOR bit 연산자입니다. 2024. 5. 24.
[Verilog Problem] And gate Problem descriptionmodule은 TOP이고 Input inA, inB Output out를 가지고 있습니다.inA와 inB는 AND Gate를 통해 out으로 나갑니다.Codemodule TOP ( input inA, input inB, output out); assign out=inA&inB;endmoduleDescriptionAND은 "&"로 처리할 수 있습니다."&"는 bit, "&&"는 논리 연산자 입니다.Gate level에서는 cell를 instance해서 사용합니다.연속 할당은 오른쪽을 왼쪽에 연속적으로 할당하므로 RHS의 변경 사항이 LHS에 즉시 표시됩니다.input, output의 wire 혹은 reg를 선언하지 않으면 wire를 기본으로 합니다. 2024. 5. 24.
[Verilog Problem] Inverter (Not gate) Problem descriptionmodule은 TOP이고 Input A, Output B를 가지고 있습니다.A는 B로 invert를 통해 나갑니다.Codemodule TOP ( input A, output B ); assign B=~A;endmoduleDescription"~" 각 비트를 반전(보수를 취함)합니다. "!"의 경우 논리연산자로 신호 및 표현식에 대한 논리적인 부정을 뜻합니다.연속 할당은 오른쪽을 왼쪽에 연속적으로 할당하므로 RHS의 변경 사항이 LHS에 즉시 표시됩니다.input, output의 wire 혹은 reg를 선언하지 않으면 wire를 기본으로 합니다. 2024. 5. 22.
반응형