MCPcopy Create free account
hub / github.com/djhworld/simple-computer / NewBusOne

Function NewBusOne

components/components.go:504–517  ·  view source on GitHub ↗
(inputBus, outputBus *Bus)

Source from the content-addressed store, hash-verified

502}
503
504func NewBusOne(inputBus, outputBus *Bus) *BusOne {
505 b := new(BusOne)
506 b.inputBus = inputBus
507 b.outputBus = outputBus
508
509 for i, _ := range b.andGates {
510 b.andGates[i] = *circuit.NewANDGate()
511 }
512
513 b.notGate = *circuit.NewNOTGate()
514 b.orGate = *circuit.NewORGate()
515
516 return b
517}
518
519func (b *BusOne) ConnectOutput(bc Component) {
520 b.next = bc

Callers 2

NewCPUFunction · 0.92
TestBusOneFunction · 0.85

Calls 3

NewANDGateFunction · 0.92
NewNOTGateFunction · 0.92
NewORGateFunction · 0.92

Tested by 1

TestBusOneFunction · 0.68