Question

In: Electrical Engineering

please can you do VHDL coding for 8:3 priority encoder with test banch and run and...

please can you do VHDL coding for 8:3 priority encoder with test banch and run and simulating in modelsim Also , can make the code easy to copy and big screen for waveform

please help me please

Solutions

Expert Solution

--VHDL Code

library ieee;
use ieee.std_logic_1164.all;

entity p_encoder8to3 is
   port (   enable   : in std_logic;
       din   : in std_logic_vector(7 downto 0);
       dout   : out std_logic_vector(2 downto 0)
   );
end p_encoder8to3;

architecture arch of p_encoder8to3 is

begin

process (din, enable)
begin
   if (enable = '1') then        --active HIGH enable
       if (din(7) = '1') then
           dout <= "111";
       elsif (din(6) = '1') then
           dout <= "110";
       elsif (din(5) = '1') then
           dout <= "101";
       elsif (din(4) = '1') then
           dout <= "100";
       elsif (din(3) = '1') then
           dout <= "011";
       elsif (din(2) = '1') then
           dout <= "010";
       elsif (din(1) = '1') then
           dout <= "001";
       else
           dout <= "000";
       end if;
   else
       dout <= "ZZZ";
   end if;
end process;

end arch;

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

--Testbench

library IEEE;
use IEEE.Std_logic_1164.all;
use IEEE.Numeric_Std.all;

entity p_encoder8to3_tb is
end;

architecture bench of p_encoder8to3_tb is

component p_encoder8to3
   port (   enable   : in std_logic;
       din   : in std_logic_vector(7 downto 0);
       dout   : out std_logic_vector(2 downto 0)
   );
end component;

signal enable: std_logic;
signal din: std_logic_vector(7 downto 0);
signal dout: std_logic_vector(2 downto 0) ;

begin

uut: p_encoder8to3 port map ( enable => enable,
din => din,
dout => dout );

stimulus: process
begin
  
   enable    <= '0';
   din   <= "11111111";
   wait for 20 ns;

   enable   <= '1';
   wait for 10 ns;

   din   <= "01111111";
   wait for 10 ns;

   din   <= "00111111";
   wait for 10 ns;

   din   <= "00011111";
   wait for 10 ns;

   din   <= "00001111";
   wait for 10 ns;

   din   <= "00000111";
   wait for 10 ns;

   din   <= "00000011";
   wait for 10 ns;

   din   <= "00000001";
   wait for 10 ns;

wait;
end process;


end;

---------------------------------------------------------------------------------------------------------------------------------------------------------------------


Related Solutions

Give the VHDl code for your an 8-to-3 priority encoder using two 4-to-2 priority encoders and...
Give the VHDl code for your an 8-to-3 priority encoder using two 4-to-2 priority encoders and any additional necessary gates. Use port maps and code the structural behavior using logic gates not if else statements.
VHDL code for a 4 to 2 priority encoder. The structural behavior must be written using...
VHDL code for a 4 to 2 priority encoder. The structural behavior must be written using gates.
Design a 8-to-3 binary encoder, with priority in binary sequence (i.e. input line 0 has higher...
Design a 8-to-3 binary encoder, with priority in binary sequence (i.e. input line 0 has higher priority than input line 1 etc). There should also be an "active" output which is 1 when any input line is active, and "0" when all input lines are 0. If all input lines are 0, the output lines other than the "active" output are "don't care".
can i use port mapping inside a process in vhdl coding
can i use port mapping inside a process in vhdl coding
How do I implement Image Processing using VHDL for FPGA? Please provide VHDL code
How do I implement Image Processing using VHDL for FPGA? Please provide VHDL code
can you please do the following? (8) Step 8: type the following command: sort /etc/passwd |...
can you please do the following? (8) Step 8: type the following command: sort /etc/passwd | head -5 What is the output? Notice that this pipe can be simplified cat /etc/passwd | head -5 What is the output for this? You could accomplish the same thing more efficiently with either of the two commands: head -5 /etc/passwd head -5 < /etc/passwd (9) Step 9: The command displays all the files in the current directory sorted by file size ls -al...
Can someone run this in vhdl and send me the output? acreenshot library IEEE; use IEEE.STD_LOGIC_1164.ALL;...
Can someone run this in vhdl and send me the output? acreenshot library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity VHDL_MOORE_FSM_Sequence_Detector is port ( clock: in std_logic; --- clock signal reset: in std_logic; -- reset input sequence_in: in std_logic; -- binary sequence input detector_out: out std_logic -- output of the VHDL sequence detector ); end VHDL_MOORE_FSM_Sequence_Detector; architecture Behavioral of VHDL_MOORE_FSM_Sequence_Detector is type MOORE_FSM is (Zero, One, OneZero, OneZeroZero, OneZeroZeroOne); signal current_state, next_state: MOORE_FSM; begin -- Sequential memory of the VHDL MOORE FSM Sequence...
CAN SOMEONE RUN THIS WITH VHDL AND SEND ME THE OUTPUT? LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY...
CAN SOMEONE RUN THIS WITH VHDL AND SEND ME THE OUTPUT? LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY LFSR8 IS PORT (Clk, Rst: IN std_logic; output: OUT std_logic_vector (7 DOWNTO 0)); END LFSR8; ARCHITECTURE LFSR8_beh OF LFSR8 IS SIGNAL Currstate, Nextstate: std_logic_vector (7 DOWNTO 0); SIGNAL feedback: std_logic; BEGIN StateReg: PROCESS (Clk,Rst) BEGIN IF (Rst = '1') THEN Currstate <= (0 => '1', OTHERS =>'0'); ELSIF (Clk = '1' AND Clk'EVENT) THEN Currstate <= Nextstate; END IF; END PROCESS; feedback <= Currstate(4)...
# Do not delete this cell. You have to run this cell to test your code...
# Do not delete this cell. You have to run this cell to test your code in the test cases. score = dict() # This function will search the given text in order to find a given word def is_word_there(text, word):        """         What it takes?             a text to be searched             a word to be searched within a text                    what it does?             searches if a word occurs in a text                    What...
You can choose anything you want. Please do fast you can. Please provide an original post...
You can choose anything you want. Please do fast you can. Please provide an original post AND please reply to at least one classmate's post around one of the topics from this week, explaining a topic to the class, discussing a problem that you found particularly difficult, or expanding on something that you learned. To get full points you should have a thoughtful topic or response. You must complete both parts to get full credit. Please see below for an...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT