FPGA Ultimate 2-VHDL 및 Velilog-
VHDL
IEEE 1076으로 표준화되었습니다.최신판은 IEEE 1076-2019이지만 대응하는 도구가 아직 적기 때문에 IEEE 1076-2008은 실질적으로 최신판이라고 할 수 있다.
확장자는 입니다.vhd입니다.윈도우즈라면 하드디스크 이미지 파일로 수신될 때도 있습니다.나는 vhdl도 괜찮다고 생각한다.
Velilog
IEEE1364로 표준화.최신 버전은 IEEE1364-2005입니다.후속 언어인 System Verilog도 IEE 1800으로 표준화됐다.최신판은 IEEE 1800-2017이다.Velilog보다 다루기 쉬운 면이 있기 때문에 앞으로 공부하려면 System Verilog가 더 좋을 수 있다.
verilog의 확장자는시스템 Verilog의 확장자는 입니다.sv.
설명 예
예를 들면 다음과 같은serialadder 회로의 설명 예는 다음과 같다.
색상이 있는 사각형으로 둘러싸인 부분의 기능은 각각 아래의 느낌입니다.
블록
기능
half_adder
A와 B의 XOR를 S로, A와 B의 AND를 C로 출력
full_adder
후단halfadder의 A 앞 부분 halfadder의 S 후면half 입력 -adder의 B 후면half에 X 입력 -adder의 S를 S 전면과 후면의half-adder의 C OR을 C로 내보내기
serial_adder
A와 B는 각각 풀입니다.adder의 A 및 B 입력adder의 S를 S로 내보내기D-FF의 D에 adder C 가져오기adder의 X에 CLK 연결 D-FF 입력
각각 소스 코드로 안쪽부터 순서대로 기술하다.
VHDL
half_adder.vhd
library IEEE;
use IEEE.std_logic_1164.all;
entity half_adder is
  port ( 
    A : in  std_logic;
    B : in  std_logic;
    S : out std_logic;
    C : out std_logic
  );
end entity half_adder;
architecture RTL of half_adder is
begin
  S <= A xor B;
  C <= A and B;
end architecture RTL;
library IEEE;
use IEEE.std_logic_1164.all;
entity full_adder is
  port ( 
    A : in  std_logic;
    B : in  std_logic;
    X : in  std_logic;
    S : out std_logic;
    C : out std_logic
  );
end entity full_adder;
architecture RTL of full_adder is
component half_adder is
  port ( 
    A : in  std_logic;
    B : in  std_logic;
    S : out std_logic;
    C : out std_logic
  );
end component half_adder;
signal S1 : std_logic;
signal C1 : std_logic;
signal C2 : std_logic;
begin
half_adder1 : half_adder
  port map ( 
    A => A,
    B => B,
    S => S1,
    C => C1
  );
half_adder2 : half_adder
  port map ( 
    A => S1,
    B => X,
    S => S,
    C => C2
  );
  C <= C1 or C2;
end architecture RTL;
library IEEE;
use IEEE.std_logic_1164.all;
entity serial_adder is
  port ( 
    A   : in  std_logic;
    B   : in  std_logic;
    CLK : in  std_logic;
    S   : out std_logic
  );
end entity serial_adder;
architecture RTL of serial_adder is
component full_adder is
  port ( 
    A : in  std_logic;
    B : in  std_logic;
    X : in  std_logic;
    S : out std_logic;
    C : out std_logic
  );
end component full_adder;
signal C1 : std_logic;
signal Q1 : std_logic;
begin
full_adder1 : full_adder
  port map ( 
    A => A,
    B => B,
    X => Q1,
    S => S,
    C => C1
  );
  process(CLK) begin
    if(CLK'event and CLK = '1') then
      Q1 <= C1;
    end if;
  end process;
end architecture RTL;
Velilog
half_adder.v
module half_adder
  ( 
    input  wire A,
    input  wire B,
    output wire S,
    output wire C
  );
  assign S = A ^ B;
  assign C = A & B;
endmodule
module full_adder
  ( 
    input  wire A,
    input  wire B,
    input  wire X,
    output wire S,
    output wire C 
  );
wire S1;
wire C1;
wire C2;
half_adder half_adder1
  ( 
    .A(A),
    .B(B),
    .S(S1),
    .C(C1)
  );
half_adder half_adder2
  (
    .A(S1),
    .B(X),
    .S(S),
    .C(C2)
  );
  assign C = C1 | C2;
endmodule
module serial_adder
  ( 
    input  wire A,
    input  wire B,
    input  wire CLK,
    output wire S
  );
wire C1;
reg  Q1;
full_adder full_adder1
  ( 
    .A(A),
    .B(B),
    .X(Q1),
    .S(S),
    .C(C1)
  );
  always@(posedge CLK) begin
    Q1 <= C1;
  end
endmodule
사실 이 Serial은...adder는 2진 덧셈을 하는 필산 회로로 덧셈을 하려는 2개의 수를 2진수로 설정하고 CLK가 최하위bit부터 순서대로 입력하면 출력 S가 최하위bit부터 순서대로 덧셈 결과를 계산한다.
full_adder는 A+B+X의 덧셈 연산을 하는데 그 결과는 C와 S(C는 bit1, S는 bit0)에 나타나기 때문에 더욱 간단한 문법으로 같은 동작을 할 수 있다.
serial_adder2.vhd
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity serial_adder2 is
  port ( 
    A   : in  std_logic;
    B   : in  std_logic;
    CLK : in  std_logic;
    S   : out std_logic
  );
end entity serial_adder2;
architecture RTL of serial_adder2 is
signal add : std_logic_vector(1 downto 0);
signal Q1  : std_logic;
begin
  add <= ('0' & A) + ('0' & B) + ('0' & Q1);
  S   <= add(0);
  process(CLK) begin
    if(CLK'event and CLK = '1') then
      Q1 <= add(1);
    end if;
  end process;
end architecture RTL;
module serial_adder2
  ( 
    input  wire A,
    input  wire B,
    input  wire CLK,
    output wire S
  );
wire [1:0] add;
reg  Q1;
  assign add = A + B + Q1;
  assign S   = add[0];
  always@(posedge CLK) begin
    Q1 <= add[1];
  end
endmodule
Reference
이 문제에 관하여(FPGA Ultimate 2-VHDL 및 Velilog-), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/sk6labo/articles/bd6209dfba69f6텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)