コード比較 -----verilog----- module mod_a ( input clk, input rst_x, input [7:0] i_in, output reg [7:0] o_out ); always @(posedge clk or negedge rst_x) begin if (~rst_x) o_out <= 8'h0; else o_out <= i_in; end endmodule
----- 糞VHDL ----- library IEEE; use IEEE.std_logic_1164.all;
entity mod_a is port ( clk : in std_logic; rst_x: in std_logic; i_in : in std_logic_vector(7 downto 0); o_out : out std_logic_vector(7 downto 0) ); end mod_a;
architecture rtl of mod_a is signal r_out : std_logic_vector(7 downto 0); begin process (clk, rst_x) begin if (rst_x = '0') then r_out <= (others => '0'); elsif (clk'event and clk = '1') then r_out <= i_in; end if; end process; o_out <= r_out; end rtl;