Booth multiplier code not working

Status
Not open for further replies.

diju.ms

Newbie level 5
Joined
Sep 8, 2012
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,422
hai

i was writing one code for booth multiplier in vhdl.i am attaching the code below.logically it is correct but I am not getting the output..can anybody help me

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


entity BOOTHENGINE is
PORT(P:IN STD_LOGIC_VECTOR(10 DOWNTO 0);
MULTIPLICANT:IN STD_LOGIC_VECTOR(4 DOWNTO 0);

NEW_P:OUT STD_LOGIC_VECTOR(10 DOWNTO 0));
end BOOTHENGINE;

ARCHITECTURE BEHAVIOURAL OF BOOTHENGINE IS

SIGNAL TEMP_P:STD_LOGIC_VECTOR(10 DOWNTO 0);
SIGNAL CHK_P:STD_LOGIC_VECTOR(10 DOWNTO 0);
BEGIN

PROCESS(P,MULTIPLICANT)
BEGIN

CHK_P<=P;

FOR I IN 1 TO 5 LOOP

IF(CHK_P(1 DOWNTO 0)="01") THEN

TEMP_P<=((CHK_P(10 DOWNTO 6)+ MULTIPLICANT) & CHK_P(5 DOWNTO 0));
CHK_P<=(TEMP_P(10) & TEMP_P(10 DOWNTO 1));
NEW_P<=CHK_P;

ELSIF(CHK_P(1 DOWNTO 0)="10") THEN

TEMP_P<=((CHK_P(10 DOWNTO 6)- MULTIPLICANT) & CHK_P(5 DOWNTO 0));
CHK_P<=(TEMP_P(10) & TEMP_P(10 DOWNTO 1));
NEW_P<=CHK_P;
ELSE
NEW_P<=(CHK_P(10) & CHK_P(10 DOWNTO 1));
CHK_P<=(CHK_P(10) & CHK_P(10 DOWNTO 1));

END IF;

END LOOP;

END PROCESS;
END BEHAVIOURAL;
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…