본문 바로가기

Design15

[RTL Design] Clock Divider (2) 목차이전에 Clock Divider에 대해 쓴 글이 있습니다. 2023.07.21 - [Language/Verilog & SV] - [Verilog] Frequency(Clock) Divider [Verilog] Frequency(Clock) Divider목차 Frequency(Clock) Divider D F/F를 이용한 주파수 분할입니다. 간단하게 하나의 F/F를 거치면 2 분할됩니다. 카운터를 활용해서 분할할 수 도 있습니다. 생산 이후에 Clock divider를 잘못설계하면(ex. 홀vir-us.tistory.comClock Divider에 대해 학생 수준에서 설계를 진행할때, 보통은 D F/F를 이용하거나, Counter를 이용해서 Clock Divider를 만듭니다. 위 글도 마찬가지입니다... 2025. 7. 11.
[RTL Design] 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.
[RTL Design] 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.
[RTL Design] 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.
[RTL Design] 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.
[RTL Design] 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.
[RTL Design] 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.
[RTL Design] 1bit Half adder(반가산기) 목차Half adder1비트 이진수 두 개를 더한 합 Sum (S)과 자리올림 수 Carry (C)를 구하는 회로Codemodule half_adder ( input A, input B, output Sum, output Carry); assign Carry = A & B; assign Sum = A ^ B;endmodule">module half_adder ( input A, input B, output Sum, output Carry); assign Carry = A & B; assign Sum = A ^ B;endmoduleGate Primitive Codemodule half_adder ( input A, input B, output Sum, output Car.. 2023. 7. 23.
[RTL Design] Clock Divider (1) 목차Frequency(Clock) DividerD F/F를 이용한 주파수 분할입니다. 간단하게 하나의 F/F를 거치면 2 분할됩니다. 카운터를 활용해서 분할할 수 도 있습니다. 생산 이후에 Clock divider를 잘못설계하면(ex. 홀수 분주 시 Timing 고려하지 않은 경우) clock glitch가 발생할 수 있습니다. 간단하게 말해서 clock내 Timing문제가 생겨 해당 clock를 사용하거나 동기화된 모든 기능이 먹통이 될 수 있습니다. 제일 안전하게 분주하는 방법은 F/F를 활용하여 짝수 분주하는 방법입니다. CodeD F/F를 이용한 Clock divide Code입니다. 위 그림의 D F/F가 연달아 3개 이어져 있다고 생각하시면 됩니다.module clkdiv ( input clk.. 2023. 7. 21.
반응형