clash-prelude-1.4.5: Clash: a functional hardware description language - Prelude library
Copyright(C) 2019 Myrtle Software Ltd
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Clash.Class.Exp

Description

 
Synopsis

Documentation

class Exp a Source #

Type class implementing exponentiation with explicitly resizing results.

Minimal complete definition

(^)

Instances

Instances details
KnownNat m => Exp (Index m) Source # 
Instance details

Defined in Clash.Class.Exp

Associated Types

type ExpResult (Index m) n Source #

Methods

(^) :: forall (n :: Nat). Index m -> SNat n -> ExpResult (Index m) n Source #

KnownNat m => Exp (Unsigned m) Source # 
Instance details

Defined in Clash.Class.Exp

Associated Types

type ExpResult (Unsigned m) n Source #

Methods

(^) :: forall (n :: Nat). Unsigned m -> SNat n -> ExpResult (Unsigned m) n Source #

KnownNat m => Exp (Signed m) Source # 
Instance details

Defined in Clash.Class.Exp

Associated Types

type ExpResult (Signed m) n Source #

Methods

(^) :: forall (n :: Nat). Signed m -> SNat n -> ExpResult (Signed m) n Source #

type family ExpResult a (n :: Nat) Source #

Instances

Instances details
type ExpResult (Index m) n Source # 
Instance details

Defined in Clash.Class.Exp

type ExpResult (Index m) n = Index (Max 2 (m ^ n))
type ExpResult (Unsigned m) n Source # 
Instance details

Defined in Clash.Class.Exp

type ExpResult (Unsigned m) n = Unsigned (Max 1 (m * n))
type ExpResult (Signed m) n Source # 
Instance details

Defined in Clash.Class.Exp

type ExpResult (Signed m) n = Signed (Max 2 (m * n))

(^) Source #

Arguments

:: Exp a 
=> a

Base

-> SNat n

Exponent

-> ExpResult a n

Resized result, guaranteed to not have overflown

Exponentiation with known exponent.