library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mux2x1 is
Port ( i : in STD_LOGIC_VECTOR (1 downto 0);
s : in STD_LOGIC;
y : out STD_LOGIC);
end mux2x1;
architecture df of mux2x1 is
begin
with s select
y<= i(0) when '0',
i(1) when '1',
'0' when others;
end df;
Chat with our AI personalities
Since a fulladder can be obtained by using 2 halfadders & 1 OR gate.....so we have to call an halfadder program as well as an OR program......this can be implemented easily with the help of structural model rather than dataflow and behavoioural model
library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity pa isPort ( a : in STD_LOGIC_VECTOR (3 downto 0);b : in STD_LOGIC_VECTOR (3 downto 0);ci : in STD_LOGIC;co : out STD_LOGIC;s : out STD_LOGIC_VECTOR (3 downto 0));end pa;architecture Behavioral of pa is--signal declarationsignal c:std_logic_vector(2 downto 0);--component declarationcomponent fadfPort ( ain : in STD_LOGIC;bin : in STD_LOGIC;cin : in STD_LOGIC;sum : out STD_LOGIC;cout : out STD_LOGIC);end component;beginu0:fadf port map(a(0),b(0),ci,s(0),c(0));u1:fadf port map(a(1),b(1),c(0),s(1),c(1));u2:fadf port map(a(2),b(2),c(1),s(2),c(2));u3:fadf port map(a(3),b(3),c(2),s(3),co);end Behavioral;
4!/(2!*2!) = 4*3*2*1/(2*1*2*1) = 6 4!/(2!*2!) = 4*3*2*1/(2*1*2*1) = 6 4!/(2!*2!) = 4*3*2*1/(2*1*2*1) = 6 4!/(2!*2!) = 4*3*2*1/(2*1*2*1) = 6
1/2
1 1/2 + 1 1/2 Hope it helps! Also try: 1 1/4 + 1 3/4