URL
https://opencores.org/ocsvn/mlite/mlite/trunk
[/] [mlite/] [trunk/] [vhdl/] [mult.vhd] - Diff between revs 139 and 196
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 139 |
Rev 196 |
Line 7... |
Line 7... |
-- COPYRIGHT: Software placed into the public domain by the author.
|
-- COPYRIGHT: Software placed into the public domain by the author.
|
-- Software 'as is' without warranty. Author liable for nothing.
|
-- Software 'as is' without warranty. Author liable for nothing.
|
-- DESCRIPTION:
|
-- DESCRIPTION:
|
-- Implements the multiplication and division unit in 32 clocks.
|
-- Implements the multiplication and division unit in 32 clocks.
|
--
|
--
|
|
-- To reduce space, compile your code using the flag "-mno-mul" which
|
|
-- will use software base routines in math.c if USE_SW_MULT is defined.
|
|
-- Then remove references to the entity mult in mlite_cpu.vhd.
|
|
--
|
-- MULTIPLICATION
|
-- MULTIPLICATION
|
-- long64 answer = 0
|
-- long64 answer = 0
|
-- for(i = 0; i < 32; ++i)
|
-- for(i = 0; i < 32; ++i)
|
-- {
|
-- {
|
-- answer = (answer >> 1) + (((b&1)?a:0) << 31);
|
-- answer = (answer >> 1) + (((b&1)?a:0) << 31);
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.