Question

In: Electrical Engineering

Implement a 2 by 2 multiplier using structure VHDL. The circuit will have two 2-bit unsigned...

Implement a 2 by 2 multiplier using structure VHDL. The circuit will have two 2-bit unsigned inputs (A and B), a 4-bit unsigned product outputs (P). you must use some full adders and gates (AND, OR, NOT, XOR).

Solutions

Expert Solution

---------VHDL code for unsigned multiplier-----------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Unsinmul is
Port ( A,B : in STD_LOGIC_VECTOR(1 DOWNTO 0);

S : out STD_LOGIC_VECTOR(3 DOWNTO 0));
end Unsinmul;
architecture structural of Unsinmul is

component fulladder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Cin : in STD_LOGIC;
S : out STD_LOGIC;
Cout : out STD_LOGIC);
end component;

component andtop is
    Port ( INA1, INA2 : in STD_LOGIC;
           OA   : out STD_LOGIC);
end component;

signal k1,k2,k3,k4:STD_LOGIC;
begin
u1:andtop port map(A(0),B(0),S(0));
u2:andtop port map(A(1),B(0),k1);
u3:andtop port map(A(0),B(1),k2);
u4:andtop port map(A(1),B(1),k3);
u5:fulladder port map('0',k1,k2,S(1),k4);
u6:fulladder port map(k4,k3,'0',S(2),S(3));

end structural;

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity fulladder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Cin : in STD_LOGIC;
S : out STD_LOGIC;
Cout : out STD_LOGIC);
end fulladder;

architecture dataflow of fulladder is

begin

S <= A XOR B XOR Cin ;
Cout <= (A AND B) OR (Cin AND A) OR (Cin AND B) ;

end dataflow;

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity andtop is
    Port ( INA1, INA2 : in STD_LOGIC;
           OA   : out STD_LOGIC);
end andtop;

architecture Behavioral of andtop is
begin
    OA <= INA1 and INA2;
end Behavioral;

(If you satisfied rate the answer, if you have any query leave a comment, Thank you)


Related Solutions

Implement a 2 by 2 multiplier using structure VHDL. The circuit will have two 2-bit unsigned...
Implement a 2 by 2 multiplier using structure VHDL. The circuit will have two 2-bit unsigned inputs (A and B), a 4-bit unsigned product outputs (P). Please use some full adders and gates (AND, OR, NOT, XOR).
Write in verilog, code to implement a 6 bit multiplier. Cascade a 1 bit multiplier to...
Write in verilog, code to implement a 6 bit multiplier. Cascade a 1 bit multiplier to implement this.
using verilog to design a 8x8 unsigned multiplier(with testbench) utilizing a 2x8 multiplier as a building...
using verilog to design a 8x8 unsigned multiplier(with testbench) utilizing a 2x8 multiplier as a building block here is the testbench and code for 2x8: module cpp_mult(mplr,mcand, prod); input [1:0] mplr; input [7:0] mcand; output [9:0] prod; wire [9:0] mcand1; wire [9:0] mcand2; wire [9:0] mcand3; assign mcand0 = 10'b00000000; assign prod = (mplr==2'b00)?mcand0 :        ((mplr==2'b01)?{2'b00,mcand[7:0]}:        ((mplr==2'b10)?{1'b0,mcand[7:0],1'b0}:        ((mplr==2'b11)?{2'b00,mcand[7:0]}+{1'b0,mcand[7:0],1'b0}:8'hxx))); endmodule ____________________________________________________________________ module cpp_mult_tb(); reg [1:0] mplr; reg [7:0] mcand; wire [9:0] prod; // Instantiate the...
Write a VHDL code for a 8x8 bit multiplier. use structural approach. write the design code...
Write a VHDL code for a 8x8 bit multiplier. use structural approach. write the design code and testbench. Use for-generate if possible
Write a VHDL code to implement a Finite State Machine that with an 8 bit sequence...
Write a VHDL code to implement a Finite State Machine that with an 8 bit sequence input (can be any sequence, but lets say it is 11001000), determine how many states there are as well; so if the input sequence is correct it will show the number 1 in a 7 segment display, otherwise it will be 0 in the same 7 segment display. If the input sequence is incorrect, start from the beginning.
Write VHDL code (behavior model) to implement a 4-bit modulo-9 counter and simulate your VHDL code...
Write VHDL code (behavior model) to implement a 4-bit modulo-9 counter and simulate your VHDL code of 4-bit modulo-9 counter in ModelSim, and capture the screenshot of your simulated waveform. Assume clock period Tclk=100ns, initially, the counter is reset to Q3Q2Q1Q0=0000 you need to simulate a complete counting cycle plus one more additional clock period after it is reset to “0000” state.
Using behavioral VHDL, 32-bit up counter with enable.
Using behavioral VHDL, 32-bit up counter with enable.
Using Behavorial VHDL, design a 4-bit up/down counter.
Using Behavorial VHDL, design a 4-bit up/down counter.
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
What's the schematic of the 4-bit multiplier that has two 4-bit inputs and an 8-bit output...
What's the schematic of the 4-bit multiplier that has two 4-bit inputs and an 8-bit output with pure combinational logic? Can you draw the circuit?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT