model

package
v0.0.0-...-ce6b004 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HI = 1
	LO = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Circuit

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

func MakeCircuit

func MakeCircuit() *Circuit

func (*Circuit) ClockDown

func (c *Circuit) ClockDown()

func (*Circuit) ClockUp

func (c *Circuit) ClockUp()

func (*Circuit) Connect

func (c *Circuit) Connect(from, to *Port)

func (*Circuit) Cycle

func (c *Circuit) Cycle()

func (*Circuit) GetClock

func (c *Circuit) GetClock() *Port

func (*Circuit) MakePort

func (c *Circuit) MakePort() *Port

func (*Circuit) Nand

func (c *Circuit) Nand(a, b *Port) (out *Port)

Nand

a ---> +------+

| NAND |------> out

b +--> +------+

a   b   | out
--------|----
LO  LO  | HI
LO  HI  | HI
HI  LO  | HI
HI  HI  | LO

func (*Circuit) PreUpdate

func (c *Circuit) PreUpdate()

func (*Circuit) Update

func (c *Circuit) Update()

type Port

type Port struct {
	State int // HI or LO
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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