OSDN Git Service

sdram test >> failed...
[motonesfpga/motonesfpga.git] / tools / qt_proj_test5 / alu_test.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_unsigned.all;
4
5 entity alu_test is 
6     port (  
7         d1    : in std_logic_vector(7 downto 0);
8         d2    : in std_logic_vector(7 downto 0);
9         d_out    : out std_logic_vector(7 downto 0);
10         carry_clr_n : in std_logic;\r
11         ea_carry : out std_logic\r
12         );
13 end alu_test;
14
15 architecture rtl of alu_test is
16
17 begin\r
18 \r
19     alu_p : process (d1, d2, carry_clr_n )\r
20     variable d_tmp : std_logic_vector(8 downto 0);\r
21     begin\r
22         d_tmp := ("0" & d1) + ("0" & d2);\r
23         d_out <= d_tmp (7 downto 0);\r
24         if (carry_clr_n = '0') then\r
25             ea_carry <= '0';\r
26         else\r
27             ea_carry <= d_tmp(8);\r
28         end if;\r
29     end process;
30
31 end rtl;
32