본문 바로가기

All Posts59

[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.
[Verilog Problem] Wire 2 Problem descriptionmodule은 TOP이고 Input A, B Output X, Y, Z를 가지고 있습니다.A -> X, B -> Y, A -> ZCodemodule TOP ( input A, output B ); assign X=A; assign Y=B; assign Z=A; //equivalent //assign {X,Y, Z} = {A, B, A}endmoduleDescription여러개의 assign문이 존재하는 경우 순서는 중요하지 않습니다. 프로그래밍 언어와 다르게 항목에서 다른 항목으로 값을 복사하지 않고, 항목간의 연결을 의미합니다. 다시말해, 와이어 자체를 의미하지 않습니다.input, output의 wire 혹은 reg를 선언하지 않으면 wire를 기본으로 합니다. 2024. 5. 22.
[Verilog Problem] Wire 1 Problem descriptionmodule은 TOP이고 Input A, Output B를 가지고 있습니다.A는 B로 나갑니다. wire로 연결되어 있습니다.Codemodule TOP ( input A, output B ); assign B=A;endmoduleDescription연속 할당은 오른쪽을 왼쪽에 연속적으로 할당하므로 RHS의 변경 사항이 LHS에 즉시 표시됩니다.assign left_side = right_side;input, output의 wire 혹은 reg를 선언하지 않으면 wire를 기본으로 합니다. 2024. 5. 22.
반응형