Answered Essay: Consider the following operational codes (Op Code) and associated instructions for a basic 4-bit ALU The ALU inp

5. Consider the following operational codes (Op Code) and associated instructions for a basic 4-bit ALU The ALU inputs include the 4-bit Op Code (S2, S,, So, C) and two 4-bit words: A(3.0 and B(3.0) The outputs include an 4-bit word, G(3..0), and a single bit carry-out (Co G=A G=A+1 0 G=A+B+1 G A- B G-A-1 G#A G = A AND B G A NAND B G=ANOR B G A XNOR B G=A G=B Design, enter using VHDL entry, and simulate the ALU assuming use of the DE1-SoC board with the Cyclone V SoC 5CSEMASF31C6 device. You may choose any available and appropriate inputs/outputs you wish. Provide the VHDL code as well as the annotated output-timing diagram

Consider the following operational codes (Op Code) and associated instructions for a basic 4-bit ALU The ALU inputs include the 4-bit Op Code (S_2, S_1, S_0, C_i) and two 4-bit words: A(3..0 and B(3..0). The outputs include an 4-bit word, G(3..0), and a single bit carry-out (C_out). Design, enter using VHDL entry, and simulate the ALU assuming use of the DE1-SoC board with the Cyclone V SoC 5CSEMASF31C6 device. You may choose any available and appropriate inputs/outputs you wish. Provide the VHDL code as well as the annotated output-timing diagram.

Expert Answer

 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity alu is
Port ( inp_a : in signed(3 downto 0);
inp_b : in signed(3 downto 0);
sel : in STD_LOGIC_VECTOR (2 downto 0);
out_alu : out signed(3 downto 0));
end alu;

architecture Behavioral of alu is
begin
process(inp_a, inp_b, sel)
begin
case sel is
when “000” =>
out_alu<= inp_a + inp_b; –addition
when “001” =>
out_alu<= inp_a – inp_b; –subtraction
when “010” =>
out_alu<= inp_a – 1; –sub 1
when “011” =>
out_alu<= inp_a + 1; –add 1
when “100” =>
out_alu<= inp_a and inp_b; –AND gate
when “101” =>
out_alu<= inp_a or inp_b; –OR gate
when “110” =>
out_alu<= not inp_a ; –NOT gate
when “111” =>
out_alu<= inp_a xor inp_b; –XOR gate
when others =>
NULL;
end case;

end process;

end Behavioral;
Testbench VHDL Code for 4-Bit ALU

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;

ENTITY Tb_alu IS
END Tb_alu;

ARCHITECTURE behavior OF Tb_alu IS

— Component Declaration for the Unit Under Test (UUT)

COMPONENT alu
PORT(
inp_a : IN signed(3 downto 0);
inp_b : IN signed(3 downto 0);
sel : IN std_logic_vector(2 downto 0);
out_alu : OUT signed(3 downto 0)
);
END COMPONENT;

–Inputs
signal inp_a : signed(3 downto 0) := (others => ‘0’);
signal inp_b : signed(3 downto 0) := (others => ‘0’);
signal sel : std_logic_vector(2 downto 0) := (others => ‘0’);

–Outputs
signal out_alu : signed(3 downto 0);

BEGIN

— Instantiate the Unit Under Test (UUT)
uut: alu PORT MAP (
inp_a => inp_a,
inp_b => inp_b,
sel => sel,
out_alu => out_alu
);

— Stimulus process
stim_proc: process
begin
— hold reset state for 100 ns.
wait for 100 ns;

— insert stimulus here

inp_a <= “1001”;
inp_b <= “1111”;

sel <= “000”;
wait for 100 ns;
sel <= “001”;
wait for 100 ns;
sel <= “010”;
wait for 100 ns;
sel <= “011”;
wait for 100 ns;
sel <= “100”;
wait for 100 ns;
sel <= “101”;
wait for 100 ns;
sel <= “110”;
wait for 100 ns;
sel <= “111”;
end process;

END;

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.

× How can I help you?