cobverting 64 bit to 32 bit.

Moderator (Company: Titel) #5700808
Rate this post
useful
not useful
slim_pga wrote:
> dose anyone has any idea how can convert the 64 bit output to 32bit?
The usual ways are to truncate the first or the last 32 bits of the 
result.

What ist the highest number that will show up in the 64bit result?
Will it fit in a 32 bit number?

E.g. when the highest number to be calculated is 100000 x 100000 then 
simply truncate the first 32 bits, because they will hold no necessary 
information...
Guest #5700875
Rate this post
useful
not useful
i have a 32bit signale called multi_out. and a mux that inputs 32bit as 
well.
the thing is, that the multi_out is connected between my multiplier 
output ans mux input.
the mux and evrything else in the system works on 32 bit.

here is the last part of the code:
1
signal add_sub_out : std_logic_vector (31 downto 0); 
2
signal multi_out : std_logic_vector (63 downto 0); 
3
begin 
4
alu_add_sub : adder_subtractor port map (leftin,rightin,opcode(0),negative,add_sub_out); 
5
alu_multi : Multiplier_VHDL port map (leftin,rightin,multi_out); 
6
mux : alu_mux port map (add_sub_out,multi_out (31 downto 0),opcode(1),res); 
7
end struc;
in the one to last line i tried to connect the multi_out signal to the 
first 32 bists of the multiplier output. (my profesor said its cool to 
do that for our project) but it dosent work.
Moderator (Company: Titel) #5700978
Rate this post
useful
not useful
slim_pga wrote:
> but it dosent work.
How did you find that out?


> in the one to last line i tried to connect the multi_out signal to the
> first 32 bists of the multiplier output.
The "first" bits (starting from left like reading a text) are "63 downto 
32".
What you do is to use the 32 lower bits and that is what I suggested.

In reality this assignmet by location is not a good idea:
1
mux : alu_mux port map (add_sub_out,multi_out (31 downto 0),opcode(1),res);
Its just laziness during writing...

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now