- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am tried to write VHDL code for 1 to 8 Demux and that's what i finish with it LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; use ieee.std_logic_unsigned.all; ENTITY Dmux1to8 IS PORT ( X : IN STD_LOGIC; S : IN STD_LOGIC_VECTOR(0 TO 2); En : IN STD_LOGIC; W : OUT STD_LOGIC_VECTOR(0 TO 7)); END Dmux1to2; ARCHITECTURE Structure OF Dmux1to8 IS SIGNAL m : STD_LOGIC_VECTOR(0 TO 5); BEGIN G1: FOR i IN 0 TO 1 GENERATE Dec_ri: Demux1to2 PORT MAP ( m(i), S(0), X); G2: FOR i IN 2 TO 5 GENERATE Dec_left: Demux1to2 PORT MAP ( m(i), S(1)); END GENERATE ; END GENERATE ; Demux5: Demux1 to 8 PORT MAP ( m(2),m(3),m(4),m(5), S(2), W(0 TO 7) ); END Structure; can any one told me if is it right or not? if there are any mistakes can you help me to correct it ?Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are mistakes.
Try and compile it and you'll get an error report.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what are the mistakes ?
i can't because the programme is not working with me :(- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like I said on EDA board, there are plenty of errors.
its not going to work, because 1. you havent included any libraries for the demuxes to be taken from. 2. Without the library, there is no component declarations. 3. In demux 5, you cannot have spaces in the name. I have no idea if its going to work even when the above are fixed, becaise you havent included the code for the demuxes. Why didnt you try and run it throguh a compiler instead of just pasting code in a post? Now it seems a new error is no compiler.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you mean "Selector"?
if this is the case, why should you insert by GENERATE statement? If the following signals: inputs : std_logic_vector (7 downto 0); select : std_logic_vector (2 downto 0); output : std_logic; Then just write the following combinatorial code: output <= input (to_integer(unsigned(select))); the "unsigned" function tells VHDL to threat the "select" bus as UNSIGNED, with no negative numbers interpretation. the "to_integer" function converts the "select" bus to integer value so i may be used for indexing the "inputs" array. don't forget to add the libraries, like these ones: use ieee.std_logic_unsigned.all; use ieee.numeric_std.to_integer;- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- i can't because the programme is not working with me :( --- Quote End --- I suggest you fix this problem first then.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page