gates

package
v0.0.0-...-8bbb003 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBusSizes

func CheckBusSizes(b1, b2 *Bus, msg string)

Types

type ADD

type ADD struct {
	// contains filtered or unexported fields
}

ADD

func NewADD

func NewADD(wa *Wire, wb *Wire, wci *Wire, wc *Wire, wco *Wire) *ADD

type AND

type AND struct {
	// contains filtered or unexported fields
}

AND

func NewAND

func NewAND(wa *Wire, wb *Wire, wc *Wire) *AND

func (*AND) String

func (this *AND) String() string

type ANDn

type ANDn struct {
	// contains filtered or unexported fields
}

ANDn

func NewANDn

func NewANDn(bis *Bus, wo *Wire) *ANDn

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

func NewBus

func NewBus(n int) *Bus

func WrapBus

func WrapBus(wires []*Wire) *Bus

func WrapBusV

func WrapBusV(wires ...*Wire) *Bus

func (*Bus) GetBit

func (this *Bus) GetBit(n int) *Wire

func (*Bus) GetMaxPower

func (this *Bus) GetMaxPower() int

func (*Bus) GetPower

func (this *Bus) GetPower() int

Retrieves the given power values as an int. This is used mostly in the test suite.

func (*Bus) GetSize

func (this *Bus) GetSize() int

func (*Bus) GetWire

func (this *Bus) GetWire(n int) *Wire

func (*Bus) GetWires

func (this *Bus) GetWires() []*Wire

func (*Bus) SetPower

func (this *Bus) SetPower(vs int)

Assign the given power values (as an int) to the given wires. This is used mostly in the test suite.

func (*Bus) String

func (this *Bus) String() string

type CMP

type CMP struct {
	// contains filtered or unexported fields
}

CMP

func NewCMP

func NewCMP(wa *Wire, wb *Wire, weqi *Wire, wali *Wire, wc *Wire, weqo *Wire, walo *Wire) *CMP

type CONN

type CONN struct {
	// contains filtered or unexported fields
}

CONN

func NewCONN

func NewCONN(wa *Wire, wb *Wire) *CONN

type NAND

type NAND struct {
	// contains filtered or unexported fields
}

NAND

func NewNAND

func NewNAND(wa *Wire, wb *Wire, wc *Wire) *NAND

func (*NAND) Signal

func (this *NAND) Signal()

No getters/setters here, this will be called a lot!

type NOT

type NOT struct {
	// contains filtered or unexported fields
}

NOT

func NewNOT

func NewNOT(wa *Wire, wb *Wire) *NOT

type OR

type OR struct {
	// contains filtered or unexported fields
}

OR

func NewOR

func NewOR(wa *Wire, wb *Wire, wc *Wire) *OR

func (*OR) String

func (this *OR) String() string

type ORe

type ORe struct {
	// contains filtered or unexported fields
}

ORe

func NewORe

func NewORe(wo *Wire) *ORe

func (*ORe) AddWire

func (this *ORe) AddWire(w *Wire)

type ORn

type ORn struct {
	// contains filtered or unexported fields
}

ORn

func NewORn

func NewORn(bis *Bus, wo *Wire) *ORn

type Wire

type Wire struct {
	// contains filtered or unexported fields
}

func NewWire

func NewWire() *Wire

func WireOff

func WireOff() *Wire

func WireOn

func WireOn() *Wire

func (*Wire) AddEarlyhook

func (this *Wire) AddEarlyhook(f prehook)

func (*Wire) AddPrehook

func (this *Wire) AddPrehook(f prehook)

func (*Wire) Connect

func (this *Wire) Connect(g *NAND)

Connect the gates to the current Wire.

func (*Wire) GetPower

func (this *Wire) GetPower() bool

func (*Wire) SetPower

func (this *Wire) SetPower(v bool)

func (*Wire) SetPowerSoft

func (this *Wire) SetPowerSoft(v bool)

func (*Wire) SetTerminal

func (this *Wire) SetTerminal()

func (*Wire) String

func (this *Wire) String() string

type XOR

type XOR struct {
	// contains filtered or unexported fields
}

XOR

func NewXOR

func NewXOR(wa *Wire, wb *Wire, wc *Wire) *XOR

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL