Division of an integer by a real number using VHDL

Joined
Apr 12, 2008
Messages
1
Reaction score
0
VHDL Spherical reflection

Hi!
how do I multiply by a fraction OR divide by a whole number in Vhdl?
can you post some sample codes for that?
Thanks,
gkapoor2
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
How about this - sorry haven't read all the notes above.

-- This code not for synthesize - only for simulation
------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity test_div is
Port ( a : out integer);
end test_div;

architecture Behavioral of test_div is

begin
a <= integer(real(1234)/1.36);
end Behavioral;

your welcome
jeppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top