Safe Haskell | None |
---|---|

Language | Haskell2010 |

# Documentation

Arbitrary-width signed integer represented by `n`

bits

KnownNat n => Bounded (Signed n) | |

KnownNat n => Enum (Signed n) | |

Eq (Signed n) | |

KnownNat n => Integral (Signed n) | |

KnownNat n => Num (Signed n) | |

Ord (Signed n) | |

KnownNat n => Real (Signed n) | |

Show (Signed n) | |

KnownNat n => Bits (Signed n) | |

KnownNat n => FiniteBits (Signed n) | |

KnownNat n => Default (Signed n) | |

KnownNat n => Lift (Signed n) | |

BitVector (Signed n) | |

Pack (Signed n) | |

KnownNat ((+) m n) => Mult (Signed m) (Signed n) | |

KnownNat (Max m n) => Add (Signed m) (Signed n) | |

type BitSize (Signed n) = n | |

type SignalP (Signed n) = Signal (Signed n) | |

type MResult (Signed m) (Signed n) = Signed ((+) m n) | |

type AResult (Signed m) (Signed n) = Signed (Max m n) |

resizeS :: (KnownNat n, KnownNat m) => Signed n -> Signed m Source

A sign-preserving resize operation

Increasing the size of the number replicates the sign bit to the left. Truncating a number to length L keeps the sign bit and the rightmost L-1 bits.

resizeS_wrap :: KnownNat m => Signed n -> Signed m Source

A resize operation that is sign-preserving on extension, but wraps on truncation.

Increasing the size of the number replicates the sign bit to the left. Truncating a number of length N to a length L just removes the leftmost N-L bits.