Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/migen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b2c000e982a4
Choose a base ref
...
head repository: m-labs/migen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 07efe9d7b1a2
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 9, 2015

  1. Copy the full SHA
    6e9d6d7 View commit details

Commits on Sep 10, 2015

  1. Merge pull request #31 from burnpanck/fix-value_bits_sign-mul

    fix bug in value_bits_sign of mul operatiors
    sbourdeauducq committed Sep 10, 2015
    Copy the full SHA
    07efe9d View commit details
Showing with 3 additions and 3 deletions.
  1. +3 −3 migen/fhdl/bitcontainer.py
6 changes: 3 additions & 3 deletions migen/fhdl/bitcontainer.py
Original file line number Diff line number Diff line change
@@ -50,13 +50,13 @@ def value_bits_sign(v):
elif v.op == "*":
if not obs[0][1] and not obs[1][1]:
# both operands unsigned
return obs[0][0] + obs[1][0]
return obs[0][0] + obs[1][0], False
elif obs[0][1] and obs[1][1]:
# both operands signed
return obs[0][0] + obs[1][0] - 1
return obs[0][0] + obs[1][0] - 1, True
else:
# one operand signed, the other unsigned (add sign bit)
return obs[0][0] + obs[1][0] + 1 - 1
return obs[0][0] + obs[1][0] + 1 - 1, True
elif v.op == "<<<":
if obs[1][1]:
extra = 2**(obs[1][0] - 1) - 1