Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Error in Multiplication of 8 bit ALU VHDL code

Status
Not open for further replies.

graciousparul

Full Member level 2
Joined
Jan 19, 2008
Messages
128
Helped
6
Reputation
12
Reaction score
0
Trophy points
1,296
Activity points
2,053
Following code simulates and shows the testbench perfectly for all the cases except multiplication ,
Can anyone help me out ?

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;



entity alu is
port
(a: in std_logic_vector(3 downto 0);
b: in std_logic_vector(3 downto 0);
c: in std_logic_vector(2 downto 0);
y: out std_logic_vector(4 downto 0));
end alu;

architecture Behavioral of alu is

begin
process(c)

variable X:std_logic_vector(4 downto 0);
begin
case c is
when "000"=>y<=("0" & a)+("0" & b);
when "001"=>y<=("0" & a)-("0" & b);
when "010"=>y<=("0" & a)*("0" & b);
when "011"=>y<=("0" & a) or ("0" & b);
when "100"=>y<=("0" & a) and ("0" & b);
when "101"=>y<= not ("0" & b);
when "110"=>y<=("0" & a) xor ("0" & b);
when "111"=>y<=("0" & a) nand ("0" & b);
when others=>null;
end case;
end process;


end Behavioral;


I am unable to get the ouptut for multiplications .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top