A 2-to-1 multiplexer – WITH-SELECT-WHEN statement A 2-to-1 multiplexer – WHEN-ELSE statement A 2-to-1 multiplexer – IF statement 4 Bit Ripple Carry Model using For Statement4 Bit Ripple Carry Model Want to write a VHDL model for a 4 bit ripple carry adder. Logic equation for each full adder is: sum | VHDL Examples Combinational Logic Figure VHDL code for a 2-to-1 multiplexer LIBRARY ieee ; USE ; ENTITY mux2to1 IS PORT ( w0, w1, s : IN STD_LOGIC ; f : OUT STD_LOGIC ) ; END mux2to1 ; ARCHITECTURE Behavior OF mux2to1 IS BEGIN WITH s SELECT f f f <= w1 ; END CASE ; END PROCESS ; END Behavior ; A 2-to-1 multiplexer – CASE statement (a) Graphical symbol f s w 0 w 1 0 1 (b) Truth table 0 1 f s w 0 w 1 LIBRARY ieee ; USE ; ENTITY mux4to1 IS PORT ( w0, w1, w2, w3 : IN STD_LOGIC ; s : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; f : OUT STD_LOGIC ) ; END mux4to1 ; ARCHITECTURE Behavior OF mux4to1 IS BEGIN WITH s SELECT f <= w0 WHEN .