You are developing a primitive microprocessor with only 4 instructions: The firs
ID: 2081743 • Letter: Y
Question
You are developing a primitive microprocessor with only 4 instructions: The first instruction adds two numbers presented at the two inputs. The second instruction multiplies two numbers presented at the two inputs. The third instruction adds the number presented at the first input with the result from the previous instruction. The fourth instruction multiplies the number presented at the first input with the result from the previous instruction. Assume that other mechanisms are present in the other parts of the system that take care of selecting inputs from memory and placing results in memory. See figure. Design a circuit that takes the machine code for the instructions as input and the 'sel' inputs of the two selectors as outputs, with 'sel1' being the left selector controller and 'sel0' being the right selector. In other words, the key to implementing this microprocessor's instruction set is merely making sure the 'sel' lines of the selectors are working correctly. Assume that a '0' input to a 'sel' selects the top input of the selector to connect to the output, and a 'l' input to a 'sel' selects the bottom input. Write out the VHDL for the entity and architecture of your design.Explanation / Answer
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux is
Port ( SEL : in STD_LOGIC_VECTOR (1 downto 0); -- select input
IN : in STD_LOGIC_VECTOR (3 downto 0); -- inputs
X : out STD_LOGIC); -- output
end mux;
architecture Behavioral of multiplexer4_1 is
begin
process(i0,i1,i2,i3,sel)
begin
case sel is
when "00" => bitout <= i0;
when "01" => bitout <= i1;
when "10" => bitout <= i2;
when others => bitout <= i3;
end case;
end process;
end Behavioral;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.