Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4530490
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:48:23+00:00 2026-05-21T13:48:23+00:00

I have big problem because i dont uderstand properly how make my homework. Well

  • 0

I have big problem because i dont uderstand properly how make my homework.
Well i have to make something like this:
http://tomaszewicz.zpt.tele.pw.edu.pl/files/u1/zad4.gif
I have code which create b1 but i dont knwo how to create the second and make them connect to b3.

My code is:

library ieee;
use ieee.std_logic_1164.all;

entity test is
generic(
n : integer := 4
);
port(
a, b, c, d : in std_logic_vector(n-1 downto 0);
s : in std_logic_vector(1 downto 0);
y : out std_logic_vector(n-1 downto 0)
);
end test;



-- przypisanie sekwencyjne - case
architecture arch_mux5 of test is
begin
pr_case: process(a,b,c,d,s)
begin
case s is
when "00" => y <= a;
when "01" => y <= b;
when "10" => y <= c;
when others => y <= d;
end case;
end process;
end arch_mux5;

architecture arch_mux6 of test is
begin
pr_if: process(a,b,c,d,s)
begin
y <= (others => '0'); -- latch jesli zakomentujemy, dlaczego?
if s = "00" then
y <= a;
end if;
if s = "01" then
y <= b;
end if;
if s = "10" then
y <= c;
end if;
if s = "11" then
y <= d;
end if;
end process;
end arch_mux6;

configuration cfg of test is
for arch_mux5
end for;
end cfg;

mux5 and mux6 seems to be the same but in different write method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T13:48:23+00:00Added an answer on May 21, 2026 at 1:48 pm

    You have to instantiate those multiplexers, e.g.:

    entity top is
      generic (
        n: integer:=4
      );
      port (
        a, b, c, d, e, f, g, h: in std_logic_vector(n-1 downto 0);
        s: in std_logic_vector(2 downto 0);
        y: out std_logic_vector(n-1 downto 0)
      );
    end entity top;
    
    architecture struct of top is
      signal t1, t2: std_logic_vector(n-1 downto 0);
      component test is
        generic(
          n : integer := 4
        );
        port (
          a, b, c, d : in std_logic_vector(n-1 downto 0);
          s : in std_logic_vector(1 downto 0);
          y : out std_logic_vector(n-1 downto 0)
        );
      end component test;
      component mux2 is
        generic(
          n : integer := 4
        );
        port (
          a, b : in std_logic_vector(n-1 downto 0);
          s : in std_logic;
          y : out std_logic_vector(n-1 downto 0)
        );
      end component test;
    begin
      b1: test
        generic_map (
          n => n
        );
        port map (
          a => a,
          b => b,
          c => c,
          d => d,
          s => s(1 downto 0),
          y => t1
        );
      b2: test
        generic_map (
          n => n
        );
        port map (
          e => a,
          f => b,
          g => c,
          h => d,
          s => s(1 downto 0),
          y => t2
        );
      b3: mux2
        generic_map (
          n => n
        );
        port map (
          a => t1,
          b => t2,
          s => s(2),
          y => y
        );
    end architecture struct;
    

    Of course you still have to write the entity+architecture for mux2. I didn’t test this code (don’t have a VHDL compiler here) but that should at least lead you into the correct direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using sqlalchemy. The question is simple, but I have a big problem, because
I have this big data-entry sort of page, a table kind of layout using
First please dont overlook because you might think it as common question, this is
I have a little/big problem in my app in android.I have 2 activity:Activity1 and
i am facing a big speed problem with my application..we have to go for
I think this is simple, but I am having big problem with this. I
I have a big problem using TBXML . When I use: + (NSString*) textForElement:(TBXMLElement*)aXMLElement
I have had a few problems with log files growing too big on my
I have big issue with url-rewriting for IIS 7.0. I've written simple module for
How would you maintain the legacy applications that: Has no unit tests have big

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.