Question

3. Study the VHDL code below for the multiplexer: -mux.vhd library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use jeee.std logic.arith.all; entity mux is port DIFF1, DIFF2: n std_logic_vector(4 downto O); ABSLT: out std_logic_vector(4 downto 0); CO: in std logic ); end mux; architecture behv of mux is begin with CO select ABSLT DIFF1 when o, a CO-0 selects B-A DIFF2 when 1,a Co-1 selects A-B ZZZZZ when others·.. high impedance otherwise end behy
0 0
Add a comment Improve this question Transcribed image text
Answer #1

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all

use ieee.std_logic_arith.all;

entity mux2 is port (

   DIFF1, DIFF2 : in std_logic_vector (4 dowto 0);

   ASLT : out std_logic_vector (4 downto 0);

   CO : in std_logic

);

architecture behv of mux is

begin

with CO select ABSLT <=

DIFF1 when '0',    -- B-A

DIFF2 when '1',    -- A-B

"zzzz" when others; -- High Impedance

end behv;

The above code explains about a mux which has input DIFF1(B-A) and DIFF2(A-B) and the output ABSLT of 5 bits each. It has the select line CO(Carry Out). When CO bit is '0' then the output shows the DIFF1 at the output port. And, when CO bit is '1' then the output shows the DIFF2 at the output port. When the CO is neither '0' or '1' then the output will be High Impedance "ZZZZ".

Add a comment
Know the answer?
Add Answer to:
3. Study the VHDL code below for the multiplexer: -mux.vhd library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a test bench for the following VHDL code -------------------------------------------------------------------------------------------------------------------------------- LIBRARY ieee ; USE ieee.std_logic_1164.all ;...

    Write a test bench for the following VHDL code -------------------------------------------------------------------------------------------------------------------------------- LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY registern IS GENERIC (N: INTEGER :=4);    -- INTEGER=32, 16, ….. PORT (D           : IN STD_LOGIC_VECTOR (N-1 downto 0); clk, reset, Load   : IN      STD_LOGIC ; Q           : OUT   STD_LOGIC_VECTOR (N-1 downto 0 )) ; END registern; ARCHITECTURE behavior OF registern IS BEGIN PROCESS (clk) BEGIN IF clk' EVENT AND clk='1' THEN IF (reset ='0') THEN    --synchronous reset Q<=(OTHERS=>’0’); ELSIF (L ='0') THEN Q<=D;...

  • 8.(5 points).There is an error in following VHDL code. Find the error and correct (only that...

    8.(5 points).There is an error in following VHDL code. Find the error and correct (only that line of code). LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY dec2to4 IS PORT (i IN STD LOGIC VECTOR (1 DOWNTO 0); : En IN STD_LOGIC; d OUT STD LOGIC); END dec2to4; ARCHITECTURE dataflow OF dec2to4 IS BEGIN SIGNAL Eni: STD_LOGIC_VECTOR(2 DOWNTO 0); Eni <= En & i; -concatenate signals WITH Eni SELECT d <"0001" WHEN "100" "0010" WHEN "101", "0100" WHEN "110", "1000" WHEN "111", 0000"...

  • QUESTION 1 Complete the following peice of VHDL code with the necessary VHDL statements for a...

    QUESTION 1 Complete the following peice of VHDL code with the necessary VHDL statements for a counter that counts through this sequence(0,9,17,15,4,26) repeatedly. library IEEE use IEEE.STD_LOGIC_1164 ALL entity GCC is Port ( systemClock, reset in STD_LOGIC end GCC architecture Behavioral of GCC is stateOutput out STD LOGIC_ VECTOR (4 downto 0)) component FreqDivider is Port (systemClock in STD_LOGIC; slowClock: out STD LOGIC); end component, signal nextState, presentState: std_logic_vector(5 downto 0) := "00000"; signal slowClock: std_logic begin FD0: FreqDivider port...

  • Name: ·5. (10 lts) Find and correct errors in the following VHDL ed. IEEE ; library use IEEE . STD LOGIC-1104 . all...

    Name: ·5. (10 lts) Find and correct errors in the following VHDL ed. IEEE ; library use IEEE . STD LOGIC-1104 . all; entity cicuitl is port (a, b, elk: in STD_LOGIC: This part of the code its correct.That is, the entity definition and the 1ibraries are written correctly S out STD LOGIC) ond; architecture synth of eicuiti is begin This part of the code ธhould be a process that groups input a and input b together to forn a...

  • Need help with VDHL code. THis is a random number generator. Want to be able so...

    Need help with VDHL code. THis is a random number generator. Want to be able so that a number is generated when a button is pushed, not when the clock is high. library IEEE; use IEEE.STD_LOGIC_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx leaf cells in this code. --library UNISIM; --use UNISIM.VComponents.all; library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity RanNum...

  • Problem 5 (8 pts) Write a VHDL code (including an entity definition and an architecture definition)...

    Problem 5 (8 pts) Write a VHDL code (including an entity definition and an architecture definition) to describe a 8:1 multiplexer in which each input port is of type STD_LOGIC_VECTOR and each input port has 4 bits, and the output Y is also a STD_LOGIC_VECTOR with 4 bits. Your code's architecture definition should use "with...select..." structure. The code to include header files is already given below. library IEEE; use IEEE.STD_LOGIC_1164.all;

  • Question 18 (5 points) LIBRARY ece USE ieee.std logic 1164.all ENTITY prob6 21 IS PORT (w...

    Question 18 (5 points) LIBRARY ece USE ieee.std logic 1164.all ENTITY prob6 21 IS PORT (w IN STD LOGIC VECTOR(3 DOWNTO 0) y: OUT STD LOGIC VECTOR(I DOWNTO 0)); END prob6 21 ARCHITECTURE Behavior OF prob6 21 IS BEGIN WITH w SELECT y <= "O0" WHEN "0001" ..01.. WHEN "O010", "10" WHEN 0100" 11" WHEN OTHERS END Behavior What type of circuit does the VHDL code represents? 4-bit shifter a 4-to-2 binary encoder A two bit multiplier None of the...

  • draw a block diagram of the circuit represented by the vhdl code listed below. be sure...

    draw a block diagram of the circuit represented by the vhdl code listed below. be sure to completely label the final diagram Draw a block diagram of the circuit represented by the VHDL code listed below. Be sure to completely label the final diagram. -- library declaration library IEEE; use IEEE.std logic 1164.all; -- entity entity ckti is Port (EN, EN2 : in std logic; CLK : in std logic; Z! out std logie); end ckt1; -- architecture architecture arch...

  • Identify and correct the mistakes of code. Identify and draw table for the circuit. library ieee;...

    Identify and correct the mistakes of code. Identify and draw table for the circuit. library ieee; 1 use ieee.std_logic_1164.all; 2 3 entity mux4x1_seq is 4. 5 port 6 ip0: ip1: ip2: ip3 in std_logic; 7 in std_logic_vector(0 to 1); out std_logic}; 9 op end mux4x1_seq}; 10 11 architecture beh of mux4x1_seq is 12 13 |begin 14 P_mux: process (ip0,ip1,ip2,ip3,s); variable temp: std_logic; 15 16 begin 17 case s is 18 temp ip0; when "00" => 19 when "01" temp ip1;...

  • Draw the RTL schematic of the hardware that will be synthesized for the VHDL code below....

    Draw the RTL schematic of the hardware that will be synthesized for the VHDL code below. entity unknown is port (x: in std_logic_vector(7 downto 0); op: in std_logic_vector(1 downto 0); clk: in std_logic; f: out std_logic_vector(7 downto 0)); end entity. architecture arch of unknown is signal a, b, c, d: std_logic_vector(7 downto 0); begin d <= x; process (clk) begin if (rising_edge(clk)) then a <= b; b <= c + a; c <= d; if (op = “00”) then f...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT