VHDL code for 1-bit multiplication

Thread Starter

SLAMI

Joined Apr 29, 2009
2
Hi guys;

I need help to write a VHDL code. I don't have any experience with VHDL and I have to write a code for this circuit.



The circuit is only for 1-bit multiplicand and 1-bit multiplier.

a: 1-bit multiplicand
b: 1-bit multiplier
PPi: Bit of incoming partial product
PP(i+1): Bit of outgoing partial product

If you help me guys I'll appreciate your effort and I will learn how to start using VHDL codes

thank you
 

Thread Starter

SLAMI

Joined Apr 29, 2009
2
I wrote this code after I read some sources
Can anyone check it:

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arth.all;​

ENTITY Multiplier IS PORT(​

A: IN std_logic;
B: IN std_logic;
Cin: IN std_logic;
PPi: IN std_logic;
PP(i+1): OUT std_logic;
Cout: OUT std_logic);​

END Multiplier;​

ARCHITECTURE Behavioral OF Multiplier IS
BEGIN
PROCESS (A, B, PPi, Cin, PP(i+1), Cout)
BEGIN
q:= A AND B
PP(i+i)<= q XOR B XOR Cin;
Cout<= (q AND PPi) OR (B AND Cin) OR (A AND Cin);​

END PROCESS;
END Behavioral;​
 
Top