0% found this document useful (0 votes)
1K views

Demux VHDL Code Using Behavioural Modeling

This document summarizes VHDL code for a behavioral model of a demultiplexer (demux). It includes: 1) An entity declaration defining the demux ports - an input (i), 2-bit select lines (sel), and 4-bit output (y). 2) An architecture with a process using a case statement to assign the input (i) to a specific output based on the select line value - "00" assigns i to y(0), "01" assigns i to y(1), etc. 3) Notes explaining that the process executes statements sequentially and the case statement is used to assign the input to the desired output according to the select line status.

Uploaded by

OP2R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Demux VHDL Code Using Behavioural Modeling

This document summarizes VHDL code for a behavioral model of a demultiplexer (demux). It includes: 1) An entity declaration defining the demux ports - an input (i), 2-bit select lines (sel), and 4-bit output (y). 2) An architecture with a process using a case statement to assign the input (i) to a specific output based on the select line value - "00" assigns i to y(0), "01" assigns i to y(1), etc. 3) Notes explaining that the process executes statements sequentially and the case statement is used to assign the input to the desired output according to the select line status.

Uploaded by

OP2R
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ONLINE PLATFORM FOR PROGRAMMING AND RESEARCH (OP2R)

DEMUX VHDL CODE USING BEHAVIOURAL MODELING

Library declaration
library IEEE;
Std_logic_1164; package for std_logic (predefined data type).
use IEEE.STD_LOGIC_1164.ALL;
------------------------------------------------------------------------

entity dmux_1 is
Port ( i: in std_logic;
sel: in std_logic_vector (1 downto 0);
y: out std_logic_vector (3 downto 0);
end dmux_1;
----------------------------------------------------------------------architecture Behavioral_dmux of dmux_1 is
begin
-------------------------------------------------------process (sel, i)
begin
case sel is
when "00" =>
y(0)<=i;y(1)<='0';y(2)<='0';y(3)<='0';
when "01" =>
y(0)<='0';y(1)<=i;y(2)<='0';y(3)<='0';
when "10" =>
y(0)<='0';y(1)<='0';y(2)<=i;y(3)<='0';
when others =>
y(0)<='0';y(1)<='0';y(2)<='0';y(3)<=i;
end case;
end process;
------------------------------------------------------end Behavioral_dmux;

RTL VIEW:-

INFOOP2R.WIX.COM/OP2R

OUT PUT WAVEFORMS

Entity declaration.
i :- input port bit.
Sel: select lines for selecting a particular
input in mux.
y: - output port bits.

This is the process statement. In


process statement all the
statements are executed in
sequence.
Here we are using case
statements. where, we want to
assign same value to different
outputs, we have used case
statement
According to the select line
status, case statement assigns
the input value to desire out.

You might also like